Skip to content

vllm.model_executor.layers.quantization.mxfp4

Classes:

GptOssMxfp4Config

Bases: Mxfp4Config

MXFP4 config for GPT-OSS checkpoints.

Checkpoints carry "quant_method": "mxfp4" in their JSON config. override_quantization_method() maps that to the canonical internal name so that the rest of the loading path uses "gpt_oss_mxfp4" consistently.

GptOssMxfp4MoEMethod

Bases: FusedMoEMethodBase

MXFP4 MoE quantization method.

Mxfp4Config

Bases: QuantizationConfig

Canonical base config for MXFP4 quantization.

Subclasses override get_name() and override_quantization_method() to register themselves as the handler for a specific checkpoint format.

_make_moe_method(moe)

MoE method for RoutedExperts. Subclasses override to pick a checkpoint-specific kernel family.

Mxfp4MoEMethod

Bases: FusedMoEMethodBase

MXFP4 MoE quantization method.

_build_moe_kernel(layer)

Build the modular MoE kernel from the (already in-format) weights.

_moe_weight_override_is_int4()

True when --quantization-config.moe.weight int4_per_group_32 was set.

_mxfp4_experts_to_int4_gfx942(weight, scale)

Requantize packed MXFP4 experts to shuffled groupwise int4 for gfx942.

Takes (E, N, K // 2) MXFP4 weights with (E, N, K // 32) E8M0 scales and returns (E, N, K // 2) packed int4 with flattened per-32 scales.

_use_k3_situ_aiter(moe)

Route Kimi-K3 weight-only MXFP4 SiTU MoE to AITER SiTUv2 on gfx950.

_use_k3_situ_int4_gfx942(moe)

Opt-in gfx942 MXFP4-to-int4 requant for Kimi-K3 SiTU experts.