Skip to content

[Triton/Gluon] [gfx1250] gemm_a16w16: GPT-OSS decode buckets retuned with rotating weights; LM-head files - #7289

Merged
azaidy merged 13 commits into
ROCm:mainfrom
akao-amd:pr-gfx1250-gemm-a16w16-gptoss-decode
Nov 11, 2026
Merged

azaidy merged 13 commits into
ROCm:mainfrom
akao-amd:pr-gfx1250-gemm-a16w16-gptoss-decode

Conversation

@akao-amd

@akao-amd akao-amd commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

��## Summary

Retunes the decode graph buckets (M d" 128) of the TP1 QKV (N=5120,K=2880) and O (N=2880,K=4096) files, and adds LM-head files for N=201088,K=2880 (TP1) and N=100544,K=2880 (TP2). The LM-head files set DEFAULT_FALLBACK and define M_LEQ_1 through M_LEQ_128 only, so M > 128 stays on DEFAULT.json.

compute_bound picks set REGISTER_STORE 2 (the coalesced register store from #7288). bandwidth_bound picks store from registers on that kernel's existing path and do not set the key.

Stacked on #7288 (pr-gfx1250-gemm-a16w16-large-m-regstore). This commit does not change the large-M buckets, the TP2 QKV/O files, or the router file. Until #7288 merges, the diff against main also contains that PR. Please review the decode-bucket retune and the two LM-head files here. The register-store epilogue, the large-M buckets, and the TP2 QKV/O files are #7288.

Motivation

Decode reads the weight matrix from HBM on every step. A microbenchmark that reuses one weight tensor keeps it hot in cache and picks a different tile than serving does. With rotating weights (40 copies for QKV, 48 for O, each set > 1 GB, one hot activation) the current entries reproduce a gpt-oss-120b trace: O at M 64 is 30.2 �s (trace 30.6; slower than M 128 at 15.4 �s), QKV at M 4 is 17.6 �s (trace 18.6). The LM head had no shape file, so it ran DEFAULT.json (363 �s at M 64, N 201088).

The new entries were chosen under that cold-weight setup: 220 sampled candidates of both kernels at each bucket's top M, then the top 10 re-timed at 2� 4 M inside the bucket. The pick is the best mean ratio to the old entry across the bucket.

Config keys

Lookup is GEMM-A16W16-N={N}-K={K}.json, then the first M_LEQ_* with bound e" M. This commit writes only the keys below. M_LEQ_256 and above on the QKV and O files, their any entries, and every other shape file are unchanged from #7288.

File Keys Tile (BLOCK_M�N�K), warps, kernel
QKV N=5120,K=2880 M_LEQ_1, M_LEQ_4, M_LEQ_8 16�32�256, 2, compute_bound, REGISTER_STORE 2
same M_LEQ_16 16�32�256, 2, bandwidth_bound
same M_LEQ_32 32�32�128, 2, compute_bound, REGISTER_STORE 2
same M_LEQ_64 64�64�256, 4, compute_bound, REGISTER_STORE 2
same M_LEQ_128 64�128�128, 4, bandwidth_bound
O N=2880,K=4096 M_LEQ_1, M_LEQ_4, M_LEQ_8 16�16�256, 1, bandwidth_bound
same M_LEQ_32 32�32�512, 4, compute_bound, REGISTER_STORE 2
same M_LEQ_64 64�32�256, 4, bandwidth_bound
same M_LEQ_128 64�64�256, 4, compute_bound, REGISTER_STORE 2
LM head N=201088,K=2880 (new) M_LEQ_1 through M_LEQ_16 16�64�256, 2, bandwidth_bound
same M_LEQ_32 32�64�256, 2, bandwidth_bound
same M_LEQ_64 64�128�128, 4, compute_bound, REGISTER_STORE 2
same M_LEQ_128 64�128�128, 2, compute_bound, REGISTER_STORE 2
LM head TP2 N=100544,K=2880 (new) M_LEQ_1, M_LEQ_4 16�32�256, 2, bandwidth_bound
same M_LEQ_8, M_LEQ_16 16�64�256, 2, bandwidth_bound
same M_LEQ_32 32�128�128, 4, bandwidth_bound
same M_LEQ_64, M_LEQ_128 64�128�128, 2, compute_bound, REGISTER_STORE 2

O M_LEQ_16 is unchanged. It measured 1.003� 1.005 of the old entry, inside the noise of an unchanged key.

Left on the previous selection after the same sweep:

  • Router M d" 128. The best sampled candidate was 0.85� 1.00� the current entry (a few microseconds) and the file was left unchanged.
  • TP2 QKV and O at decode M, which DEFAULT.json already serves, within 4% of the best sampled candidate.
  • LM head M > 128: no key, DEFAULT_FALLBACK keeps DEFAULT.json. M 129 was part of the numeric check.

Performance (gfx1250 MI45x DPX partition, 96 CUs, rotating weights)

A-B-A, file configs. A is this branch's parent (#7288). Each point is a CUDA graph of 40� 48 calls (2� 3 copies for the LM heads: 2.3 GB and 1.7 GB, still cold), median of 20. Times in �s, then B / average(A).

M O QKV LM head N201088 LM head TP2 N100544
1 8.4�!5.5 (0.66) 8.3�!6.2 (0.75) 191�!138 (0.73) 98�!73 (0.74)
4 8.4�!5.7 (0.68) 17.7�!6.5 (0.37) 205�!140 (0.68) 105�!94 (0.90)
16 6.1�!6.1 (1.00, unchanged key) 16.2�!7.2 (0.45) 219�!152 (0.69) 112�!79 (0.70)
32 10.2�!6.7 (0.66) 10.7�!8.0 (0.75) 267�!172 (0.65) 136�!90 (0.66)
64 30.5�!8.3 (0.27) 13.2�!9.2 (0.70) 363�!227 (0.62) 185�!116 (0.63)
128 15.4�!10.8 (0.70) 16.7�!13.3 (0.80) 569/486�!401 (0.76) 247�!212 (0.86)

The LM head at M 128 moves between the two A arms (569 vs 486 �s): a cold ~1.2 GB stream. The weakest new buckets are still ahead of the old entry (LM head TP1 M 72 at 0.88, TP2 M 96 at 0.90). No measured M in 1� 128 got slower, apart from O M 12/16 on the unchanged M_LEQ_16 key (1.003 / 1.005).

End to end, on top of #7288 (gpt-oss-120b W4A8, SGLang TP1, fixed-seq run 1, controlled A-B-A, box idle). The bracket holds P6a on both sides and swaps this commit in the middle arm. Output tok/s, this commit / the arms without it:

Point Ratio
1024/1024 c64 1.111
8192/1024 c64 1.061
70000/300 c4 1.019

70k mean TTFT stays inside the two neighboring arms (2,857 / 2,861 / 2,781 ms). GSM8K strict 0.9553� 0.9636 across the five arms; the arm with this commit is 0.9598.

Test

Hardware: same partition and image as #7288 (rocm/sgl-dev:v0.5.23-rocm101-mi45x-20261031, ROCm 10.1.0, Triton b509148826). AITER_GFX1250_A16W16_STORE unset. QKV and O with bias. Both LM heads without bias, matching SGLang's tgemm.mm(hidden, weight).

  • check_p3_correctness.py: 72 cases. M is every bucket edge and an interior point (1, 2, 4, 5, 8, 9, 12, 16, 17, 24, 32, 33, 48, 64, 65, 96, 128, 129). M 129 is the first key this commit does not own. Same tolerance as [Triton/Gluon] [gfx1250] gemm_a16w16: register-store epilogue option and GPT-OSS large-M / TP2 configs #7288 (finite, within 2� the old entry's fp32 error, and within 2{ v of the old output). 72/72 pass, old and new bitwise equal. CUDA graph of 20 calls (4 for the LM heads) � 50 replays: 0 mismatches. N 100544 with BLOCK_N 128 leaves a 64-column tail; that tail is in every TP2 LM-head case that uses BLOCK_N 128. K 2880's partial tile is in the BLOCK_K 128 and 256 cases.
  • Earlier replay of the candidates (replay_*.jsonl): 2,000� 10,000 calls per shape and M, 0 mismatches. That checks repeatability only; the numeric gate is the check above.
  • Sweep commands: run_bench.sh --rotate (48 O, 40 QKV, 2 / 3 for the two LM heads), run_refine.sh for the top 10 per bucket, file_aba.sh for the table above.

Not tried: the persistent Gluon kernel, and the OPUS rows. Validated on the recipe AITER tree, then this one commit applied cleanly on top of #7288's branch.

MI355X (gfx950), 2026-11-05, image rocm/sgl-dev:v0.5.23-rocm10-mi35x-20261102, ROCm 10.0.0. Whole op_tests/triton_tests/gemm/basic/test_gemm_a16w16.py at this head (ddb8f4778ae1): 377 passed, 0 failed, 764 skipped. The 5 test_gemm_a16w16_gfx1250_gptoss_96cu_lookup cases pass and are not skipped. The same 5 failed at #7288's pre-fix head 13d9dcc310b8 (that commit is not in this branch) with a missing configs/gfx950/gluon/gemm/gemm_a16w16/DEFAULT.json. main c1096fa40a90 on the same box: 372 passed, 0 failed.

PR Self-Review

Reviewed revision

ddb8f4778ae162418817746fbd98157e04bdbec5

Behavior and intent

GPT-OSS decode (M d" 128) was selecting tiles that are fast when the weight matrix stays in cache and slow when it is streamed. With rotating weights the old O M 64 entry is ~30 �s and the old QKV M 4 entry is ~18 �s, matching a serving trace, and both are slower than neighboring larger M. This commit replaces those buckets, and adds the two LM-head files that were missing, with tiles picked under cold weights.

compute_bound picks use REGISTER_STORE 2 from #7288. bandwidth_bound picks use that kernel's register store. O M_LEQ_16 and every key for M > 128 stay on the parent selection.

Validation and unverified scope

Validated on one gfx1250 DPX partition (96 CUs), image rocm/sgl-dev:v0.5.23-rocm101-mi45x-20261031, ROCm 10.1.0, Triton b509148826, AITER_GFX1250_A16W16_STORE unset. Parent tree is #7288.

  • Numerics: check_p3_correctness.py, 72 cases, old entries read from the parent with git show (LM heads fall back to DEFAULT.json there). 72/72 bitwise equal to the old schedule under the stated tolerance. 0 graph-replay mismatches.
  • Kernel A-B-A: file_aba.sh with rotating weights. O M 40� 64 goes from 29.7� 30.5 �s to 7.6� 8.3 �s. QKV M 4 goes from 17.7 �s to 6.5 �s. LM head N201088 M 64 goes from 363 �s to 227 �s. TP2 LM head M 64 goes from 185 �s to 116 �s.
  • Serving: controlled bracket, this commit against the same tree without it, P6a present on both sides, box idle, InferenceX fixed-seq run 1, TP1. Output tok/s ratios 1.111 (1k c64), 1.061 (8k c64), 1.019 (70k c4). GSM8K strict on the commit's arm: 0.9598.
    Not run: AITER op tests on gfx1250, shapes other than these four, the persistent Gluon kernel, OPUS. The large-M and TP2 QKV/O results belong to [Triton/Gluon] [gfx1250] gemm_a16w16: register-store epilogue option and GPT-OSS large-M / TP2 configs #7288; this commit does not remeasure them. LM-head A-arm times at M 128 drift (569 vs 486 �s) because the working set does not fit in cache.

PR-specific question

The keys this commit selects are the seven M_LEQ_1& M_LEQ_128 entries on N=5120,K=2880 and on N=2880,K=4096 except O M_LEQ_16, plus M_LEQ_1& M_LEQ_128 on the two new LM-head files. Tiles are in the table under Config keys.

Everything else keeps the parent's selection:

  • On the two edited files, M_LEQ_256 and above and any are not in this commit. The numeric check includes M 129, which resolves to that next key, and it matches the parent bitwise.
  • O M_LEQ_16 is not in the diff. A-B-A at M 12 and M 16 is 1.003 and 1.005.
  • Router (N=128,K=2880), TP2 QKV (N=2560,K=2880) and TP2 O (N=2880,K=2048) are not in this commit. The decode sweep measured them and left them: the best router candidate was 0.85� 1.00� the current entry, and TP2 decode was within 4% of DEFAULT.
  • The LM-head files have no key above M_LEQ_128 and set DEFAULT_FALLBACK, so M > 128 stays on DEFAULT.json. No other (N, K) file is added or edited.
  • REGISTER_STORE applies only where the key is set. The override env var was unset. bandwidth_bound entries in this commit do not set it.

Changed op tests

op_tests/triton_tests/gemm/basic/test_gemm_a16w16.py � same tests as #7288, plus the two LM-head shapes on test_gemm_a16w16_gfx1250_gptoss_tuned. test_gemm_a16w16_gfx1250_gptoss_96cu_lookup still covers the five prefill shapes only (the LM heads are tuned for decode M). It pins get_arch() to gfx1250 so the MI35X runner reads configs/gfx1250/96cu instead of a gfx950 Gluon default. On an MI355X (gfx950) those 5 cases pass at this head. The kernel tests skip unless Gluon is supported on the device.

��� Generated with Claude Code

akao-amd and others added 4 commits November 1, 2026 23:08
…osen per config entry (REGISTER_STORE)

The compute_bound kernel ended with the gfx1250 B1 pattern: the tile is staged in LDS
(ds_store), a workgroup barrier, then tensor_store_from_lds, whose LDS read can miss
the waves' ds_stores on gfx1250 (no documented wait or fence closes it; B1a-B1c).
A config entry may now pick the epilogue with "REGISTER_STORE":
  0 the LDS-staged TDM store (default: every existing entry is unchanged),
  1 buffer stores straight from the WMMA layout (as the bandwidth_bound kernel),
  2 coalesced register store: convert_layout to a blocked layout of 16-byte
    vectors along N (an ordinary ds_store/barrier/ds_load round trip), then
    buffer stores rebased to the block in int64.
AITER_GFX1250_A16W16_STORE=<0|1|2> overrides every entry (A/B only).

Cost vs the TDM store at gpt-oss's existing entries (gfx1250 DPX partition, bf16,
bias): mode 2 +0..5 % at M 256-8192, -24 % at O M=64 (30.1 -> 22.9 us), -12 % at QKV
M=16; mode 1 +3..16 % at M >= 256.

Plan: perf1101 P1 (B1 prerequisite of the large-M a16w16 dispatch)

Co-Authored-By: Claude <[email protected]>
…), retuned 4096/8192, TP2 shape files

gpt-oss's QKV (N5120 K2880), O (N2880 K4096) and router (N128 K2880) files stopped at
M_LEQ_8192 and the loader searched only the standard bounds, so every prefill batch
above 8192 tokens (chunk 16384: 94 % of 70k/300 prefill batches, 12 % at 8k/1k c64
with mixed chunk) ran the 'any' entry, bandwidth_bound 128x128x64. The TP2 shapes
(QKV N2560 K2880, O N2880 K2048) had no file at all and ran DEFAULT.json at every M.

- QKV and O: M_BOUNDS up to 32768; M_LEQ_4096/8192/16384/32768 = compute_bound
  256x256x64, 4 buffers, 8 warps, waves_per_eu 1, coalesced register store
  (REGISTER_STORE 2: no new LDS-staged TDM store epilogue). Best of 126 candidates
  at M 16384 (BLOCK_K dividing K), and faster than the old 4096/8192 entries.
- Router: M_BOUNDS to 32768; M_LEQ_8192/16384/32768 = compute_bound 128x128x64,
  4 buffers, 4 warps, register store.
- TP2 QKV and O: new files with DEFAULT_FALLBACK (DEFAULT.json keeps M <= 128):
  M_LEQ_256..1024 = compute_bound 128x128x64, 2048..32768 = 256x256x64, register store.

Kernel time, old file -> new (us, bf16 + bias, one gfx1250 DPX partition, A-B-A):
  QKV  M 7500 340 -> 302, 8192 365 -> 307, 16384 3278 -> 618, 32768 6567 -> 1230
  O    M 7500 288 -> 246, 8192 293 -> 249, 16384 2643 -> 503, 32768 5252 -> 1020
  router M 8192 26.7 -> 18.9, 16384 101.5 -> 26.9
  TP2 QKV M 1024 51.5 -> 26.4, 7500 843 -> 167, 16384 1684 -> 308
  TP2 O   M 1024 43.9 -> 21.0, 7500 719 -> 132, 16384 1453 -> 267
Other buckets unchanged. fp32-reference max rel err 0.003 (same as before); CUDA-graph
replay bitwise equal over 6000 calls per shape at M 8192/9000/16384/16385.

Plan: perf1101 P1 (large-M a16w16 dispatch; router separately; TP2 files added)

Co-Authored-By: Claude <[email protected]>
…e, validate the store mode

Review follow-up (perf1101 P1, codex round 1, findings 3-4): REGISTER_STORE outside
{0, 1, 2} is rejected (ValueError on the host, static_assert in the kernel) instead of
falling to the TDM store; the two register-store modes share one store helper; the
store layout helper drops its unused BLOCK_M; the comment states the override's scope
(non-persistent gluon compute_bound launches; unset in serving).
Same kernels, same outputs: P1's correctness check passes unchanged (55 shape/M
cases, old vs new bitwise equal, 2,000 replayed calls each); mode-2 store cost at the
shipped 256x256 tile 1.012-1.014 of the TDM store.

Plan: perf1101 P1 (review round 1)

Co-Authored-By: Claude <[email protected]>
… 2049-3072, TP2 129-1536, 2049-3072)

Review follow-up (perf1101 P1, codex round 1, finding 2): a dense A-B-A over every
changed band showed four band starts slower than the old schedule (O M 2049 +16 %,
TP2 QKV M 1025 +9 %, TP2 O M 2049 +5 %, M 257 +3 %): 256x256 tiles just past a
bound leave most of a tile empty. Per-band sweep of eight register-store tiles:
  O (TP1): new bound 3072, M_LEQ_3072 = 128x128x64 (2049-3072: 0.91-0.95 of old).
  TP2 QKV: new bound 1536; M_LEQ_256 = 128x64x64, M_LEQ_512 = 128x128x128,
           M_LEQ_1024/1536 = 128x128x64, M_LEQ_2048 = 256x256x64.
  TP2 O:   new bound 3072; M_LEQ_256 = 128x64x64, M_LEQ_512 = 128x128x128,
           M_LEQ_1024 = 128x128x64, M_LEQ_2048 = 256x256x64, M_LEQ_3072 = 128x128x64.
All compute_bound, 4 buffers, 4 warps (256x256: 8 warps), coalesced register store.
Dense A-B-A (TP1 20 M from 2048 to 32768, TP2 28 M from 128 to 32768): new/old
0.17-1.01 everywhere, no point above 1.02. Old vs new outputs bitwise equal at every
band boundary (65 cases, same K order); 2,000 replayed calls each, 0 mismatches.

Plan: perf1101 P1 (review round 1)

Co-Authored-By: Claude <[email protected]>
@akao-amd
akao-amd requested a review from a team November 2, 2026 03:04
@github-actions github-actions Bot changed the title [Triton/Gluon] [Config] [gfx1250] gemm_a16w16: GPT-OSS decode buckets retuned with rotating weights; LM-head files [Triton/Gluon] [gfx1250] gemm_a16w16: GPT-OSS decode buckets retuned with rotating weights; LM-head files Nov 2, 2026
@github-actions

github-actions Bot commented Nov 2, 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 7289 --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

WAITING ON AUTHOR

PR Self-Review

Revision 8eac26e285ec · 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 — Reviewed revision must contain at least the first 7 characters of the current head SHA

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

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.

🟡 Changes recommended

The seven updated tuning tables are bypassed on the target’s 96-CU configuration path, and the new store modes lack direct regression tests for overrides and LM-head shapes.

2 open issues
What changed in this PR

Retunes gfx1250 Gluon gemm_a16w16 for GPT-OSS decode using rotating weights to model cold-weight serving. The diff also includes the register-store support and prefill configurations from parent PR #7288.

Changes:

  • Retunes TP1 QKV and O-projection buckets for M ≤ 128.
  • Adds TP1 and TP2 LM-head decode tables with default fallback for larger M.
  • Includes configurable register-store epilogues and the parent PR’s large-M and TP2 projection tables.
File Description
aiter/​ops/​triton/​gemm/​basic/​gemm_a16w16.py Reads and validates store modes, then passes store layouts to the kernel.
aiter/​ops/​triton/​configs/​gfx1250/​gluon/​gemm/​gemm_a16w16/​GEMM-A16W16-N=5120-K=2880.json Retunes TP1 QKV decode and includes parent prefill buckets.
aiter/​ops/​triton/​configs/​gfx1250/​gluon/​gemm/​gemm_a16w16/​GEMM-A16W16-N=2880-K=4096.json Retunes TP1 O decode and includes parent prefill buckets.
aiter/​ops/​triton/​configs/​gfx1250/​gluon/​gemm/​gemm_a16w16/​GEMM-A16W16-N=2880-K=2048.json Adds parent TP2 O prefill settings with default fallback.
aiter/​ops/​triton/​configs/​gfx1250/​gluon/​gemm/​gemm_a16w16/​GEMM-A16W16-N=2560-K=2880.json Adds parent TP2 QKV prefill settings with default fallback.
aiter/​ops/​triton/​configs/​gfx1250/​gluon/​gemm/​gemm_a16w16/​GEMM-A16W16-N=201088-K=2880.json Adds TP1 LM-head decode settings.
aiter/​ops/​triton/​configs/​gfx1250/​gluon/​gemm/​gemm_a16w16/​GEMM-A16W16-N=128-K=2880.json Includes parent router prefill buckets through M = 32768.
aiter/​ops/​triton/​configs/​gfx1250/​gluon/​gemm/​gemm_a16w16/​GEMM-A16W16-N=100544-K=2880.json Adds TP2 LM-head decode settings.
aiter/​ops/​triton/​_gluon_kernels/​gfx1250/​gemm/​basic/​gemm_a16w16.py Adds register-store layouts and epilogues while retaining the default TDM store.

Review effort: Balanced

@zufayu
zufayu requested review from a team and azaidy November 3, 2026 01:17
…96-CU tree (pure git mv)

They were tuned on a 96-CU DPX partition, and since ROCm#6573 a 96-CU device reads
configs/gfx1250/96cu/gluon/gemm/gemm_a16w16/ whole: in the plain tree no DPX
device ever loaded them (configs/AGENTS.md, CU trees).
…n the 96-CU tree

The retuned QKV (N 5120, K 2880), O (N 2880, K 4096) and router (N 128, K 2880)
tables were measured on a 96-CU DPX partition, which reads only the 96cu tree,
so on main they were never used there (Copilot, ROCm#7288). The 96cu files hold
these tables whole (buckets this PR did not retune keep ROCm#6921's values); the
plain-tree files go back to main's, so devices that read the plain tree see no
change from this PR.
The tuner's keys are the union of the family DEFAULT.json's keys, and
write_best_configs.py writes only those keys into a bucket. Neither gluon
DEFAULT.json (plain or 96cu) had REGISTER_STORE, so the tuner never searched it
and a retuned bucket silently lost it, going back to the LDS + TDM-store
epilogue (Copilot, ROCm#7288). Every DEFAULT bucket now says REGISTER_STORE 0 (what
it already meant; bandwidth_bound pops and ignores it) and SEARCH_SPACE offers
0, 1, 2.
…the public wrapper

Modes 0/1/2 on fp16 and bf16, bias on and off, at the gpt-oss bucket edges
(1025, 2049, 3073) and with partial M and N tiles (M 1, 97, 300; N 200); the
AITER_GFX1250_A16W16_STORE override for each mode; an invalid override (3) and
an invalid entry value (5) raise ValueError (Copilot, ROCm#7288).  73 passed on
gfx1250 (MI450 DPX partition, 96 CU).
…6-CU lookup

A 96-CU lookup of the QKV, O, router and TP2 shapes at M 4096-32768 must land on
tuned compute_bound entries (on the PR as filed it landed on the 96cu
DEFAULT's untuned bandwidth_bound rows), and every gpt-oss shape
must compute the right result at M 1, 64, 1000, 2049, 3073 and 8192 through the
tuned lookup.
@akao-amd

akao-amd commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

Updated with #7288's fixes (96-CU tree, tuner, black, tests) and this PR's LM-head files moved into the 96-CU tree. Still stacked on #7288; merge #7288 first. Could someone add ci:gfx1250-ffm-triton?

@akao-amd

akao-amd commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

@ROCm/team_aiter @ROCm/triton_kernels_team Please take a look. This is stacked on #7288. The register-store and prefill commits are the parent; the decode buckets and LM-head files are the top.

Same CI picture on head 14f917c. Triton shard 5 fails in test_gemm_a16w16_gfx1250_gptoss_96cu_lookup because the test runs on the gfx950 runner and looks up a gfx950 Gluon default that is not in the tree: https://github.com/ROCm/aiter/actions/runs/41585690185. Aiter Test shard 4 hit the 90-minute limit in test_flydsl_conv_implicit.py: https://github.com/ROCm/aiter/actions/runs/41585690156. The lookup gate is being followed up on #7288.

@akao-amd

akao-amd commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

@azaidy Tagging you as a Gluon owner for the gfx1250 gemm_a16w16 decode and LM-head changes in this PR. It is stacked on #7288, so the register-store and prefill parts are reviewed there.

The lookup test passed cu_num=96 and left the arch as the runner's, so MI35X asked for a gfx950 Gluon default that is not in the tree.
… stacked on the REGISTER_STORE PR

Rebuilt on top of pr-gfx1250-gemm-a16w16-large-m-regstore so the shared commits are not duplicated.
Only the gpt-oss decode buckets, the LM-head shape files and the 96-CU lookup test differ from that branch.
@akao-amd
akao-amd force-pushed the pr-gfx1250-gemm-a16w16-gptoss-decode branch from ddb8f47 to e2264bb Compare November 5, 2026 21:24

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

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.

4 participants