Skip to content

[Config] Add gfx950 a8w8_blockscale tunings for GLM-5.3 shapes (13-61% on low M) - #5278

Open
stefanskiasan wants to merge 1 commit into
ROCm:mainfrom
stefanskiasan:gfx950-blockscale-splitk
Open

stefanskiasan wants to merge 1 commit into
ROCm:mainfrom
stefanskiasan:gfx950-blockscale-splitk

Conversation

@stefanskiasan

Copy link
Copy Markdown
Contributor

What

Adds 38 gfx950 entries to a8w8_blockscale_tuned_gemm.csv for the GLM-5.3
projection shapes: N=6144 with K=3072/4096/6144, plus N=2624/K=6144,
over M=1..512.

These shapes currently have no gfx950 entries at all in that table
(awk -F, '$1=="gfx950" && $4==6144 && $5==6144' ... | wc -l → 0), so they take
an untuned fallback. On MI355X that lands at roughly 19.9 µs and 1900 GB/s for
M≤32.

How they were measured

The project's own tuner, on an otherwise idle MI355X (256 CUs):

python3 aiter_meta/csrc/ck_gemm_a8w8_blockscale/gemm_a8w8_blockscale_tune.py \
    -i untuned.csv -o tuned.csv --libtype all --splitK --compare \
    --update_improved --min_improvement_pct 3 --mp 4

--compare --update_improved means a row is only taken when it beats the
existing one by ≥3 %, so this cannot regress a shape that was already good.

Results

All 24 low-M shapes improved, none regressed:

shape (M, N, K) before after
(1, 2624, 6144) 20.42 µs 8.01 µs −61 %
(1, 6144, 6144) 20.67 µs 11.00 µs −47 %
(4, 6144, 6144) 20.54 µs 11.33 µs −45 %
(16, 6144, 6144) 19.82 µs 11.41 µs −42 %
(32, 6144, 6144) 19.92 µs 15.20 µs −24 %

Bandwidth on (1, 6144, 6144): 1900 → 3458 GB/s. The winning configs use
splitK=3, which is the expected mechanism: at NPerBlock=64 and N=6144 only
96 workgroups are launched on 256 CUs, while the same kernel config reaches
5140 GB/s at N=36864 (576 workgroups). It is a parallelism shortfall, and
splitting K is what fills the machine.

A second sweep over M=48…512 is included. There the effect fades as expected
once there is enough work: only 14 of 32 shapes cleared the 3 % threshold, and
at N=6144/K=6144 only M=48 (−16.8 %) and M=64 (−4.7 %). From roughly M≥72 splitK
no longer helps.

End to end

vLLM TP4, GLM-5.3 (MXFP4 experts + fp8 attention), MI355X:

  • single-stream decode 171.3 → 184.7 tok/s (median of 6)
  • GSM8K unchanged: 148/150 before and after
  • needle-in-haystack at 66k context: found in both

Related

#5277 — the reason these shapes look the way they do is that --splitK is a
store_true with no default, so the shipped tables were generated without it:
6569 of 6630 gfx950 rows in this file carry splitK=0. This PR fixes the GLM-5.3
shapes; the broader question of re-tuning with splitK enabled is in that issue.

The GLM-5.3 projection shapes (N=6144 with K=3072/4096/6144, plus
N=2624/K=6144) have no gfx950 entries in a8w8_blockscale_tuned_gemm.csv,
so they fall back to an untuned config. On MI355X that lands at roughly
19.9 us and 1900 GB/s for M<=32.

Tuned with the project's own tuner:

  gemm_a8w8_blockscale_tune.py --libtype all --splitK --compare \
      --update_improved --min_improvement_pct 3 --mp 4

All 24 low-M shapes improved by 13-61 %; (1, 6144, 6144) goes from
20.67 us to 11.00 us and 1900 -> 3458 GB/s. The winning configs use
splitK=3: at NPerBlock=64 and N=6144 only 96 workgroups are launched on
256 CUs, so splitting K is what fills the machine.

A second sweep over M=48..512 is included; there the effect fades as
expected once there is enough work (only 14 of 32 shapes improved by the
3 % threshold, and at N=6144/K=6144 only M=48 and M=64).

End to end in vLLM (TP4, GLM-5.3 MXFP4 + fp8 attention), single-stream
decode went from 171.3 to 184.7 tok/s, GSM8K unchanged at 148/150.

Related: ROCm#5277, which is about splitK not being searched by default.

Signed-off-by: Asan Stefanski <[email protected]>
@stefanskiasan
stefanskiasan requested review from a team and a lite review from Copilot September 4, 2026 17:55
@github-actions

github-actions Bot commented Sep 4, 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; main branch always runs both MI35X and MI300X
multigpu 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: GPT-OSS-120B, DeepSeek-R1-0528, Kimi-K2.5
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 5278 --add-label <label>

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 opt this PR out.

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.

🟢 Approval recommended

The change is a straightforward addition of new, non-duplicative tuning rows in the existing CSV schema with no functional code-path modifications.

Pull request overview

