[Performance] Use CuTe-DSL for FlashInfer MXFP4 quantization#48417
[Performance] Use CuTe-DSL for FlashInfer MXFP4 quantization#48417BWAAEEEK wants to merge 1 commit into
Conversation
Co-authored-by: OpenAI Codex <codex@openai.com> Signed-off-by: BWAAEEEK <jooho414@gmail.com>
|
Hi @BWAAEEEK thanks for the PR! Do you think this heuristic is something that could be put into flashinfer? My only concern is the cutedsl backend not working on all CUDA arches that the cuda backend does |
|
Thanks for review @mgoin , that is a good point. FlashInfer currently exposes explicit In this vLLM path, I agree that a generic architecture-aware backend selection would ideally live in FlashInfer so other callers can benefit from it as well. Would you prefer that I move the selection upstream first, or is keeping the explicit backend at this already-gated vLLM kernel call site acceptable for this PR? |
Summary
Use the CuTe-DSL backend for activation quantization in
FlashInferMxFp4LinearKernel.The kernel is already selected only on SM100+ when FlashInfer CuTe-DSL is
available, and its following MXFP4 GEMM already uses the CuTe-DSL backend.
This change makes the activation quantization use the same backend while
keeping backend selection explicit at the kernel call site.
Fixes #48205.
Motivation
The default CUDA backend for
flashinfer.mxfp4_quantizeis a significantbottleneck on B200. Changing only activation quantization to CuTe-DSL improves
both the quantization kernel and end-to-end MXFP4 serving performance.
This is not duplicate work. I checked the issue discussion and searched open
PRs for
#48205, MXFP4 quantization, and CuTe-DSL backend changes beforestarting and immediately before opening this PR; no open PR addresses this
fix.
Performance
Environment: NVIDIA B200 (SM100), FlashInfer 0.6.13, PyTorch 2.11.0+cu130,
CUDA 13.0.
An independent A/B benchmark covering 16 quantization shapes and corrected
Qwen3-8B-like linear shapes produced:
1.78x eager, 2.72x CUDA Graph
End-to-end
nm-testing/Meta-Llama-3-8B-Instruct-MXFP4-GPTQresults with 64prompts, 512 input tokens, 64 output tokens, five trials:
Correctness and model evaluation
Llama-3-8B widths
K={4096, 14336}acrossM=1..16384.identical.
across the benchmarked shape combinations.
gsm8k_cot_llamaevaluation, 1,319 samples, 8-shot, fixed batch size32, synchronous scheduling:
Concurrent batched generations have existing run-to-run numerical variation
with both backends, so concurrent token equality is not used as correctness
evidence.
Tests
Result:
1 passed.All applicable hooks passed, including ruff, formatting, mypy, SPDX, and
configuration validation.
AI assistance was used and I reviewed the results.