Skip to content

[ROCm][Perf][GLM-5] Fused decode with the MonoKernel in vLLM - #32

Closed
amd-sriram wants to merge 8 commits into
mainfrom
rocm/glm53-mono-decode-intree
Closed

amd-sriram wants to merge 8 commits into
mainfrom
rocm/glm53-mono-decode-intree

Conversation

@amd-sriram

@amd-sriram amd-sriram commented Oct 9, 2026 •

Copy link
Copy Markdown
Owner

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

Validation

MI355X, GLM-5.3 MXFP4, one build: vLLM 43b4aaea with vllm-project#60216, AITER 4bb520ba with vllm-project#6173. The in-tree arm copies this branch's mono/ and mono_decode.py over that build and deletes AITER's glm5_mono, so nothing can fall back to it.

Op tests: pytest tests/models/glm_mono passes 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):

in-tree kernel AITER kernel
NaN probe, 1/2/4/8 concurrent, up to 61K context all ok all ok
NIAH 8K / 32K / 60K 15/15 15/15
GSM8K strict, 250 questions 0.916 0.880
TPOT concurrency 1 (8K in / 256 out) 6.26 ms 6.26 ms
TPOT concurrency 4 11.38 ms 11.43 ms

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.

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>
@coderabbitai

coderabbitai Bot commented Oct 9, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@amd-sriram

Copy link
Copy Markdown
Owner Author

Moved upstream as vllm-project#60831.

@amd-sriram amd-sriram closed this Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant