Skip to content

[Performance]: The default MXFP4 quant backend of FlashInfer has slow performance, add options for backend "cute-dsl". #48205

Description

@wheird-lee

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=24576mlp.gateup_proj
  • K=12288, N=4096mlp.down_proj
  • K=4096, N=6144self_attn.qkv_proj
  • K=4096, N=4096self_attn.o_proj

For each shape, multiple batch sizes were tested. Results were compared across three modes:

  1. no-quant-a: GEMM time only, excluding activation quantization overhead
  2. cuda-backend: GEMM + activation quantization using CUDA backend
  3. cute-dsl-backend: GEMM + activation quantization using cute-dsl backend

Formats compared:

  • BF16
  • MXFP8
  • MXFP4

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.

Image Image Image Image

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.

Image Image Image Image

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.

Image Image Image Image

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...

  • Make sure you already searched for relevant issues, and asked the chatbot living at the bottom right corner of the documentation page, which can answer lots of frequently asked questions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    performancePerformance-related issues

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions