Repository navigation
Conversation
…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]>
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: |
NOT READY FOR HUMAN REVIEWPR Self-ReviewRevision Author self-review accepted. Readiness report: Author answers
Show the author's self-review answersBehavior and intentValidation and unverified scopePR-specific questionChanged op testsPR state
Copilot findings
Code and op-test hygiene
Required CI
Shadow mode reports what would block but keeps the status successful. Set |
There was a problem hiding this comment.
🟡 Changes recommended
The new tuning buckets are outside the tree selected on 96-CU devices, while missing REGISTER_STORE schema and search entries prevent mode tuning and cause installed buckets to revert to mode 0.
3 open issues
What changed in this PR
This PR adds selectable register-store epilogues to gfx1250 Gluon gemm_a16w16 and tunes GPT-OSS prefill configurations. It complements the separate decode retuning in #7289.
Changes:
- Adds two register-store modes, host validation and an environment override while preserving mode 0 as the default.
- Extends TP1 QKV, output-projection and router buckets through M=32768.
- Adds TP2 QKV and output-projection configs with default fallback for uncovered buckets.
| File | Description |
|---|---|
aiter/ops/triton/gemm/basic/gemm_a16w16.py |
Selects and validates store modes for non-persistent compute-bound launches. |
aiter/ops/triton/configs/gfx1250/gluon/gemm/gemm_a16w16/GEMM-A16W16-N=5120-K=2880.json |
Retunes TP1 QKV prefill and extends large-M coverage. |
aiter/ops/triton/configs/gfx1250/gluon/gemm/gemm_a16w16/GEMM-A16W16-N=2880-K=4096.json |
Retunes TP1 output projection and adds intermediate and large-M buckets. |
aiter/ops/triton/configs/gfx1250/gluon/gemm/gemm_a16w16/GEMM-A16W16-N=2880-K=2048.json |
Adds TP2 output-projection prefill configs. |
aiter/ops/triton/configs/gfx1250/gluon/gemm/gemm_a16w16/GEMM-A16W16-N=2560-K=2880.json |
Adds TP2 QKV prefill configs. |
aiter/ops/triton/configs/gfx1250/gluon/gemm/gemm_a16w16/GEMM-A16W16-N=128-K=2880.json |
Selects register stores for larger router batches. |
aiter/ops/triton/_gluon_kernels/gfx1250/gemm/basic/gemm_a16w16.py |
Implements masked register stores and optional coalesced output layout. |
Review effort: Balanced
…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.
|
Updated: the gpt-oss tables now live in the 96-CU tree they were tuned on (see the thread above: as filed they were never read on a DPX partition), the tuner keeps |
|
@ROCm/team_aiter @ROCm/triton_kernels_team Please take a look when you can. This is the base of #7289. Two CI notes from the current head (
I am following up on a gfx1250 gate for that lookup test. The shard-4 timeout is the cap, in a test this diff does not touch. |
|
@azaidy Tagging you as a Gluon owner for the gfx1250 gemm_a16w16 changes in this PR, alongside the team reviewers above. |
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.
| # Register store, coalesced: convert the tile to STORE_LAYOUT (16-byte vectors along N; the layout | ||
| # conversion's LDS round trip is ordinary ds_store/barrier/ds_load), then buffer stores. The TDM store of an | ||
| # LDS-staged tile (REGISTER_STORE == 0) is the gfx1250 B1 pattern: tensor_store_from_lds can read LDS before | ||
| # the waves' ds_stores are visible to it, and no documented wait or fence closes that window. |
There was a problem hiding this comment.
Do you have any insight why this performs better compared to =0? This looks plain worse because the ds_stores should be the same but then we have (X * ds_loads + X * buffer_stores) vs just having one TDM store instruction?
There was a problem hiding this comment.
We didn't claim mode 2 is faster. On the shipped 256×256 tile, mode 2 is about 1.3% slower than mode 0 (1.012–1.014× time, hot weights, QKV and O at M 8192 and 16384). Mode 1 is about 1.11–1.18×. The ablation line in the PR text was written badly: on the old small-M tiles, mode 2 measured faster for some shapes (the −24% / −12% figures). We're not relying on that. The end-to-end gain is the new buckets, not the store mode.
…with rotating weights; LM-head files (#7289) * gfx1250 gluon gemm_a16w16 compute_bound: register-store epilogues, chosen 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) * gfx1250 gluon gemm_a16w16: gpt-oss large-M buckets (M_BOUNDS to 32768), 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) * gfx1250 gluon gemm_a16w16 compute_bound: share the register-store code, 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) * gfx1250 gluon gemm_a16w16: gpt-oss band starts without regressions (O 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) * gfx1250 gluon gemm_a16w16: move the TP2 gpt-oss shape files into the 96-CU tree (pure git mv) They were tuned on a 96-CU DPX partition, and since #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). * gfx1250 gluon gemm_a16w16: the gpt-oss QKV, O and router entries go in 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, #7288). The 96cu files hold these tables whole (buckets this PR did not retune keep #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. * gfx1250 gluon gemm_a16w16: let the tuner search and keep REGISTER_STORE 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, #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. * gfx1250 gluon gemm_a16w16: black * gfx1250 gluon gemm_a16w16: test the REGISTER_STORE epilogues through 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, #7288). 73 passed on gfx1250 (MI450 DPX partition, 96 CU). * gfx1250 gluon gemm_a16w16: test the tuned gpt-oss entries and their 96-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. * gfx1250 gluon gemm_a16w16: read the 96-CU gpt-oss tables as gfx1250 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. * gfx1250 gluon gemm_a16w16: gpt-oss decode buckets and LM-head tuning, 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. * gfx1250 gluon gemm_a16w16: drop the hardware-bug notes from the store comments


Summary
Two changes for the gfx1250 Gluon
gemm_a16w16as GPT-OSS-120B prefill uses it (QKV N5120 K2880, O N2880 K4096, router N128 K2880; TP2: QKV N2560 K2880, O N2880 K2048):REGISTER_STOREon the compute_bound kernel. A config entry picks the epilogue:0= today's LDS-stagedtensor_store_from_lds(default; an entry without the key is unchanged),1= buffer stores straight from the WMMA layout,2=convert_layoutto 16-byte vectors along N, then buffer stores. A value outside{0, 1, 2}is rejected on the host (ValueError) and in the kernel (static_assert).AITER_GFX1250_A16W16_STOREoverrides every non-persistent compute_bound launch; it is unset in serving.M_BOUNDSextends to 32768 on the three TP1 files, with compute_bound entries atREGISTER_STORE2 for the bands that were falling through toanyor to DEFAULT. Band-start entries use a smaller tile where 256×256 left most of a tile empty. Two new TP2 files (DEFAULT_FALLBACK) cover shapes that had no file.Decode buckets (M ≤ 128 on TP1 QKV/O, and the LM head) are #7289, stacked on this branch.
Motivation
Prefill chunks of 16,384 tokens sit above the files' last bucket (8192). The loader then takes
any. On the AITER pin SGLang ships for gfx1250 (26f4f1fb2) that entry is bandwidth_bound 128×128×64: in a gpt-oss-120b trace, QKV is 3,274 µs and O is 2,631 µs per layer per 16k chunk, 0.15 PFLOP/s against 0.64 at 7.5k tokens. CountingPrefill batchlines in a base1028 TP1 server log, M > 8192 is 94% of prefill batches at 70k/300 c4 and 11.9% of batches (20.2% of tokens) at 8k/1k c64 with mixed chunk. #6921 (merged 10-28) already movedanyon main to compute_bound 256×128×64. This PR adds explicit buckets through 32768 that are faster than thatany, and the TP2 files. TP2 had no shape file, so every M ranDEFAULT.json's bandwidth_bound tiles (about 5× slower at M ≥ 6000).The new entries store from registers. On gfx1250 an LDS-staged
tensor_store_from_ldscan ship stale LDS (the same epilogue as #7202 / #7203). That race was not observed on this GEMM. The new entries still use the coalesced register store so they do not add another LDS → TDM store. At the shipped 256×256 tile, mode 2 is about 1.3% slower than mode 0 (time ratio 1.012–1.014, QKV and O, M 8192 and 16384, hot weights). Mode 1 is about 11–18% slower there (1.11–1.18×). An ablation on the existing small-M tiles, which this PR does not retune, measured mode 2 faster on some of those old entries: 24% faster for O at M 64 and 12% faster for QKV at M 16, and 0–5% slower for M 256–8192. This PR does not rely on that ablation.Config keys
Lookup is the shape file
GEMM-A16W16-N={N}-K={K}.json, then the firstM_LEQ_*whose bound is ≥ M. M above every bound usesany. A missing file usesDEFAULT.json.DEFAULT_FALLBACK: trueuses the file's own key when it has one and DEFAULT otherwise.Every new or retuned entry below is compute_bound, 4 buffers,
REGISTER_STORE2, BLOCK_K 64 except the one partial-K tile noted.N=5120,K=2880(TP1 QKV)M_LEQ_4096,M_LEQ_8192,M_LEQ_16384,M_LEQ_32768N=2880,K=4096(TP1 O)M_LEQ_3072M_LEQ_4096,M_LEQ_8192,M_LEQ_16384,M_LEQ_32768N=128,K=2880(router)M_LEQ_8192,M_LEQ_16384,M_LEQ_32768N=2560,K=2880(TP2 QKV, new,DEFAULT_FALLBACK)M_LEQ_256M_LEQ_512M_LEQ_1024,M_LEQ_1536M_LEQ_2048throughM_LEQ_32768N=2880,K=2048(TP2 O, new,DEFAULT_FALLBACK)M_LEQ_256/M_LEQ_512/M_LEQ_1024M_LEQ_2048M_LEQ_3072M_LEQ_4096throughM_LEQ_32768Keys left byte-for-byte on the previous entry:
M_LEQ_1throughM_LEQ_2048, andany(main's [Triton/Gluon] [Config] Use the M_LEQ_8192 config as "any" in the tuned gfx1250 Gluon GEMM files #6921 compute_bound 256×128×64, still the LDS-staged TDM store, used for M > 32768).M_LEQ_1throughM_LEQ_4096, andany.DEFAULT_FALLBACKkeepsDEFAULT.json.N,Kfile is untouched, so those shapes keep the selection they have on main.M_BOUNDSgained 1536 (TP2 QKV), 3072 (both O files), 16384 and 32768. A 256×256 tile placed on the first M past 2048 was slower than the old schedule (O M 2049 +16%, TP2 QKV M 1025 +9%, TP2 O M 2049 +5% and M 257 +3%). The smaller tiles in the table are the per-band picks that removed those regressions.Performance (gfx1250, MI45x DPX partition, 96 CUs)
Kernel times are hot weights (one weight tensor, CUDA graph of 5 calls replayed 10×, median). Prefill at these M is compute-bound. End-to-end numbers are the controlled serving bracket below.
Kernel, M 16,384 (µs per call): the pin's
any/ main'sany(#6921) / this PRanyany(#6921)Dense file A-B-A over the changed bands (B / average of the two A arms; no changed point above 1.011): M 7,500 QKV 340 → 302 µs (0.887), O 288 → 246 (0.853); M 16,384 QKV 0.189, O 0.191, router 0.269 of the old file. TP2 at M 7,500: QKV 843 → 167 (0.202), O 719 → 132 (0.187). Unchanged buckets stay near 1.00 (router M ≤ 4096 up to 1.011, TP2 M 128 at 1.003 / 1.009). Router M 4097, the first changed router bucket, measured 1.009 and was kept.
End to end (gpt-oss-120b W4A8, SGLang, InferenceX fixed-seq run 1, adjacent A-B-A, box otherwise idle). A = recipe AITER
9d55e4f1b(the gfx1250 pin lineage), B = A plus these four commits. Output tok/s, B / average(A, A2):Mean TTFT at 70k c4: TP1 3,884 → 2,936 ms, TP2 2,566 → 1,856 ms. GSM8K strict (1319, thinking, after load): TP1 0.9598 / 0.9598 / 0.9591 (A/B/A), TP2 0.9606 / 0.9560 / 0.9629.
Test
Hardware: one gfx1250 DPX/NPS2 partition, 96 CUs, image
rocm/sgl-dev:v0.5.23-rocm101-mi45x-20261031, ROCm 10.1.0, Tritonb509148826(carries thes_wait_dscnt-before-barrier fix, llvm-project#220357).AITER_GFX1250_A16W16_STOREunset. bf16 out, row-major x/w, SGLang's TN layout. Bias on, plus a no-bias run for TP2 O (rank 1 passes no bias).check_p1_correctness.py: 65 cases, both sides of every changed bound (2048/2049, 3072/3073, 4096/4097, 8192/8193, 16384/16385, 32768, plus 8193/9000/16500 and the TP2 bounds 128/129, 256/257, 512/513, 1024/1025, 1536/1537). Reference is fp32x·wᵀ + b. Pass rule, stated before the run: y_new finite, max|y_new−ref| ≤ 2·max|y_old−ref| + 1e-6·max|ref|, and max|y_new−y_old| ≤ 2⁻⁶·max|ref|. 65/65 pass, y_new == y_old bitwise. The same entry withREGISTER_STORE0 matches mode 2 bitwise (60/60 mode-2 cases). CUDA graph of 20 calls × 100 replays: 0 mismatches in 2,000 calls per case.check_p1_correctness.py --no-bias --shapes=o_tp2: 17 cases. Bitwise equal to the old schedule, mode 0 matches mode 2, 0 mismatches in 2,000 replays each. O's N 2880 with BLOCK_N 256 leaves a 64-column tail; that tail is in every O case.scan_barrier_dscnt.pyviab4_scan_named.py) on the compiled binaries: 0 flagged for the shipped tiles (36 in the final check cache, including the no-bias TP2 O tiles), for the microbench caches, and for the arm-B server caches (105 TP1, 96 TP2).REGISTER_STORE_2256×256 and 128×128 tiles; DEFAULT.json has no mode-2 entry, so those launches came from the new files.The four commits were validated on that recipe tree and applied onto main (
0dd271600, 3-way, clean). main'sanyfrom #6921 is what M > 32768 still runs. Not run: AITER's op tests on gfx1250, shapes other than these five, the persistent kernel.MI355X (gfx950), 2026-11-05, image
rocm/sgl-dev:v0.5.23-rocm10-mi35x-20261102, ROCm 10.0.0. Wholeop_tests/triton_tests/gemm/basic/test_gemm_a16w16.pyat this head (b91728f64c2a): 377 passed, 0 failed, 752 skipped. The 5test_gemm_a16w16_gfx1250_gptoss_96cu_lookupcases pass and are not skipped. At the previous head13d9dcc310b8those 5 fail:configs/gfx950/gluon/gemm/gemm_a16w16/DEFAULT.jsondoes not exist. mainc1096fa40a90on the same box: 372 passed, 0 failed (that test is not on main).PR Self-Review
Reviewed revision
b91728f64c2acbef537acc68ca5d8876c16d6cfbBehavior and intent
gfx1250 Gluon
gemm_a16w16compute_bound can store its output from registers, chosen per config entry byREGISTER_STORE. Existing entries omit the key and keep the LDS-staged TDM store, includingany.The GPT-OSS prefill shapes get buckets through M 32768, and TP2 gets shape files. Without them, M > 8192 on TP1 falls through to
any, and every TP2 M falls through toDEFAULT.json. Those paths are several times slower at a 16k chunk than the entries in the table above. The new entries use mode 2 so those buckets do not add an LDS-staged TDM store. The same-tile measurement above does not show mode 2 faster than mode 0.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, Tritonb509148826,AITER_GFX1250_A16W16_STOREunset.check_p1_correctness.py(65 cases, with bias) and the same script--no-bias --shapes=o_tp2(17 cases). Old schedule read from the parent tree withgit show. All cases bitwise equal to the old schedule under the tolerance above; 0 graph-replay mismatches in 2,000 calls per case; mode 2 bitwise-equal to mode 0 on the same tile.run_bench.sh/file_aba.sh, hot weights. Dense A-B-A from M 2048 to 32768 (TP1) and M 128 to 32768 (TP2): new/old 0.17–1.011. Kernel M 16384: QKV 617 µs, O 502 µs, router 26 µs, against main'sanyat 722 / 595 µs for QKV / O.Not run on a checkout of AITER main itself (the same four commits apply cleanly onto
0dd271600). Not run: AITER op tests on gfx1250, other models'(N, K), the persistent kernel. M > 32768 still usesany's TDM store.PR-specific question
The keys that consume the new selection are listed in the table under Config keys. Evidence that everything else keeps its previous selection:
(N, K)filename and then onM_LEQ_*/any. No other shape file is in the diff.M_LEQ_1…M_LEQ_2048(QKV and O),M_LEQ_1…M_LEQ_4096(router), andanyare unchanged. Dense A-B-A at those bounds stays near 1.00, up to 1.011 on unchanged router buckets (M 3072–4096).DEFAULT_FALLBACKand their first key isM_LEQ_256, so M ≤ 128 stays onDEFAULT.json. A-B-A at TP2 M 128 is 1.003 (QKV) and 1.009 (O).REGISTER_STOREis read only for a compute_bound entry that sets it, or whenAITER_GFX1250_A16W16_STOREis set. That variable was unset for every measurement and in the serving bracket. Entries without the key still compile the mode-0 epilogue.Changed op tests
op_tests/triton_tests/gemm/basic/test_gemm_a16w16.pytest_gemm_a16w16_gfx1250_register_storeandtest_gemm_a16w16_gfx1250_store_env_overridelaunch the Gluon kernel for store modes 0, 1 and 2, and reject an invalid mode. They skip unless Gluon is supported on the device.test_gemm_a16w16_gfx1250_gptoss_96cu_lookuponly reads JSON. It pinsget_arch()to gfx1250 and passescu_num=96, so an MI35X runner checksconfigs/gfx1250/96cuinstead of a gfx950 Gluon default that is not in the tree. For the five gpt-oss(N, K)shapes at M 4096, 8192, 16384 and 32768 it requires a tunedcompute_boundentry. The loader cache is cleared because its key does not include the arch. On an MI355X (gfx950) those 5 cases pass at this head and fail at13d9dcc310b8.test_gemm_a16w16_gfx1250_gptoss_tunedchecks those shapes numerically and skips off a Gluon arch.🤖 Generated with Claude Code