Skip to content

[Config] [Tune] GLM-5.3 a8w8 blockscale GEMM rows for gfx950 - #7381

Merged
demonsan merged 3 commits into
ROCm:mainfrom
amd-sriram:config/glm53-a8w8-blockscale-tune
Nov 11, 2026
Merged

demonsan merged 3 commits into
ROCm:mainfrom
amd-sriram:config/glm53-a8w8-blockscale-tune

Conversation

@amd-sriram

@amd-sriram amd-sriram commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds 87 tuned a8w8 blockscale GEMM rows for GLM-5.3 on MI355X (gfx950, 256 CUs) to the existing a8w8_blockscale_tuned_gemm_glm5_3.csv. Config only.

Motivation

GLM-5.3 (amd/GLM-5.3-Quark-MXFP4-AttnFP8) runs its attention projections as FP8 block-scaled GEMMs. On gfx950 none of these shapes has a tuned row, so every call takes the default kernel. The file on main only has gfx942 (MI300A, 228 CU) rows from #6535.

Changes

  • aiter/configs/model_configs/a8w8_blockscale_tuned_gemm_glm5_3.csv: +87 gfx950 rows (56 ck, 31 cktile), appended after the gfx942 rows.

    • Fused q_a/kv_a (N=2624, K=6144), TP4.
    • q_b and indexer wq_b (N=4096, K=2048 at TP4; N=2048, K=2048 at TP8).
    • kv_b (N=7168, K=512 at TP4; N=3584, K=512 at TP8).
    • o_proj (N=6144, K=4096 at TP4; N=6144, K=2048 at TP8).
    • Indexer wk (N=128, K=6144).
    • Only M values on the standard grid (1 to 32768) that had no gfx950 row are added.
    • M=16384, N=6144, K=2048 (TP8 o_proj) was tuned too but is left out: [Config] Mistral Large 4 gfx950 tuned tables (TP8 + TP4) #7235 (Mistral Large 4) added the same key, and AITER's config load raises on a duplicate key across model_configs/ files. Mistral's row is 216.6 us, ours 208.4 us.
  • aiter/configs/model_configs/a8w8_blockscale_untuned_gemm_glm5_3.csv: +77 shapes, so the untuned and tuned files list the same 196 shapes and a retune keeps them (the other 10 new rows' shapes were already listed).

Performance (if applicable)

End to end, vLLM nightly serving amd/GLM-5.3-Quark-MXFP4-AttnFP8, MI355X TP4. Both arms ran on the same node and the same GPUs (0-3), one after the other. The only difference is the rows. Total token throughput, from the vLLM bench serve sweep:

Hardware Workload/configuration Before After Change
MI355X (gfx950, 256 CU), TP4 8k/1k, concurrency 4 2866 tok/s 2908 tok/s +1.5%
MI355X (gfx950, 256 CU), TP4 8k/1k, concurrency 16 7045 tok/s 7267 tok/s +3.2%
MI355X (gfx950, 256 CU), TP4 8k/1k, concurrency 64 13397 tok/s 14252 tok/s +6.4%
MI355X (gfx950, 256 CU), TP4 8k/1k, concurrency 256 20825 tok/s 23277 tok/s +11.8%
MI355X (gfx950, 256 CU), TP4 60k/600, concurrency 4 14318 tok/s 15428 tok/s +7.8%
MI355X (gfx950, 256 CU), TP4 60k/600, concurrency 32 22151 tok/s 24862 tok/s +12.2%
MI355X (gfx950, 256 CU), TP4 Geomean of 11 points (8k/1k c4-c256, 60k/600 c4-c32) +7.1%

TTFT is 10% to 15% lower at every point and TPOT 1% to 10% lower. GSM8K (200 questions, 5-shot): 0.995 with the rows, 0.99 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

34f0644

Behavior and intent

GLM-5.3 FP8 block-scaled GEMM shapes on MI355X (gfx950, 256 CUs) that had no tuned row now pick a tuned CK or CK-tile kernel. Nothing else changes.

Validation and unverified scope

  • Tuned on an MI355X with no other jobs on the GPUs, using csrc/ck_gemm_a8w8_blockscale/gemm_a8w8_blockscale_tune.py --libtype all. Every row has errRatio 0.
  • All 88 tuned shapes (87 shipped) were run through gemm_a8w8_blockscale with these rows, on the AITER in the vLLM nightly image, against an fp32 torch reference: cosine similarity at least 0.999 for all 88, no NaN.
  • End to end: the table above, with GSM8K 0.995 vs 0.99.
  • Unverified:
    • The TP8 shapes (N=2048/3584/6144 with K=2048/512) are tuned and checked at kernel level only. The end-to-end run is TP4.
    • Not run on gfx942 or MI350P. The rows never match there (gfx950, cu_num=256).

PR-specific question

Rows are keyed on (gfx950, cu_num=256, M, N, K) for the (N, K) pairs listed in Changes. The file is already picked up by the model_configs/ merge in aiter/jit/core.py. The diff only adds lines (+87 tuned rows, +77 untuned shapes, -0). None of the 87 keys exists in any a8w8 blockscale CSV on main (checked against main a0bae86), and the merged table loads with AITER's own duplicate check (main's tables plus this file, on the vLLM nightly image), so every other shape keeps its current selection. The one tuned key that main now has (M=16384, N=6144, K=2048, from #7235) is not in this PR.

Five keys (N=6144, K=4096, M = 1024, 2048, 3072, 4096, 8192) are also in the open draft #7049 (GLM-5.3-Flash dense gate_up, same shape). They are dropped from #7049 (cf43da1), so the two PRs never land a duplicate key; with both files in model_configs/ AITER's config load raises Found 10 duplicate shape entries. Timed on one MI355X GPU, the rows here are faster or equal at all five: 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, with the same output.

Changed op tests

None.

88 rows for the FP8 block-scaled attention projections of GLM-5.3 (amd/GLM-5.3-Quark-MXFP4-AttnFP8) at TP4 and TP8: fused q_a/kv_a (2624x6144), q_b and indexer wq_b (4096x2048, 2048x2048), kv_b (7168x512, 3584x512), o_proj (6144x4096, 6144x2048) and indexer wk (128x6144). Only the M of the standard grid (1..32768) that had no gfx950 row are added, so no row overlaps an existing one. Tuned on an MI355X with no other jobs on the GPUs, --libtype all; every row has errRatio 0.

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

github-actions Bot commented Nov 3, 2026

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 7381 --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 3, 2026 •

Copy link
Copy Markdown

READY FOR HUMAN REVIEW

PR Self-Review

Revision 34f0644075e2 · 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 FP8 block-scaled GEMM shapes on MI355X (gfx950, 256 CUs) that had no tuned row now pick a tuned CK or CK-tile kernel. Nothing else changes.

Validation and unverified scope

- Tuned on an MI355X with no other jobs on the GPUs, using `csrc/ck_gemm_a8w8_blockscale/gemm_a8w8_blockscale_tune.py --libtype all`. Every row has `errRatio` 0.
- All 88 tuned shapes (87 shipped) were run through `gemm_a8w8_blockscale` with these rows, on the AITER in the vLLM nightly image, against an fp32 torch reference: cosine similarity at least 0.999 for all 88, no NaN.
- End to end: the table above, with GSM8K 0.995 vs 0.99.
- Unverified:
  - The TP8 shapes (N=2048/3584/6144 with K=2048/512) are tuned and checked at kernel level only. The end-to-end run is TP4.
  - Not run on gfx942 or MI350P. The rows never match there (`gfx950`, `cu_num=256`).

PR-specific question

Rows are keyed on `(gfx950, cu_num=256, M, N, K)` for the (N, K) pairs listed in Changes. The file is already picked up by the `model_configs/` merge in `aiter/jit/core.py`. The diff only adds lines (+87 tuned rows, +77 untuned shapes, -0). None of the 87 keys exists in any a8w8 blockscale CSV on main (checked against main a0bae86), and the merged table loads with AITER's own duplicate check (main's tables plus this file, on the vLLM nightly image), so every other shape keeps its current selection. The one tuned key that main now has (M=16384, N=6144, K=2048, from #7235) is not in this PR.

Five keys (N=6144, K=4096, M = 1024, 2048, 3072, 4096, 8192) are also in the open draft #7049 (GLM-5.3-Flash dense `gate_up`, same shape). They are dropped from #7049 (cf43da1), so the two PRs never land a duplicate key; with both files in `model_configs/` AITER's config load raises `Found 10 duplicate shape entries`. Timed on one MI355X GPU, the rows here are faster or equal at all five: 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, with the same output.

Changed op tests

None.

PR state

  • PASS — pull request is marked ready for review

Copilot findings

  • PASS — no active Copilot finding lacks a substantive author reply

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.

amd-sriram added a commit to amd-sriram/aiter that referenced this pull request Nov 3, 2026
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.
…now has

ROCm#7235 added M=16384, N=6144, K=2048 to model_configs/a8w8_blockscale_tuned_gemm_mistral_large4.csv; AITER's config load raises on a duplicate shape key across model_configs files.
@samremes

samremes commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Please also extend the untuned csv for the same shapes so if anyone wants to retune, they would get picked up.

Adds the 77 shapes of the new tuned rows that a8w8_blockscale_untuned_gemm_glm5_3.csv did not list, so the untuned and tuned files hold the same shapes and a retune keeps them.

@samremes samremes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@samremes
samremes marked this pull request as ready for review November 9, 2026 17:26
@samremes
samremes requested review from a team and a balanced review from Copilot November 9, 2026 17:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The 87 gfx950 kernel selections need current-head GPU correctness and latency validation, since static checks passed but the available GPU results are author-reported from a vLLM nightly image rather than this checkout.

No open issues 🎉

What changed in this PR

Adds GLM-5.3 FP8 block-scaled GEMM tuning configurations for MI355X (gfx950, 256 CUs), using AITER’s existing model-config loading mechanism without code changes.

Changes:

  • Adds 87 tuned rows: 56 CK and 31 CK-tile selections for attention projection shapes.
  • Adds 77 untuned shapes, keeping the retuning list aligned with the tuned table’s 196 distinct shapes.
  • Preserves existing gfx942 rows and omits the key already supplied by the Mistral Large 4 configuration.
File Description
aiter/​configs/​model_configs/​a8w8_blockscale_untuned_gemm_glm5_3.csv Adds 77 shapes for future retuning.
aiter/​configs/​model_configs/​a8w8_blockscale_tuned_gemm_glm5_3.csv Adds 87 gfx950 kernel selections for GLM-5.3 attention projections.

Review effort: Balanced

@demonsan demonsan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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.

5 participants