• feat(inference): allow MXFP8 online quantization (#4045)

    carsten released this 2026-10-14 00:48:24 +00:00

    What

    [inference.vllm] quantization is typed as Literal["fp8_per_block"],
    so it is currently impossible to serve with MXFP8. This PR adds
    "mxfp8".

    Why

    vLLM supports --quantization mxfp8 as an online shorthand: a BF16/FP16
    checkpoint's weights are quantized to MXFP8 at load (E4M3 values with
    block-32 E8M0 scales) and activations are quantized dynamically per
    forward, for both dense linears and MoE experts. On Blackwell
    (SM100/SM103) vLLM auto-selects native W8A8 block-scaled GEMMs
    (FlashInfer CuTe-DSL); older GPUs fall back to W8A16 (Marlin). This is
    useful for serving BF16 SFT exports on B200/B300 without building an FP8
    checkpoint.

    How

    The value already passes through verbatim to vLLM's --quantization;
    the pydantic Literal was the only gate. vLLM validates the shorthand
    and picks the kernel at startup (Using <kernel> for MXFP8 GEMM), so no
    further wiring is needed. Unknown shorthands (e.g. mxfp4) stay
    rejected.

    Verified locally: InferenceConfig(vllm={"quantization": "mxfp8"})
    validates, ruff check/format pass, and tests/unit/test_configs.py
    shows no new failures (20 pre-existing failures reproduce on pristine
    origin/main with this checkout's venv).


    Note

    Low Risk
    Single-type widening in config validation with no runtime wiring
    changes; vLLM still validates quantization at server startup.

    Overview
    Extends inference.vllm.quantization so configs can set
    mxfp8 alongside the existing fp8_per_block option. That
    value already forwards to vLLM’s --quantization; the only change is
    lifting the Pydantic Literal gate that previously rejected MXFP8
    at parse time.

    This enables online MXFP8 serving (quantize BF16/FP16 weights at load,
    dynamic activation quant) on supported hardware without a separate FP8
    checkpoint—useful for BF16 SFT exports on Blackwell-class GPUs.

    Reviewed by Cursor Bugbot for commit
    777ad501a85ced1985b1b735b4d633ff2ec2d71d. Bugbot is set up for automated
    code reviews on this repo. Configure
    here.

    Downloads