-
feat(inference): allow MXFP8 online quantization (#4045)
released this
2026-10-14 00:48:24 +00:00 What
[inference.vllm] quantizationis typed asLiteral["fp8_per_block"],
so it is currently impossible to serve with MXFP8. This PR adds
"mxfp8".Why
vLLM supports
--quantization mxfp8as 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 pydanticLiteralwas 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/formatpass, andtests/unit/test_configs.py
shows no new failures (20 pre-existing failures reproduce on pristine
origin/mainwith 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
Extendsinference.vllm.quantizationso configs can set
mxfp8alongside the existingfp8_per_blockoption. That
value already forwards to vLLM’s--quantization; the only change is
lifting the PydanticLiteralgate 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