Repository navigation
[ROCm][DSv4.1] Warm up AITER FlyDSL MXFP8 GEMM kernels before serving - #64637
Closed
Fangzhou-Ai wants to merge 2 commits into
Closed
Fangzhou-Ai wants to merge 2 commits into
Fangzhou-Ai wants to merge 2 commits into
Conversation
Signed-off-by: Ahmed <Muhammad.Ahmed@amd.com> Signed-off-by: Fangzhou Ai <fangzhou.ai@amd.com>
AITER picks a FlyDSL kernel per padded token count for the 32x32-block MXFP8 linears and JIT-compiles it on first use. For DeepSeek V4.1 that is 22-41 distinct kernels per weight shape, so a cold server compiled many of them inside its first long prefill step and could exceed the execute-model RPC timeout. Add rocm_flydsl_mxfp8_warmup to kernel_warmup (ROCm, enable_jit_warmup): for each FlyDSL linear shape, run the GEMM once per distinct kernel AITER selects for 1..max_num_batched_tokens tokens (powers of two for untuned shapes). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Fangzhou Ai <fangzhou.ai@amd.com>
Fangzhou-Ai
commented
Oct 30, 2026
Fangzhou-Ai
left a comment
Collaborator
Author
There was a problem hiding this comment.
I would recommend to maybe add these JIT cache to the aiter wheel not on vLLM side if possible
| ) | ||
|
|
||
| rocm_segmented_attn_autotune_warmup(worker) | ||
| if worker.vllm_config.kernel_config.enable_jit_warmup: |
Collaborator
Author
There was a problem hiding this comment.
This should be gated as ROCm only
| return blocks[:, 0].contiguous() | ||
|
|
||
|
|
||
| _FLYDSL_K_ALIGN = 64 # AITER's FlyDSL GEMM needs K % 64 == 0 |
Collaborator
Author
There was a problem hiding this comment.
Is this a universal limit for all FlyDSL GEMM used in vLLM?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Warm up AITER's FlyDSL GEMM for 32x32-block MXFP8 linears (DeepSeek V4.1 on gfx950) before serving, so a cold server does not JIT-compile FlyDSL kernels inside its first long prefill.
Stacked on #60169, which adds the FlyDSL path. The first commit here is #60169's commit rebased onto current main, with conflicts resolved: it keeps main's pre-quantized
QuantizedActivationinput on the FlyDSL branch. Please review only the last commit. I'll rebase onto #60169 once it lands, or the author can fold this commit into #60169 instead.Claims
max_num_batched_tokenscompiles no FlyDSL kernel. Without it, those compiles happen on the serving path.Validation
tests/kernels/quantization/test_rocm_mxfp8_linear.py::test_rocm_flydsl_mxfp8_warmup_leaves_nothing_to_compile[warmup|no_warmup]on MI355X:FLYDSL_RUNTIME_CACHE_DIR.no_warmupcase guards that the test actually exercises the cold path.The rest of the file (#60169's FlyDSL accuracy tests) also passes on the rebased base commit. The test file is already in the AMD kernels CI list.
Details
rocm_flydsl_mxfp8_warmupsits inkernel_warmupnext to the other kernel warmups (ROCm,enable_jit_warmup). For each FlyDSL linear shape, it runs the GEMM once per distinct kernel that AITER's publicget_mxscale_bpreshuffle_configselects for 1..max tokens. Untuned shapes are sampled at powers of two.deep_gemm_warmupfits better.Duplicate check: no open PR warms the FlyDSL MXFP8 GEMM (searched "flydsl warmup", "warm up mxfp8", "bpreshuffle warmup"). #64264 prebuilds MiniMax-M3 NVFP4 FlyDSL kernels, which is a different model and op. The same patch was offered on #60169 in this comment.
Pull Request Checklist
I used vLLM's
/pr-checklistskill. (Mandatory for agents, optional for humans).AI assistance was used during the creation of this PR.
Design Fit: Minimizes impact on core components, reuses existing functionality, and justifies added complexity.
Testing and Validation: Validates the change and ensures any added tests are meaningful and reliable, with CI coverage or documented CI resource constraints and validation performed outside CI.
Code Quality and Style: Keeps code and comments clear and concise, and updates relevant documentation and examples.
Pull Request Contents: Includes a brief summary and relevant links, supports claims with evidence, explains root causes and implementation trade-offs, and follows the contributing guide.
AI assistance (Claude) was used for this change; I reviewed it and ran the tests above.
🤖 Generated with Claude Code