Skip to content

[Config] [Tune] GLM-5.3-Flash TP4 bf16 and a8w8 blockscale GEMM rows for gfx950 - #7049

Closed
amd-sriram wants to merge 2 commits into
ROCm:mainfrom
amd-sriram:rocm/glm53flash-tp4-gemm-retune
Closed

amd-sriram wants to merge 2 commits into
ROCm:mainfrom
amd-sriram:rocm/glm53flash-tp4-gemm-retune

Conversation

@amd-sriram

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

Copy link
Copy Markdown
Contributor

Summary

Adds tuned GEMM rows for GLM-5.3-Flash MXFP4 on MI355X (gfx950, 256 CUs, TP4): 37 bf16 rows and 1 a8w8 blockscale row in the existing GLM-5.3-Flash model config files. Config only.

Motivation

Several GEMM shapes of the model have no tuned row, so they take the default kernel selection. The dense FP8 gate_up at prefill sizes falls back to Triton.

Changes

  • aiter/configs/model_configs/glm53_flash_bf16_tuned_gemm.csv: +37 rows.
    • KDA f_b_proj / g_b_proj (N=2048, K=128) for M = 1 to 8192.
    • MoE router (N=160, K=4096) for M = 1 to 8192.
    • KDA in_proj (N=6416, K=4096) and o_proj (N=4096, K=1536/2048) for prefill M.
  • aiter/configs/model_configs/glm53_flash_a8w8_blockscale_tuned_gemm.csv: +1 row.
    • Dense FP8 gate_up (N=6144, K=4096) at M = 6144.
    • The other gate_up prefill sizes (M = 1024, 2048, 3072, 4096, 8192) come from [Config] [Tune] GLM-5.3 a8w8 blockscale GEMM rows for gfx950 #7381. GLM-5.3's o_proj has the same shape, and those rows are faster. They were in this PR first and were dropped in cf43da1, because AITER merges all model_configs/ files of a family into one table and stops at load on a duplicate key.

Performance (if applicable)

Kernel time per call, MI355X:

Hardware Workload/configuration Before After Change
MI355X (gfx950, 256 CU) 16 x 2048 x 128, KDA f_b/g_b decode 5.0 us 2.53 us -49%
MI355X (gfx950, 256 CU) 8192 x 2048 x 128, KDA f_b/g_b prefill 15.7 us 12.0 us -24%
MI355X (gfx950, 256 CU) 8192 x 6144 x 4096 FP8 blockscale, dense gate_up prefill 455 us (Triton) 199.0 us (CK-tile, #7381's row) -56%

End to end, vLLM serving amd/GLM-5.3-Flash-Quark-MXFP4, MI355X TP4, two pairs (control and test on the same node, GPU halves swapped between the pairs), 8k/1k, 60k/600 and 128k/1k at concurrency 4 to 64:

Pair Total throughput (geomean, 7 points) Points faster Worst point
1 +0.51% 6 of 7 -0.6%
2 +1.11% 7 of 7 +0.1%

TPOT is 1% to 2% lower at most points. GPQA Diamond: 0.919 with the rows, 0.909 without.

Testing

  • Unit tests added or updated
  • Performance benchmarks run
  • Tested on MI250X
  • Tested on MI300X

Config rows only, measured on MI355X (gfx950).

Documentation

  • No documentation change is needed, with the reason stated below

Config rows only.

Dependencies

  • No new third-party dependencies added

Breaking Changes

None.

PR Self-Review

Reviewed revision

cf43da1

Behavior and intent

GLM-5.3-Flash GEMM shapes on MI355X (gfx950, 256 CUs) that had no tuned row now pick a tuned kernel: 37 bf16 shapes (KDA f_b/g_b, in_proj, o_proj, MoE router) and the FP8 blockscale gate_up prefill at M = 6144, which used to fall back to Triton. The other gate_up prefill sizes get their rows from #7381. Nothing else changes.

Validation and unverified scope

  • Tuned on MI355X with csrc/gemm_a16w16/gemm_a16w16_tune.py and csrc/ck_gemm_a8w8_blockscale/gemm_a8w8_blockscale_tune.py at the model's TP4 shapes. bf16 rows: 19 hipblaslt, 11 flydsl, 5 torch, 2 triton, max err_ratio 0.012; blockscale row: 1 ck, err_ratio 0.0.
  • End to end: vLLM vllm bench serve, two control/test pairs on one MI355X node (table above): +0.51% and +1.11% geomean, GPQA Diamond 0.919 vs 0.909. That run used the original 6 gate_up rows; 5 of them now come from [Config] [Tune] GLM-5.3 a8w8 blockscale GEMM rows for gfx950 #7381 instead.
  • Duplicate check (cf43da1), on one MI355X GPU with the vLLM nightly 11-02 image: with this PR's original file and [Config] [Tune] GLM-5.3 a8w8 blockscale GEMM rows for gfx950 #7381's file both in model_configs/, the a8w8 blockscale config load raises RuntimeError: Found 10 duplicate shape entries; with this head it loads and the GEMM runs. Kernel time for N=6144, K=4096, [Config] [Tune] GLM-5.3 a8w8 blockscale GEMM rows for gfx950 #7381's rows vs the dropped ones, two alternating runs each: M=1024 38.0 vs 46.3 us, 2048 74.0 vs 75.0, 3072 79.3 vs 113.4, 4096 116.2 vs 142.3, 8192 199.0 vs 285.3; same output (cosine 0.99967 against an fp32 reference for both).
  • Unverified: hipBLASLt rows store a solution index that depends on the hipBLASLt version; they were only checked with the hipBLASLt in the serving image. Not re-timed on this branch's head. Not run on gfx942 or MI350P; the rows never match there (cu_num=256, gfx950).

PR-specific question

bf16 rows are keyed on (gfx950, cu_num=256, M, N, K, bias, dtype, outdtype, scaleAB, bpreshuffle) and blockscale rows on (gfx950, cu_num=256, M, N, K), for the (N, K) pairs listed in Changes. Both files are already picked up by the model_configs/ merge in aiter/jit/core.py. The diff only adds lines (+38 / -0), and none of the 38 new keys exists in any tuned bf16 or a8w8 blockscale CSV on main (checked against main 551c50e), so every other shape keeps its current selection.

Changed op tests

None.

…for gfx950

37 bf16 rows (indexer f_b/g_b N=2048 K=128, router N=160, in_proj/o_proj
prefill M) and 6 a8w8 blockscale gate_up rows (N=6144 K=4096, M=1024-8192),
tuned on MI355X with the GLM-5.3-Flash TP4 shapes. No shape overlaps an
existing row.

Signed-off-by: Sriram Kumar <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

🏷️ CI Guide

Runs automatically on every PR:

  • ✅ Pre-checks (submodule verification, code formatting)
  • ✅ Aiter op tests (gfx942 + gfx950)
  • ✅ Triton tests on MI35X (only when aiter/ops/triton/** or related paths are changed)

Extended tests (opt-in via labels):

Label Tests
ci:gfx1250-ffm-triton Run the five-shard gfx1250 FFM Triton test suite
ci:triton-300x Run an additional Triton test job on MI300X in PRs (added automatically when gfx942 configs change); main branch always runs both MI35X and MI300X
ci:triton-355 Run the full Triton test suite on MI35X, not only the tests the change affects
ci:windows Windows JIT op smoke test on the gfx1201 ROCm runner
ci:multi-gpu Aiter multi-GPU tests on the 8-GPU runner
ci:sglang SGLang integration tests: DeepSeek-R1-MXFP4 accuracy, Qwen 3.5 accuracy
ci:atom ATOM benchmark: DeepSeek-R1-0528, GPT-OSS-120B
ci:atom_full ATOM accuracy suite for PR and main models from ATOM models_accuracy.json
ci:vllm vLLM benchmark: DeepSeek-V4-Pro, MiniMax-M3-MXFP4
ci:all All standard extended tests (excludes ci:atom_full)

Only add ci:atom_full for FlyDSL or Triton upgrades.
Add labels via the sidebar or gh pr edit 7049 --add-label <label>

One backend per PR:
A PR changes one kernel backend: [Triton/Gluon] (Triton and Gluon count as one), [HIP], [ASM], [CK], [OPUS] or [FlyDSL]. If the title ends up with two backend tags, split the PR -- as stacked pull requests when one part cannot merge without the other.

PR title tags & labels:
Component tags ([Triton/Gluon], [HIP], [CK], [ASM], ...) are added to the PR title and as PR labels automatically from the changed files and re-synced on every push — change-type tags like [fix]/[Perf], op tags like [MLA], and human labels (ci:*) are left untouched. Add the no-auto-title label to stop the title rewrites; labels stay in sync either way.

@aiter-bot

aiter-bot commented Nov 2, 2026 •

Copy link
Copy Markdown

NOT READY FOR HUMAN REVIEW

PR Self-Review

Revision cf43da113695 · mode shadow

Author self-review accepted. Readiness report:

Author answers

  • PASS — current-SHA answers are present and structurally specific
Show the author's self-review answers

Behavior and intent

GLM-5.3-Flash GEMM shapes on MI355X (gfx950, 256 CUs) that had no tuned row now pick a tuned kernel: 37 bf16 shapes (KDA f_b/g_b, in_proj, o_proj, MoE router) and the FP8 blockscale `gate_up` prefill at M = 6144, which used to fall back to Triton. The other gate_up prefill sizes get their rows from #7381. Nothing else changes.

Validation and unverified scope

- Tuned on MI355X with `csrc/gemm_a16w16/gemm_a16w16_tune.py` and `csrc/ck_gemm_a8w8_blockscale/gemm_a8w8_blockscale_tune.py` at the model's TP4 shapes. bf16 rows: 19 hipblaslt, 11 flydsl, 5 torch, 2 triton, max `err_ratio` 0.012; blockscale row: 1 ck, `err_ratio` 0.0.
- End to end: vLLM `vllm bench serve`, two control/test pairs on one MI355X node (table above): +0.51% and +1.11% geomean, GPQA Diamond 0.919 vs 0.909. That run used the original 6 gate_up rows; 5 of them now come from #7381 instead.
- Duplicate check (cf43da1), on one MI355X GPU with the vLLM nightly 11-02 image: with this PR's original file and #7381's file both in `model_configs/`, the a8w8 blockscale config load raises `RuntimeError: Found 10 duplicate shape entries`; with this head it loads and the GEMM runs. Kernel time for N=6144, K=4096, #7381's rows vs the dropped ones, two alternating runs each: M=1024 38.0 vs 46.3 us, 2048 74.0 vs 75.0, 3072 79.3 vs 113.4, 4096 116.2 vs 142.3, 8192 199.0 vs 285.3; same output (cosine 0.99967 against an fp32 reference for both).
- Unverified: hipBLASLt rows store a solution index that depends on the hipBLASLt version; they were only checked with the hipBLASLt in the serving image. Not re-timed on this branch's head. Not run on gfx942 or MI350P; the rows never match there (`cu_num=256`, gfx950).

PR-specific question

bf16 rows are keyed on `(gfx950, cu_num=256, M, N, K, bias, dtype, outdtype, scaleAB, bpreshuffle)` and blockscale rows on `(gfx950, cu_num=256, M, N, K)`, for the (N, K) pairs listed in Changes. Both files are already picked up by the `model_configs/` merge in `aiter/jit/core.py`. The diff only adds lines (+38 / -0), and none of the 38 new keys exists in any tuned bf16 or a8w8 blockscale CSV on main (checked against main 551c50e), so every other shape keeps its current selection.

Changed op tests

None.

PR state

  • WAIT — pull request is still a draft

Copilot findings

  • PASS — no active Copilot finding lacks a substantive author reply
  • ADVISORY — Copilot did not review the current head SHA

Code and op-test hygiene

  • PASS — no committed artifact or conflict marker detected

Required CI

  • PASS — Black: passed
  • PASS — Ruff: passed
  • PASS — Repository dependency: passed
  • PASS — Aiter Test Gate: passed

Shadow mode reports what would block but keeps the status successful. Set AITER_PR_SELF_REVIEW_MODE=enforce only after reviewing real false positives.

Signed-off-by: Sriram Kumar <[email protected]>

ROCm#7381 adds faster rows for the same keys (gfx950, 256, M, 6144, 4096) at M = 1024, 2048, 3072, 4096 and 8192, because GLM-5.3's o_proj has the same shape. AITER merges every model_configs/ file of a family into one table and raises on duplicate keys, so the two PRs cannot both carry them. Timed on one MI355X GPU: 38/74/79/116/199 us for ROCm#7381's rows vs 46/75/113/142/285 us for these. M = 6144 stays here.
@amd-sriram

Copy link
Copy Markdown
Contributor Author

Closing. Re-measured end to end on MI355X TP4 with the rows still in this PR: no gain (-0.65% geomean over 14 points). The gain came from the dense gate_up rows, which are now in #7381.

@amd-sriram amd-sriram closed this Nov 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.

2 participants