Adds tuned gfx950 configurations to AITER’s a8w8 blockscale GEMM tuning table to improve performance for GLM-5.3 projection shapes (notably low-M cases) by enabling better split-K selections where beneficial.

Changes:

  • Appends 38 new gfx950 rows to the blockscale tuned GEMM CSV for GLM-5.3-relevant (M, N, K) shapes.
  • Introduces split-K>0 configurations for low-M shapes (including splitK=3 winners) to address under-parallelization at N=6144.
File summaries
File Description
aiter/configs/a8w8_blockscale_tuned_gemm.csv Adds gfx950 tuned entries for GLM-5.3 projection shapes to improve low-M performance via split-K-capable configs.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

No activity for 15 days, so this is now labelled stale. A push or a comment clears it; keep-open exempts it. Nothing is closed automatically.

@github-actions github-actions Bot added the stale The PR hasn't been updated in 2 weeks label Oct 7, 2026
@zufayu
zufayu requested review from demonsan and removed request for yzhou103 October 9, 2026 08:23
@github-actions github-actions Bot removed the stale The PR hasn't been updated in 2 weeks label Oct 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

No activity for 15 days, so this is now labelled stale. A push or a comment clears it; keep-open exempts it. Nothing is closed automatically.

@demonsan

Copy link
Copy Markdown
Contributor

This PR conflicts with current main and has had no new commits since 2026-09-04. It adds rows directly to the canonical aiter/configs/a8w8_blockscale_tuned_gemm.csv. Model-specific rows belong in a model_configs/*a8w8_blockscale_tuned_gemm*.csv file, with the matching untuned shapes. Please rebase onto current main, move the GLM-5.3 rows into a model config, and re-run python3 -m unittest op_tests.tuning_tests.test_config_shape_collision. If this is no longer needed, please close the PR.

@demonsan

demonsan commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

@aiter-bot review

@aiter-bot

Copy link
Copy Markdown

aiter-bot — queued behind 31 review(s); expect to start in about 4.8 h. The box reviews one PR at a time.

@aiter-bot aiter-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

ROCm/aiter PR #5278 — [Config] Add gfx950 a8w8_blockscale tunings for GLM-5.3 shapes (13-61% on low M)

Review (advisory): 🔴 HIGH RISK
Validation (deterministic): NOT RUN — the PR changes runtime code but ships no test target; the changed path is loaded at run time (aiter/jit/core.py reads this CSV on every a8w8 blockscale GEMM config lookup), so the applicable repo check is the collision guard op_tests/tuning_tests/test_config_shape_collision — the one the maintainer asked to be re-run — not an op test target
Perf (advisory): NOT RUN — no perf target: the PR changes runtime code but ships no test target; the 38 rows are byte-identical to rows already on main (landed by #5602), so a head-vs-base measurement would show no delta by construction
Size: 38 lines / 1 files
Design (advisory): append the GLM-5.3 gfx950 tunings to the canonical a8w8_blockscale_tuned_gemm.csv rather than a model_configs/a8w8_blockscale_tuned_gemm.csv sibling — overruled by demonsan on 2026-11-30, and moot besides: #5602 already landed these 38 rows in the canonical table
Human: recommend jamesETsmith review whether PR #5278 should close as superseded by #5602, which landed these 38 rows byte-identical on main, and where GLM-5.3 rows belong given that moving them to a model_configs sibling while the canonical table keeps them collides at runtime

🔴 [verified] All 38 rows added to aiter/configs/a8w8_blockscale_tuned_gemm.csv are already on main byte-identical — commit 9f9cc3a (#5602, 2026-09-20) landed the same rows — so any rebase that keeps them duplicates the (gfx, cu_num, M, N, K) key 38 times and the runtime config merge raises RuntimeError: Found 76 duplicate shape entries during merge of 'a8w8_blockscale_tuned_gemm' on the first a8w8 blockscale GEMM lookup (reproduced by driving AITER_CONFIGS.get_config_file over a sandbox copy of main's configs, both for rows re-appended to the canonical CSV and for rows moved into a model_configs/a8w8_blockscale_tuned_gemm.csv file as demonsan requested on 2026-11-30 — main's canonical table keeps them either way, and the collision guard runs only on a daily schedule, never in PR CI). Author must close the PR as superseded, or rebase it to an empty diff — the three-way merge against main resolves to exactly main's file — rather than follow the move-to-model-config instruction as written, which breaks every GLM-5.3 a8w8 blockscale GEMM at config lookup.

⚠️ [verified] No base-vs-head timing of this PR exists, and none could show a delta: the 38 rows in aiter/configs/a8w8_blockscale_tuned_gemm.csv are byte-identical to main's, so the PR's headline gains (13-61% on low M, 171.3→184.7 tok/s decode) were measured against its September base and are already in production via #5602 — approving the PR on those numbers double-counts gains main already has. Reviewer should ask the author to re-baseline against current main (expected ~0 delta) or close as superseded.

@github-actions github-actions Bot removed the stale The PR hasn't been updated in 2 weeks label Dec 2, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants