Skip to content

[Config] Add Qwen3.8-27B FP8 a8w8 blockscale GEMM tunings for gfx950 - #8016

Merged
yifehuan merged 4 commits into
ROCm:mainfrom
abrahamzewoudie:azewoudi/qwen38-27b-fp8-a8w8-blockscale-gfx950
Nov 26, 2026
Merged

yifehuan merged 4 commits into
ROCm:mainfrom
abrahamzewoudie:azewoudi/qwen38-27b-fp8-a8w8-blockscale-gfx950

Conversation

@abrahamzewoudie

@abrahamzewoudie abrahamzewoudie commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

a8w8_blockscale_tuned_gemm_qwen38_27b.csv on main only has gfx942 / 304 CU rows. Qwen3.8-27B-FP8 on MI355X (gfx950, 256 CUs) therefore misses this table and falls back to the default a8w8 blockscale kernel for every TP width.

Added tuning data

809 gfx950 rows appended to aiter/configs/model_configs/a8w8_blockscale_tuned_gemm_qwen38_27b.csv. The existing 45 gfx942 rows are unchanged. Every added kernel name already appears in another tuned table on main, and every row has tuner errRatio 0.

An earlier revision had 827 rows. Review found 18 CK rows (gfx950, K=5120) where (M-1) * N * 2 > 2**31 at BF16 output. For those shapes, a padded row's 32-bit byte offset exceeds 2 GiB, and CK's masked-store offset wraps into valid output. Those 18 rows are removed, and the shapes fall back to the default a8w8 blockscale kernel.

TP Layer (N, K) Rows
8 GDN in_proj 2048×5120 48
4 GQA qkv 3584×5120 28
4 GDN in_proj 4096×5120 28
8 gate_up 4352×5120 48
8 o_proj 5120×768 48
4 o_proj 5120×1536 28
8 down_proj 5120×2176 48
2 o_proj 5120×3072 63
4 down_proj 5120×4352 28
1 o_proj 5120×6144 46
2 down_proj 5120×8704 63
1 down_proj 5120×17408 34
2 GQA qkv 7168×5120 51
2 GDN in_proj 8192×5120 63
4 gate_up 8704×5120 28
1 GQA qkv 14336×5120 41
1 GDN in_proj 16384×5120 40
2 gate_up 17408×5120 54
1 gate_up 34816×5120 22

37 shapes were left out because a8w8_blockscale_tuned_gemm_qwen3_14b.csv already has the same (gfx950, cu_num=256, M, N, K) and a faster us on 36 of them. Adding them would make the model-config merge reject the file. The omitted shapes are 5120×17408, 7168×5120, and 34816×5120 at the M values that table already covers. The one shape where this tune was faster (M=16, 7168×5120, 11.38 µs vs 12.15 µs) is omitted for the same reason.

Serving

TP4, isolated GEMM-tuning ratchet on MI355X, ISL 1024 / OSL 1024, mean of reps 2–3:

default this table
conc 32 output tok/s 1624.55 1859.98 +14.5%
conc 64 output tok/s 2452.34 3013.65 +22.9%

TP1, TP2, and TP8 rows are the same tuner output that the gemm-tuned images served. They do not have a separate isolated serving A/B in this PR.

This PR was developed with AI assistance. The human author reviewed the tuning provenance and the TP4 serving result, and owns the submitted data.

Test plan

  • Confirm the merge of *a8w8_blockscale_tuned_gemm*.csv has no duplicate (gfx, cu_num, M, N, K)
  • Qwen3.8-27B-FP8 on gfx950 logs a tuned kernel for the widths above instead of the default
  • gfx942 rows in this file are unchanged

Reviewed revision

17d69db493f1

Behavior and intent

Adds 809 gfx950 (MI355X, cu_num=256) rows to a8w8_blockscale_tuned_gemm_qwen38_27b.csv. No code changes. The existing 45 gfx942 rows are unchanged. Main has only gfx942 rows, so Qwen3.8-27B-FP8 on MI355X falls back to the default a8w8 blockscale kernel at every TP width. The table is keyed on (gfx, cu_num, M, N, K), so the new rows only match gfx950 with cu_num=256.

Validation and unverified scope

