Skip to content

[Triton/Gluon] [Config] gfx1150: add gemm_a8w8_preshuffled configs (int8) - #7282

Merged
azaidy merged 4 commits into
mainfrom
amd/dev/klin/triton-gfx1150-gemm-a8w8-preshuffled-config
Nov 24, 2026
Merged

azaidy merged 4 commits into
mainfrom
amd/dev/klin/triton-gfx1150-gemm-a8w8-preshuffled-config

Conversation

@klin-amd

@klin-amd klin-amd commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This PR adds the two gfx1150 configuration files of gemm_a8w8_preshuffle, the A8W8 GEMM with a preshuffled weight (#6850). It changes no code.

Motivation

gemm_a8w8_preshuffle cannot run on gfx1150. get_gemm_config reads the file with required=False, then asserts on the None:

AssertionError: Required config file doesn't exist:
aiter/ops/triton/configs/gfx1150/triton/gemm/gemm_a8w8_preshuffled/DEFAULT.json

Every preshuffled test fails. A copy of the gfx1151 file would run, but its single any value is 2.61x slower.

Changes

  • .../gemm_a8w8_preshuffled/DEFAULT.json: new. Buckets M_LEQ_8 to M_LEQ_2048 and any, the gfx950 bucket set.
  • .../GEMM-A8W8_PRESHUFFLED-N=2112-K=7168.json: new. Same buckets, for the shape that also has its own gfx950 file. It differs from DEFAULT.json at M_LEQ_32, M_LEQ_64 and M_LEQ_512 only.

The values are for int8: gfx1150 has no fp8 WMMA, so fp8 e4m3 compiles to v_wmma_f32_16x16x16_f16 instead of int8's v_wmma_i32_16x16x16_iu8, and runs at 0.17x bf16 F.linear (36 pairs, 0.052x to 0.440x).

Performance (if applicable)

Hardware Workload/configuration Before After Change
gfx1150, Radeon 880M, 12 CU gemm_a8w8_preshuffle, int8 in, bf16 out, 9 (N, K) shapes x 11 M values = 99 pairs does not run; the lookup asserts 2.61x a copied gfx1151 any value, 2.31x bf16 F.linear (geomean) first run on gfx1150

With no gfx1150 "before" latency, two references replace it: the gfx1151 any value (16 x 64 x 128, 4 warps) through config=, and bf16 F.linear through hipBLASLt. The 9 shapes are Llama-3-8B / Mistral-7B and Qwen2.5-7B linear layers plus 2112x7168 (second table); each row below is the 9 shapes at that M.

M / gfx1151 value (geomean) (min) / bf16 F.linear (geomean) (min)
1 1.26x 1.14x 4.53x 3.73x
8 1.29x 1.17x 3.24x 2.88x
16 1.30x 1.17x 3.30x 2.93x
32 2.19x 1.94x 3.21x 2.92x
64 3.49x 2.42x 2.80x 2.71x
128 3.54x 3.20x 1.69x 1.42x
256 3.34x 2.85x 1.43x 1.32x
512 3.60x 3.37x 1.91x 1.63x
1024 3.88x 3.55x 1.77x 1.58x
2048 3.77x 3.50x 1.67x 1.44x
4096 3.72x 3.50x 1.72x 1.49x

Over the 99 pairs: 2.61x the gfx1151 value (geomean), 1.14x minimum, 4.41x maximum, none below 1.00x. int8 beats bf16 at every pair, 2.31x geomean. Per shape:

N K / gfx1151 value / bf16 F.linear
2112 7168 2.59x 2.69x
3584 3584 2.52x 2.47x
3584 18944 2.88x 2.49x
4096 4096 2.49x 2.30x
4096 14336 2.81x 2.22x
4608 3584 2.51x 2.29x
6144 4096 2.53x 2.17x
28672 4096 2.63x 2.11x
37888 3584 2.52x 2.15x

What the second commit changes

It replaces the values above M = 32. The table divides the final value's speed by the first commit's.

M Bucket final is faster by (geomean) (min) (max) shapes below 1.00x
64 M_LEQ_64 1.59x 1.39x 1.72x 0 of 9
128 M_LEQ_128 1.09x 1.07x 1.12x 0 of 9
256 M_LEQ_256 1.84x 1.57x 2.05x 0 of 9
512 M_LEQ_512 0.93x 0.88x 0.96x 9 of 9
1024 M_LEQ_1024 1.29x 1.18x 1.33x 0 of 9
2048 M_LEQ_2048 1.29x 1.18x 1.35x 0 of 9
4096 any 1.29x 1.18x 1.36x 0 of 9

M_LEQ_512 is the one open point: the final value (32 x 64 x 256, GROUP_SIZE_M 8) is 4% to 13% slower than the first commit's (128 x 64 x 128, GROUP_SIZE_M 1) on all 9 shapes, in three measurements. The grid holds M = 512 alone here, so these 9 shapes are the whole bucket. The bucket still gains 3.60x against main. Consider a return to the first commit's value.

Testing

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

op_tests/triton_tests/gemm/basic/test_gemm_a8w8.py, 1845 tests, on gfx1150 (Radeon 880M, 12 CU):

Tree Result
base (892e5d003d) 712 failed, 753 passed, 380 skipped
head (b7b57e1fa0) 1465 passed, 380 skipped
Group base to head Count
triton_shuffle failed to passed 166
split-K, preshuffle=True failed to passed 546
split-K, preshuffle=False passed to passed 582
other passed to passed 171
Gluon (needs gfx950) skipped in both 340
preshuffle shape check skipped in both 40

Nothing goes from passed to failed. Of the 712 base failures, 706 are the missing file; the other 6 are torch.OutOfMemoryError at N = 106496, K = 16384, which needs a 6.5 GiB fp32 tensor. Those 6 move with run order (all fail alone on base, 5 of 6 alone on head, all pass inside the full head run), so they are this part's memory limit, not a property of this PR. No test file changes; the suite covers the new values through the same loader. MI250X and MI300X cannot read these files.

Documentation

  • Docstrings updated
  • User guide updated
  • Performance guide updated
  • No documentation change is needed, with the reason stated below

Tuning data only.

Dependencies

  • No new third-party dependencies added
  • New dependencies are listed and justified below

Breaking Changes

None.

PR Self-Review

Reviewed revision

5d89c18

Behavior and intent

The operation cannot run on gfx1150 today. After this PR it runs with a tuned value per M bucket, 2.61x faster than the nearest alternative, a copy of the gfx1151 file.

Validation and unverified scope

Hardware: gfx1150, Radeon 880M, 12 CU. Software: ROCm 10.1, torch 2.14.0, Triton 3.8.0, flydsl 0.5.0, performance level high, one exclusive GPU lock per run. Trees: this branch at b7b57e1fa0 against its parent 892e5d003d, which diff -r shows differ by the two new files only; the branch now holds #5505, so kernel and values agree.

Method: pytest .../test_gemm_a8w8.py --junitxml=... per tree, plus -k "106496 and triton_shuffle" alone. Timing uses RotatingBufferBench, the bench_gemm_a8w8.py harness, over a 256 MB pool, 7 alternating rounds per pair, median reported. Alternation leaves a 3.5% two-cycle oscillation on the short variant against 0.4% on the longer ones, so the ratios read slightly low. Two sweeps agree: median spread 0.53%, geomeans 2.609x and 2.600x, both 0 of 99 below 1.00x. Every shape passed an fp32 check first, maximum error 0.0032.

Unverified: M_LEQ_512 is measured on one gfx1150 part only, and the regression above is open; no end-to-end workload; fp8 timed at four M values only; gfx1151 is #7270; Gluon needs gfx950.

PR-specific question

Which exact workload keys consume these configuration changes, and what evidence shows that unrelated shapes keep their previous selection?

The keys are the 10 M buckets of GEMM-A8W8_PRESHUFFLED under configs/gfx1150/, read only by _get_config(..., shuffle=True) for gemm_a8w8_preshuffle with backend="triton". Both gfx1150 parts read this plain tree; a gfx1150/<N>cu/ tree would take priority, as gfx1250/96cu shows, but none exists.

_get_config over the 9 shapes at the 11 M values above plus M = 8192 gives 108 pairs, and all 108 return the exact file values. No gfx1150 shape had a previous selection, because the lookup asserted for every one, so nothing can regress. Elsewhere the test table is the evidence: 582 split-K preshuffle=False and 171 other tests are unchanged. resolve_config_dir keys on gcnArchName, so no other architecture reaches these files.

Changed op tests

None.

@github-actions

github-actions Bot commented Nov 1, 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 7282 --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 1, 2026 •

Copy link
Copy Markdown

READY FOR HUMAN REVIEW

PR Self-Review

Revision 5d89c1824729 · 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

The operation cannot run on gfx1150 today. After this PR it runs with a tuned value per M bucket, 2.61x faster than the nearest alternative, a copy of the gfx1151 file.

Validation and unverified scope

Hardware: gfx1150, Radeon 880M, 12 CU. Software: ROCm 10.1, torch 2.14.0, Triton 3.8.0, flydsl 0.5.0, performance level `high`, one exclusive GPU lock per run. Trees: this branch at `b7b57e1fa0` against its parent `892e5d003d`, which `diff -r` shows differ by the two new files only; the branch now holds #5505, so kernel and values agree.

Method: `pytest .../test_gemm_a8w8.py --junitxml=...` per tree, plus `-k "106496 and triton_shuffle"` alone. Timing uses `RotatingBufferBench`, the `bench_gemm_a8w8.py` harness, over a 256 MB pool, 7 alternating rounds per pair, median reported. Alternation leaves a 3.5% two-cycle oscillation on the short variant against 0.4% on the longer ones, so the ratios read slightly low. Two sweeps agree: median spread 0.53%, geomeans 2.609x and 2.600x, both 0 of 99 below 1.00x. Every shape passed an fp32 check first, maximum error 0.0032.

Unverified: `M_LEQ_512` is measured on one gfx1150 part only, and the regression above is open; no end-to-end workload; fp8 timed at four M values only; gfx1151 is #7270; Gluon needs gfx950.

PR-specific question

*Which exact workload keys consume these configuration changes, and what evidence shows that unrelated shapes keep their previous selection?*

The keys are the 10 M buckets of `GEMM-A8W8_PRESHUFFLED` under `configs/gfx1150/`, read only by `_get_config(..., shuffle=True)` for `gemm_a8w8_preshuffle` with `backend="triton"`. Both gfx1150 parts read this plain tree; a `gfx1150/<N>cu/` tree would take priority, as `gfx1250/96cu` shows, but none exists.

`_get_config` over the 9 shapes at the 11 M values above plus M = 8192 gives 108 pairs, and all 108 return the exact file values. No gfx1150 shape had a previous selection, because the lookup asserted for every one, so nothing can regress. Elsewhere the test table is the evidence: 582 split-K `preshuffle=False` and 171 other tests are unchanged. `resolve_config_dir` keys on `gcnArchName`, so no other architecture reaches these files.

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.

@menglcai-amd
menglcai-amd force-pushed the amd/dev/klin/triton-gfx1150-gemm-a8w8-preshuffled-config branch from 0c533e8 to b7b57e1 Compare November 10, 2026 19:51
@menglcai-amd
menglcai-amd marked this pull request as ready for review November 12, 2026 20:42
@menglcai-amd
menglcai-amd requested review from a team and a balanced review from Copilot November 12, 2026 20:42

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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@github-actions github-actions Bot changed the title [Triton] gfx1150: add gemm_a8w8_preshuffled configs (int8) [Triton/Gluon] [Config] gfx1150: add gemm_a8w8_preshuffled configs (int8) Nov 12, 2026
@zufayu
zufayu requested review from a team and k50112113 November 13, 2026 01:33
klin-amd and others added 2 commits November 12, 2026 18:12
gfx1150 had no gemm_a8w8_preshuffled config, so the wrapper failed.
Add DEFAULT.json and the N=2112 K=7168 specialized file (as on gfx950),
from a search on gfx1150 (Radeon 890M). int8 W8A8; 1.35x faster than
the gfx1151 value used on gfx1150, 1.47x-4.03x faster than bf16.

Co-Authored-By: Claude <[email protected]>
Signed-off-by: Lin, KuanTing <[email protected]>
… = 32 after #5505

#5505 changed the tile remap of _gemm_a8w8_preshuffle_kernel from a
hardcoded NUM_XCDS=8 to the device's XCD count (1 on gfx1150). The first
values all had GROUP_SIZE_M 1 and became 1.15x-2.1x slower at M = 256 and
M >= 1024. The re-search adds GROUP_SIZE_M 8; M_LEQ_8/16/32 keep the first
values (re-search within 1%).

Co-Authored-By: Claude <[email protected]>
Signed-off-by: Lin, KuanTing <[email protected]>
@menglcai-amd
menglcai-amd force-pushed the amd/dev/klin/triton-gfx1150-gemm-a8w8-preshuffled-config branch from b7b57e1 to 72df8c6 Compare November 13, 2026 02:12

@azaidy azaidy 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!

@azaidy
azaidy merged commit d3ef238 into main Nov 24, 2026
83 of 87 checks passed
@azaidy
azaidy deleted the amd/dev/klin/triton-gfx1150-gemm-a8w8-preshuffled-config branch November 24, 2026 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants