Repository navigation
[ROCm][Perf][GLM-5] Fused sparse-layer decode via AITER MonoKernel - #60216
Closed
amd-sriram wants to merge 7 commits into
Closed
amd-sriram wants to merge 7 commits into
amd-sriram wants to merge 7 commits into
Conversation
Opt-in VLLM_ROCM_GLM_MONO_DECODE: decode steps of 1/2/4/8 tokens run each MoE layer as one AITER launch per GPU. Needs ROCm/aiter glm5_mono. Signed-off-by: Sriram Kumar <sriramkumar.kishorekumar@amd.com>
Read weights marked skip_weight_relayout or is_bmm as unshuffled. TP4 is unchanged; at TP8 kv_b_proj was wrongly unshuffled. Signed-off-by: Sriram Kumar <sriramkumar.kishorekumar@amd.com>
VLLM_ROCM_GLM_MONO_FUSED_INDEXER=1 runs indexer layers inside the kernel. Signed-off-by: Sriram Kumar <sriramkumar.kishorekumar@amd.com>
Zero CUDA-graph pad rows before the fused layers, and convert the dense layers' top-k for the leading shared-index layers. Signed-off-by: Sriram Kumar <sriramkumar.kishorekumar@amd.com>
Drop the external refresh path and VLLM_ROCM_GLM_MONO_FUSED_INDEXER. Signed-off-by: Sriram Kumar <sriramkumar.kishorekumar@amd.com>
One launch slot per layer within each kernel runtime, so the step counter is bumped twice per step instead of after every layer. Signed-off-by: Sriram Kumar <sriramkumar.kishorekumar@amd.com>
The dense MLP is packed as expert-shaped MXFP4 slices; the unfused dense layers, their deferred all-reduce and the index conversion are gone. Signed-off-by: Sriram Kumar <sriramkumar.kishorekumar@amd.com>
This was referenced Oct 9, 2026
Contributor
|
This pull request has merge conflicts that must be resolved before it can be |
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
Opt-in decode path for GLM-5 (
glm_moe_dsa) on ROCm gfx950. WithVLLM_ROCM_GLM_MONO_DECODE=1, each decoder layer of a pure decode step (3 dense, 75 MoE) runs as one AITER MonoKernel launch per GPU. That launch includes the sparse indexer and both tensor-parallel all-reduces.Depends on ROCm/aiter#6173, which adds the kernel (
aiter.ops.flydsl.glm5_mono). The kernel comes from ROCm/FlyDSL#1204 and ROCm/ATOM#2435. The structure follows the MiniMax-M3 fused decode in #59653.Claims
Validation
Base used for these runs. All measurements were taken on
ac68c308plus #50535, #51309, #51314, #59280, #59420, #59421 and #59422. AITER was5b2f7d1dplus ROCm/aiter#6173 (and7bfe279dfor the baseline). This branch is the same 4 files rebased onto currentmain:vllm/models/deepseek_v32/amd/.Serving, TP8.
vllm bench serve-style random dataset,random-range-ratio0.8. 8192/1024 swept at concurrency 4 to 256, 60000/600 at 4 to 32. Baseline is the same stack with the flag off.Serving, TP4. Same build for both runs, only the flag differs. 8K input / 256 output:
This TP4 table was measured with the indexer still outside the kernel. With the in-kernel indexer, a single request's step time drops further at TP4: from 8.44 to 6.92 ms at 8K, and from 8.70 to 7.80 ms at 60K.
Accuracy.
niah_single_2at 64K (lm_eval)GSM8K on 250 questions moves by about 3 points between runs. GPQA at temperature 1 moves by 0.5 points per question.
Dense layers in the kernel, one epoch advance per step (last two commits).
Same image and GPUs for both columns, one run each.
TP8 (8x MI355X), same check: TPOT 5.67 to 5.17 ms (-8.8%) at concurrency 1 and 9.98 to 9.48 ms (-5.0%) at 4; no NaN, NIAH 15/15, GSM8K 0.880 (earlier TP8 runs of this path gave 0.884 to 0.912; 250 questions move by about 3 points).
pytest tests/models/test_glm_mono_decode_weights.py: 4 passed. It checks that the W_UK/W_UV split keeps the checkpoint's FP8 blocks bit-exact. It is not wired into Buildkite: the path needs gfx950 and the GLM-5 checkpoint, and CI has neither.VLLM_GPU_SYNC_CHECK=error. The forward path has no.item(),.cpu()or.tolist()calls; eligibility is decided from host-side metadata.Server command (TP8)
The baseline is the same command with
VLLM_ROCM_GLM_MONO_DECODE=0.Details
When the path runs.
--kv-cache-dtype fp8,VLLM_ROCM_USE_AITER_FUSION_SHARED_EXPERTS=1, no speculative decoding,indexer_rope_interleave, and indexer RoPE tables equal to the MLA ones.Residual stream. The embedding feeds the first launch, and the kernel carries the full residual stream through all 78 layers; the final norm runs on it.
Weights.
kv_b_proj, keeping the checkpoint's FP8 blocks.wk_weights_proj(bf16) andwq_b(block FP8) are bound as-is.Indexer.
block_tableandreq_id_per_token.paged_kv_indices, which the following shared-index layers reuse.CUDA graphs.
Numerics. Greedy text diverges from the regular path after a few tokens. The kernel quantizes activations to MXFP8 for the MXFP4 experts, where the regular path quantizes them to MXFP4. That is why accuracy is checked with evals rather than token match.
Size. About 545 lines outside tests, almost all in the new
mono_decode.py. The only change to an existing file is an 11-line hook inDeepseekV32Modelplus one env var. No model runner, scheduler or attention backend changes.Limitations.
glm_moe_dsa).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.