Commands:

  • Duplicate check: count (gfx, cu_num, M, N, K) rows in a8w8_blockscale_tuned_gemm_qwen38_27b.csv with Python's csv module. Result: 854 rows, 0 duplicates.
  • gfx942 unchanged: git diff origin/main -- aiter/configs/model_configs/a8w8_blockscale_tuned_gemm_qwen38_27b.csv | grep '^-[^-]'. Result: no output.
  • Serving: vllm serve Qwen/Qwen3.8-27B-FP8 --tensor-parallel-size {1,2,4,8} ... with AITER_LOG_TUNED_CONFIG=1, then 32 completion requests at ISL 1024 / OSL 1024. Shapes matched from [aiter] shape is ... found padded_M ... is tuned log lines.

Validated:

  • Duplicate check: 854 rows, 0 duplicate (gfx, cu_num, M, N, K) keys.
  • gfx942 rows: all 45 identical to main.
  • Table lookup (checked on the 827-row table before the fix): all 827 gfx950 rows return the PR's kernel name, both with the PR CSV alone and in the merged server table. The 809-row table has not been rerun through this offline lookup; the server rerun below covers it.
  • Control vs PR, MI355X, TP1, rerun on 2026-11-26 with the 809-row table (17d69db493f1), vLLM 0.34.1rc1.dev100+gc2cc003c5 (vllm/vllm-openai-rocm:nightly), both arms fresh, same load:
    • The PR arm picked a PR row for all 154 TP1-layer rows with M <= 32768 that remain in the table (155 before the fix). Kernel names match.
    • The control arm used 0 PR rows.
    • 470 shapes were requested in both arms. 314 selections differ, and all 314 involve a PR row. There are 0 unexplained differences.
  • Serving smoke tests with the PR CSV (ISL 1024 / OSL 1024, 32 requests): TP2 116 PR rows hit, TP4 120, TP8 100, all kernel names match. Combined across the TP1/TP2/TP4/TP8 runs (before the fix): 442 of 827 rows hit, 0 disagreements, 0 fallbacks. One of those hits (M=32768, N=34816, K=5120) was on a removed row, so 441 of the remaining 809 rows are hit. TP2, TP4, and TP8 counts are unchanged, because the removed rows weren't hit at those widths.
  • TP1 throughput, rerun 2026-11-26 with the 809-row table, one run per arm on a shared node: concurrency 16, 1247.8 -> 1284.7 tok/s (+3.0%); concurrency 32, 2045.5 -> 2072.1 tok/s (+1.3%); concurrency 64, 2982.2 -> 3033.8 tok/s (+1.7%). An earlier run before the fix showed +4.1% to +6.7%. The rerun's gains are smaller, and single runs are noisy, so treat these numbers as indicative only.
  • TP4 isolated GEMM ratchet (author's numbers, measured before the fix): conc 32 1624.55 -> 1859.98 tok/s (+14.5%), conc 64 2452.34 -> 3013.65 tok/s (+22.9%). The removed rows are TP1 and TP2 shapes, so the TP4 result is unaffected.

Unverified:

  • 29 TP1-layer rows with M above 32768 can't be reached with the batch limit used in these tests.
  • The 18 removed shapes now use the default kernel. Their performance was not measured.
  • TP2, TP4, and TP8 coverage is not exhaustive. Not every reachable row was hit at those widths.
  • One run per arm for the throughput numbers, so run-to-run noise is not measured. No throughput A/B for TP2 or TP8.

PR-specific question

Workload key: Qwen/Qwen3.8-27B-FP8 a8w8 blockscale linear layers (qkv, o_proj, gate_up, down_proj, GDN in_proj) at the (N, K) and M values in the PR table, on gfx950 with cu_num=256. The 37 keys already covered by a8w8_blockscale_tuned_gemm_qwen3_14b.csv are omitted, so the merge doesn't see duplicate keys. The control-vs-PR run above shows unrelated shapes keep their selection: all 314 changed selections (rerun 2026-11-26) involve a PR row, and there are 0 unexplained differences.

Changed op tests

None.

The gfx942 table does not cover MI355X. These rows are the tuner picks for the TP1, TP2, TP4, and TP8 widths Qwen3.8-27B-FP8 actually runs.

Co-authored-by: Cursor <[email protected]>
@abrahamzewoudie
abrahamzewoudie requested a review from a team November 16, 2026 07:00
@github-actions

Copy link
Copy Markdown
Contributor

🏷️ CI Guide

Runs automatically on every PR:

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

Extended tests (opt-in via labels):

Label Tests
ci:mi300x Run Aiter standard tests on MI300X in PRs; main branch always runs them
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 Radeon R9700 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 8016 --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.

Reviews:
A reviewer is usually assigned within one working day after the PR is ready for review (see Code Review Process). If nobody has responded for about a week, mention the area contact listed in CONTACTS.md. Want to help review? See REVIEWERS.md.

@aiter-bot

aiter-bot commented Nov 16, 2026 •

Copy link
Copy Markdown

READY FOR HUMAN REVIEW

PR Self-Review

Revision 17d69db493f1 · 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

Adds 809 gfx950 (MI355X, cu_num=256) rows to `a8w8_blockscale_tuned_gemm_qwen38_27b.csv`. No code changes. The existing 45 gfx942 rows are unchanged. Main has only gfx942 rows, so Qwen3.8-27B-FP8 on MI355X falls back to the default a8w8 blockscale kernel at every TP width. The table is keyed on (gfx, cu_num, M, N, K), so the new rows only match gfx950 with cu_num=256.

Validation and unverified scope

Commands:
- Duplicate check: count (gfx, cu_num, M, N, K) rows in `a8w8_blockscale_tuned_gemm_qwen38_27b.csv` with Python's `csv` module. Result: 854 rows, 0 duplicates.
- gfx942 unchanged: `git diff origin/main -- aiter/configs/model_configs/a8w8_blockscale_tuned_gemm_qwen38_27b.csv | grep '^-[^-]'`. Result: no output.
- Serving: `vllm serve Qwen/Qwen3.8-27B-FP8 --tensor-parallel-size {1,2,4,8} ...` with `AITER_LOG_TUNED_CONFIG=1`, then 32 completion requests at ISL 1024 / OSL 1024. Shapes matched from `[aiter] shape is ... found padded_M ... is tuned` log lines.

Validated:
- Duplicate check: 854 rows, 0 duplicate (gfx, cu_num, M, N, K) keys.
- gfx942 rows: all 45 identical to main.
- Table lookup (checked on the 827-row table before the fix): all 827 gfx950 rows return the PR's kernel name, both with the PR CSV alone and in the merged server table. The 809-row table has not been rerun through this offline lookup; the server rerun below covers it.
- Control vs PR, MI355X, TP1, rerun on 2026-11-26 with the 809-row table (`17d69db493f1`), vLLM 0.34.1rc1.dev100+gc2cc003c5 (`vllm/vllm-openai-rocm:nightly`), both arms fresh, same load:
  - The PR arm picked a PR row for all 154 TP1-layer rows with M <= 32768 that remain in the table (155 before the fix). Kernel names match.
  - The control arm used 0 PR rows.
  - 470 shapes were requested in both arms. 314 selections differ, and all 314 involve a PR row. There are 0 unexplained differences.
- Serving smoke tests with the PR CSV (ISL 1024 / OSL 1024, 32 requests): TP2 116 PR rows hit, TP4 120, TP8 100, all kernel names match. Combined across the TP1/TP2/TP4/TP8 runs (before the fix): 442 of 827 rows hit, 0 disagreements, 0 fallbacks. One of those hits (`M=32768, N=34816, K=5120`) was on a removed row, so 441 of the remaining 809 rows are hit. TP2, TP4, and TP8 counts are unchanged, because the removed rows weren't hit at those widths.
- TP1 throughput, rerun 2026-11-26 with the 809-row table, one run per arm on a shared node: concurrency 16, 1247.8 -> 1284.7 tok/s (+3.0%); concurrency 32, 2045.5 -> 2072.1 tok/s (+1.3%); concurrency 64, 2982.2 -> 3033.8 tok/s (+1.7%). An earlier run before the fix showed +4.1% to +6.7%. The rerun's gains are smaller, and single runs are noisy, so treat these numbers as indicative only.
- TP4 isolated GEMM ratchet (author's numbers, measured before the fix): conc 32 1624.55 -> 1859.98 tok/s (+14.5%), conc 64 2452.34 -> 3013.65 tok/s (+22.9%). The removed rows are TP1 and TP2 shapes, so the TP4 result is unaffected.

Unverified:
- 29 TP1-layer rows with M above 32768 can't be reached with the batch limit used in these tests.
- The 18 removed shapes now use the default kernel. Their performance was not measured.
- TP2, TP4, and TP8 coverage is not exhaustive. Not every reachable row was hit at those widths.
- One run per arm for the throughput numbers, so run-to-run noise is not measured. No throughput A/B for TP2 or TP8.

PR-specific question

Workload key: Qwen/Qwen3.8-27B-FP8 a8w8 blockscale linear layers (qkv, o_proj, gate_up, down_proj, GDN in_proj) at the (N, K) and M values in the PR table, on gfx950 with cu_num=256. The 37 keys already covered by `a8w8_blockscale_tuned_gemm_qwen3_14b.csv` are omitted, so the merge doesn't see duplicate keys. The control-vs-PR run above shows unrelated shapes keep their selection: all 314 changed selections (rerun 2026-11-26) involve a PR row, and there are 0 unexplained differences.

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
  • 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.

Co-authored-by: Bipradip Chowdhury <[email protected]>
Signed-off-by: Abraham Zewoudie <[email protected]>
@abrahamzewoudie

abrahamzewoudie commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor Author

WAITING ON AUTHOR

PR Self-Review

Revision 9c192dd79dc4 · mode shadow

Waiting for the PR author. The readiness report will appear after the self-review answers are complete for this revision.

Questions to answer in the PR description

  1. What behavior does this PR change, and why is the existing behavior insufficient?
  2. What did you validate, and what remains unverified? Include commands, hardware/configuration and results.
  3. Which exact workload keys consume these configuration changes, and what evidence shows that unrelated shapes keep their previous selection?
  4. For every changed op_tests/ file, what behavior does it cover and why is it not redundant? Write None if no op test changed.

Edit the PR Self-Review section in the PR description. Include the current revision SHA; this comment refreshes automatically.

Missing or invalid answers

  • FAIL — missing ### Reviewed revision in the PR description
  • FAIL — missing ### Behavior and intent in the PR description
  • FAIL — missing ### Validation and unverified scope in the PR description
  • FAIL — missing ### PR-specific question in the PR description
  • FAIL — missing ### Changed op tests in the PR description
  • FAIL — Reviewed revision must contain at least the first 7 characters of the current head SHA
  • FAIL — Behavior and intent has no substantive answer
  • FAIL — Validation and unverified scope has no substantive answer
  • FAIL — PR-specific question has no substantive answer

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

@yifehuan

Copy link
Copy Markdown
Contributor

Hi, I tested 35b2b12 on an MI355X using the same CI wheel for both arms and switching only the merged tuning table. The new CK rows can silently corrupt valid output when the lookup pads M. For example, TP1 gate_up at (M, N, K) = (32767, 34816, 5120) picks the new M=32768 CK row and produces about 30,000 out-of-tolerance elements. This reproduces in eager execution and graph replay. The existing FlyDSL path agrees with an independent FP32 reference rounded to BF16 at the affected positions. Tuning rows CK masks invalid stores by adding 0x80000000 to a 32-bit byte offset. In these large outputs, the offset for a padded row already exceeds 2 GiB. The addition wraps and writes into valid output. CK store implementation Please drop the 18 affected CK rows. In this diff, they are the added ck rows with (M - 1) * N * 2 > 2**31 for BF16 output. I reproduced the issue at M = tuned_M - 1 for all 18 rows. Removing those rows restored the original dispatch and eliminated the out-of-tolerance elements in all 18 cases.

These rows satisfy (M-1)*N*2 > 2**31 for BF16 output. When M is padded,
CK's masked-store offset (+0x80000000 on a 32-bit byte offset) wraps and
writes into valid output. Removing them restores the original dispatch
for those shapes; all other gfx950 rows and all 45 gfx942 rows are
unchanged. Reported by @yifehuan in review.

Co-authored-by: Cursor <[email protected]>
@bichowdh

Copy link
Copy Markdown
Contributor

Hi @yifehuan. thanks for the detailed repro. We dropped the 18 rows in 17d69db493f1, the ones where (M-1) * N * 2 > 2**31. The PR description is updated. Could you rerun your repro on 17d69db493f1 and let us know if the bad outputs are gone? Thanks!

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

@yifehuan
yifehuan merged commit d0a7e56 into ROCm:main Nov 26, 2026
64 checks passed
samremes added a commit to samremes/aiter that referenced this pull request Dec 1, 2026
The helper had grown to ~450 lines plus ~450 lines of tests, mostly
special cases for renames, moves, multi-file groups, ambiguity and
summary counts. It is an advisory hint the reviewer checks against the
diff, so drop them: a tuned CSV pairs with the one untuned CSV in its
folder whose name has the same tokens, and the four mismatch kinds are
set differences over the rows the PR changed. Same findings on recent
tuning merges (ROCm#8016, ROCm#8161, ROCm#7109, ROCm#8566, ROCm#8490); renames and moves
are left to the reviewer.

Also drop the triage audit plumbing for tuning_coverage.txt (A5 findings
are backed through verdicts like any other rule), the .toml/tuning JSON
triggers (aiter tracks no tuning .toml files) and the unrelated
pre-commit change. Key columns are no longer dropped for the whole pair
when one untuned cell is blank, which hid real changes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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