Repository navigation
[ROCm][Perf][GLM-5] Fused decode with the MonoKernel in vLLM - #32
Closed
amd-sriram wants to merge 8 commits into
Closed
amd-sriram wants to merge 8 commits into
amd-sriram wants to merge 8 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>
The GLM-5 MonoKernel moves from ROCm/aiter#6173 into vllm/models/deepseek_v32/amd/mono; its op tests into tests/models/glm_mono. Signed-off-by: Sriram Kumar <sriramkumar.kishorekumar@amd.com>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Owner
Author
|
Moved upstream as vllm-project#60831. |
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
Same GLM-5 fused decode as vllm-project#60216, with the kernel carried in vLLM instead of AITER. This is an alternative to vllm-project#60216 + ROCm/aiter#6173, opened so the two layouts can be tested side by side before choosing one. It follows the layout of the other mono decode PRs, vllm-project#59705 (MiniMax-M3) and vllm-project#60397 (DeepSeek-V4.1).
What changes against vllm-project#60216
vllm/models/deepseek_v32/amd/mono/: the GLM-5 MonoKernel from [FlyDSL] GLM-5 fused decode-layer MonoKernel ROCm/aiter#6173 atb02df0db8(device code from [Kernel][Perf] Add GLM-5 and Kimi-K3 MonoKernels ROCm/FlyDSL#1204, host wrapper from [Perf] Add GLM-5.2 and Kimi-K3 small-concurrency MonoKernels ROCm/ATOM#2435, plus the paged indexer, dense-layer mode and fixes from [Bug]: As V100 does not support FlashAttention, it is not possible to run the gemma model, hopefully it can support the xformers way to run it vllm-project/vllm#6173). Each file keeps its origin and license in the header. Import paths are the only code change.mono_decode.pyimports the kernel fromvllm.models.deepseek_v32.amd.monoinstead ofaiter.ops.flydsl.glm5_mono.tests/models/glm_mono/: the three op tests from [Bug]: As V100 does not support FlashAttention, it is not possible to run the gemma model, hopefully it can support the xformers way to run it vllm-project/vllm#6173 (MoE layer, dense layer, paged indexer). Each has a pytest entry that runs at TP4 and skips unless four gfx950 GPUs are present.buffer_ops,dpp_utilsand the MXFP4 weight shuffle, which the ROCm path already installs. FlyDSL comes from theflydslpackage.noqafor long lines in the adapted files and forB023in the kernel, whose closures run while each loop iteration is traced.Validation
MI355X, GLM-5.3 MXFP4, one build: vLLM
43b4aaeawith vllm-project#60216, AITER4bb520bawith vllm-project#6173. The in-tree arm copies this branch'smono/andmono_decode.pyover that build and deletes AITER'sglm5_mono, so nothing can fall back to it.Op tests:
pytest tests/models/glm_monopasses at TP4 (3 passed), and the three tests pass at TP8 from the command line. Dense layer error against the quantized reference is 0.06 to 0.12%; the paged indexer picks are identical to the reference.End to end at TP4, two servers at once on the same node (GPUs 0-3 and 4-7):
The kernel code is the same in both arms, so the GSM8K gap is run-to-run noise (about 2 standard errors at 250 questions; the earlier TP4 run of vllm-project#60216 scored 0.904).
The kernel's own validation (GPQA, TP8 end to end, TPOT against the unfused path) is in vllm-project#60216 and ROCm/aiter#6173.