Skip to content

vllm.model_executor.layers.fused_moe.experts.trtllm_nvfp4_moe

Classes:

TrtLlmNvFp4ExpertsBase

NvFp4 TRTLLM-Gen MoE kernels. Supports modular and monolithic interface.

_supports_activation(activation) staticmethod

Supports SITU only when the installed FlashInfer exposes it.

_supports_current_device() staticmethod

Supports only Blackwell-family GPUs.

_supports_no_act_and_mul() staticmethod

Supports non-gated MoE (i.e. Nemotron-Nano).

_supports_quant_scheme(weight_key, activation_key) staticmethod

Supports Nvfp4 quantization.

TrtLlmNvFp4ExpertsModular

Bases: TrtLlmNvFp4ExpertsBase, FusedMoEExpertsModular

Modular version of the implementation (just the experts).

The TRTLLM-Gen kernel skips padding rows (topk_ids == -1), so it consumes the padded contiguous layout DeepEP v2 produces.

_invoke_kernel(output, hidden_states, w1, w2, topk_weights, topk_ids, activation, global_num_experts, a1q_scale)

Finalize into output, or stop after GEMM2 when it is None.

_supports_parallel_config(moe_parallel_config) staticmethod

The modular implementation supports all parallel configs.

TrtLlmNvFp4ExpertsMonolithic

Bases: TrtLlmNvFp4ExpertsBase, FusedMoEExpertsMonolithic

Monolithic version of the kernel (router + experts).

_supports_parallel_config(moe_parallel_config) staticmethod

The modular implementation should be used for the Dp/Ep or EPLB case.