Summary
When benchmarking Qwen3-8B-like GEMM shapes with FlashInfer, I observed that MXFP4 GEMM itself provides consistent speedup over BF16, and is significantly faster than MXFP8. However, once activation quantization time is included, the default quantization backend ("cuda") causes MXFP4 performance to drop sharply. In most shapes, MXFP4 even becomes much slower than MXFP8.
Switching the activation quantization backend from "cuda" to "cute-dsl" largely fixes this issue: although activation quantization still introduces overhead, MXFP4 again becomes clearly faster than MXFP8 and often remains faster than BF16.
This suggests that the "cuda" backend of MXFP4 quantization kernel is likely the main bottleneck. (Related issue: flashinfer-ai/flashinfer#2496)
vLLM currently (v0.25) uses the "cuda" backend as the default backend for MXFP4 quantization when using FlashInfer and does not provide an option to use "cute-dsl".
Benchmark setup
The following benchmark uses FlashInfer's mxfp gemm kernels and quantization kernels, including:
mm_fp4 and mm_mxfp8
mxfp4_quantize and mxfp8_quantize
The benchmark covers four Qwen3-8B GEMM shapes:
K=4096, N=24576 — mlp.gateup_proj
K=12288, N=4096 — mlp.down_proj
K=4096, N=6144 — self_attn.qkv_proj
K=4096, N=4096 — self_attn.o_proj
For each shape, multiple batch sizes were tested. Results were compared across three modes:
no-quant-a: GEMM time only, excluding activation quantization overhead
cuda-backend: GEMM + activation quantization using CUDA backend
cute-dsl-backend: GEMM + activation quantization using cute-dsl backend
Formats compared:
All benchmarks were done independently on NVIDIA B200 GPU.
Observations
1. GEMM-only results show MXFP4 is consistently beneficial
When activation quantization overhead is excluded, MXFP4 is faster than BF16 in almost all cases.
This indicates that the MXFP4 GEMM path itself is efficient.
2. Activation quantization with "cuda" backend severely hurts MXFP4
When activation quantization is included and the CUDA backend is used, MXFP4 performance drops dramatically.
The only shape where CUDA-backend MXFP4 still shows clear benefit is K=4096, N=24576. For the other three shapes, MXFP4 is not only slower than BF16, but also significantly slower than MXFP8.
This is unexpected because MXFP4 should generally have lower memory bandwidth and compute cost than MXFP8.
3. cute-dsl backend restores MXFP4 performance
After switching activation quantization to the cute-dsl backend, MXFP4 performance improves substantially.
Although activation quantization overhead still reduces the overall speed compared with GEMM-only results, MXFP4 remains clearly faster than MXFP8 under the cute-dsl backend.
Conclusion
The benchmark results suggest that the "cuda" quant backend appears to be the main bottleneck for inference of MXFP4 quantized models when using FlashInfer backend.
In particular:
- MXFP4 GEMM-only performance is strong.
"cuda"-backend activation quantization makes MXFP4 much slower for most shapes.
"cute-dsl"-backend activation quantization restores the expected MXFP4 advantage.
Suggestions
vLLM currently (v0.25) uses the "cuda" backend as the default backend for FlashInfer MXFP4 quantization (see this code). It is suggested to add the "cute-dsl" backend as an alternative.
Report of performance regression
No response
Misc discussion on performance
No response
Your current environment (if you think it is necessary)
The output of `python collect_env.py`
Before submitting a new issue...
Summary
When benchmarking Qwen3-8B-like GEMM shapes with FlashInfer, I observed that MXFP4 GEMM itself provides consistent speedup over BF16, and is significantly faster than MXFP8. However, once activation quantization time is included, the default quantization backend ("cuda") causes MXFP4 performance to drop sharply. In most shapes, MXFP4 even becomes much slower than MXFP8.
Switching the activation quantization backend from
"cuda"to"cute-dsl"largely fixes this issue: although activation quantization still introduces overhead, MXFP4 again becomes clearly faster than MXFP8 and often remains faster than BF16.This suggests that the
"cuda"backend of MXFP4 quantization kernel is likely the main bottleneck. (Related issue: flashinfer-ai/flashinfer#2496)vLLM currently (v0.25) uses the
"cuda"backend as the default backend for MXFP4 quantization when using FlashInfer and does not provide an option to use"cute-dsl".Benchmark setup
The following benchmark uses FlashInfer's mxfp gemm kernels and quantization kernels, including:
mm_fp4andmm_mxfp8mxfp4_quantizeandmxfp8_quantizeThe benchmark covers four Qwen3-8B GEMM shapes:
K=4096, N=24576—mlp.gateup_projK=12288, N=4096—mlp.down_projK=4096, N=6144—self_attn.qkv_projK=4096, N=4096—self_attn.o_projFor each shape, multiple batch sizes were tested. Results were compared across three modes:
no-quant-a: GEMM time only, excluding activation quantization overheadcuda-backend: GEMM + activation quantization using CUDA backendcute-dsl-backend: GEMM + activation quantization using cute-dsl backendFormats compared:
All benchmarks were done independently on NVIDIA B200 GPU.
Observations
1. GEMM-only results show MXFP4 is consistently beneficial
When activation quantization overhead is excluded, MXFP4 is faster than BF16 in almost all cases.
This indicates that the MXFP4 GEMM path itself is efficient.
2. Activation quantization with
"cuda"backend severely hurts MXFP4When activation quantization is included and the CUDA backend is used, MXFP4 performance drops dramatically.
The only shape where CUDA-backend MXFP4 still shows clear benefit is
K=4096, N=24576. For the other three shapes, MXFP4 is not only slower than BF16, but also significantly slower than MXFP8.This is unexpected because MXFP4 should generally have lower memory bandwidth and compute cost than MXFP8.
3. cute-dsl backend restores MXFP4 performance
After switching activation quantization to the cute-dsl backend, MXFP4 performance improves substantially.
Although activation quantization overhead still reduces the overall speed compared with GEMM-only results, MXFP4 remains clearly faster than MXFP8 under the cute-dsl backend.
Conclusion
The benchmark results suggest that the
"cuda"quant backend appears to be the main bottleneck for inference of MXFP4 quantized models when using FlashInfer backend.In particular:
"cuda"-backend activation quantization makes MXFP4 much slower for most shapes."cute-dsl"-backend activation quantization restores the expected MXFP4 advantage.Suggestions
vLLM currently (v0.25) uses the
"cuda"backend as the default backend for FlashInfer MXFP4 quantization (see this code). It is suggested to add the"cute-dsl"backend as an alternative.Report of performance regression
No response
Misc discussion on performance
No response
Your current environment (if you think it is necessary)
Before submitting a new issue...