Repository navigation
[Triton/Gluon] [Config] gemm_a8w8, gemm_a16w16: retune five gfx1101 entries for Triton 3.9 - #8216
Conversation
The gfx1101 entries from ROCm#5960 and ROCm#5961 were tuned with Triton 3.8 and run slower with Triton 3.9. Five entries retuned with Triton 3.9 pass a check on shapes the search did not use (10 fresh processes, decision rule written before the run): - gemm_a8w8/DEFAULT.json: M_LEQ_512, any - gemm_a16w16 N=12288-K=3072: M_LEQ_4096 - gemm_a16w16 N=21504-K=3072: M_LEQ_8192 - gemm_a16w16 N=3072-K=12288: M_LEQ_4096 No other entry, file, kernel or loader changes. Signed-off-by: Martin Domanský <[email protected]>
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: Reviews: |
There was a problem hiding this comment.
🔵 Needs a closer look
Maintainer judgment is needed because gfx1101 correctness and timing lack head-matched validation, while disclosed Triton 3.8 and NUM_XCDS=8 slowdowns complicate the unconditional config replacements.
No open issues 🎉
What changed in this PR
This PR retunes five gfx1101 Triton GEMM configuration entries for Triton 3.9. It changes tuning values only; kernels, loaders, public APIs, and other architectures remain unchanged.
Changes:
- Adjusts tile sizes and launch settings for two
gemm_a8w8default buckets. - Updates three shape-specific
gemm_a16w16buckets. - Preserves bucket boundaries, fallback behavior, and all other entries.
| File | Description |
|---|---|
aiter/ops/triton/configs/gfx1101/triton/gemm/gemm_a8w8/DEFAULT.json |
Retunes M_LEQ_512 and any tiles and launch settings. |
aiter/ops/triton/configs/gfx1101/triton/gemm/gemm_a16w16/GEMM-A16W16-N=3072-K=12288.json |
Retunes M_LEQ_4096 with a narrower tile and fewer warps. |
aiter/ops/triton/configs/gfx1101/triton/gemm/gemm_a16w16/GEMM-A16W16-N=21504-K=3072.json |
Retunes M_LEQ_8192, including grouping and cache settings. |
aiter/ops/triton/configs/gfx1101/triton/gemm/gemm_a16w16/GEMM-A16W16-N=12288-K=3072.json |
Retunes M_LEQ_4096, including grouping and cache settings. |
Review effort: Balanced
WAITING ON AUTHORPR Self-ReviewRevision 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
Edit the Missing or invalid answers
Shadow mode reports what would block but keeps the status successful. Set |
Summary
Five entries of the gfx1101 Triton configs of
gemm_a8w8andgemm_a16w16get new values tuned with Triton 3.9. No other entry, file, kernel or loader changes.Motivation
The gfx1101 tables added in #5960 and #5961 were tuned with Triton 3.8. With Triton 3.9 every measured tuned entry of both tables runs slower than with Triton 3.8 on the same shapes (TheRock torch wheel
2.16.0a0+rocm10.3.0a20261101): the ratio of Triton 3.8 time to Triton 3.9 time is 0.926–0.966 forgemm_a8w8and 0.833–0.973 forgemm_a16w16(5 alternating process pairs). Retuned on Triton 3.9, five entries beat the current ones on shapes the search did not use; the other entries stay as they are.On Triton 3.9 the current
gemm_a16w16tiles 128×256×64 (8 warps) and 128×128×64 (4 warps) spill 54 and 56 VGPRs, and neither spills on Triton 3.8 (AMDGPU kernel metadata). That the spills cause the slowdown is inferred, not measured.Changes
aiter/ops/triton/configs/gfx1101/triton/gemm/gemm_a8w8/DEFAULT.json:M_LEQ_512andany.aiter/ops/triton/configs/gfx1101/triton/gemm/gemm_a16w16/GEMM-A16W16-N=12288-K=3072.json:M_LEQ_4096.aiter/ops/triton/configs/gfx1101/triton/gemm/gemm_a16w16/GEMM-A16W16-N=21504-K=3072.json:M_LEQ_8192.aiter/ops/triton/configs/gfx1101/triton/gemm/gemm_a16w16/GEMM-A16W16-N=3072-K=12288.json:M_LEQ_4096.Keys, key order,
DEFAULT_FALLBACKand the"any"entries of the per-shape files are unchanged. Thegemm_a8w8entriesM_LEQ_64,M_LEQ_128andM_LEQ_1024,gemm_a16w16/DEFAULT.jsonand the files for N=3072, K=15360 and N=9216, K=3072 are unchanged, because the retuned values did not pass the selection or the check below. The gfx1101 plain folder keeps the device it was tuned on, so no<cu_num>cu/tree is added.Performance (if applicable)
gfx1101, Windows 11, TheRock torch wheel
2.16.0a0+rocm10.3.0a20261117(HIP 7.18.26456), triton-windows 3.9.0.post30,AITER_TRITON_ONLY=1,NUM_XCDS1, AITER at the head of this PR (mainat26b4dc1fplus this change). Before is the current entry onmain, After the entry of this PR. Before and After are the geometric mean over the shapes of each shape's median time; the ratio column is the decision statistic described below.gemm_a8w8M_LEQ_512gemm_a8w8anygemm_a16w16N=12288, K=3072, M_LEQ_4096gemm_a16w16N=21504, K=3072, M_LEQ_8192gemm_a16w16N=3072, K=12288, M_LEQ_4096These numbers come from repetitions after the tuning search, on shapes drawn with a seed the search did not use. The protocol is in the details below. The same check on AITER
8e69f10c, before #7591 changed the GEMM kernels, with torch wheel2.16.0a0+rocm10.3.0a20261106, gave medians within 0.013 of these.Protocol, other Triton versions and per-shape times
gemm_a8w88 random shapes per entry with M inside the entry's range and random N and K;gemm_a16w162 random M per file inside the entry's range, at the file's N and K. Seed 20261108, not used by the search.gemm_a8w8) or 10 (gemm_a16w16) consecutive calls. No sample fell below the timing floor.gemm_a8w8only, measured on AITER8e69f10cwith torch wheel2.16.0a0+rocm10.3.0a20261106(256 MiB read before each call, 1 call per window, 10 fresh processes, shapes above the timing floor):M_LEQ_5121.428 (1.418–1.464),any1.118 (1.086–1.250). The retunedM_LEQ_64entry, which passed with a hot cache (1.045), measured 0.747 (0.705–0.802) here and is therefore not part of this PR. Thegemm_a16w16shapes exceed 110 MiB of working data, larger than the last-level cache.The same entries with the XCD count AITER uses when
chip_inforeports none (8), and with Triton 3.8 (triton-windows 3.8.0.post29, torch wheel2.16.0a0+rocm10.3.0a20261101). All three columns of this table were measured on AITER8e69f10cwith the tables ofmain, before #7591; the Triton 3.9 columns used torch wheel2.16.0a0+rocm10.3.0a20261106. They were not repeated on26b4dc1f. NO-CLAIM means the decision rule did not pass. This PR targets Triton 3.9; on Triton 3.8 the currentgemm_a8w8anyandN=3072, K=12288entries are not slower than the new ones.NUM_XCDS1NUM_XCDS8NUM_XCDS1gemm_a8w8M_LEQ_512gemm_a8w8anygemm_a16w16N=12288, K=3072, M_LEQ_4096gemm_a16w16N=21504, K=3072, M_LEQ_8192gemm_a16w16N=3072, K=12288, M_LEQ_4096Per shape, median over the 10 processes, Triton 3.9,
NUM_XCDS1, same run as the Performance table. The geometric mean hides losses on single shapes: the newgemm_a8w8M_LEQ_512entry is slower on two of eight shapes, by 10.6 % on M=503, N=5568, K=14080, and the newanyentry on three of eight shapes, by up to 10.2 %.gemm_a8w8M_LEQ_512gemm_a8w8M_LEQ_512gemm_a8w8M_LEQ_512gemm_a8w8M_LEQ_512gemm_a8w8M_LEQ_512gemm_a8w8M_LEQ_512gemm_a8w8M_LEQ_512gemm_a8w8M_LEQ_512gemm_a8w8anygemm_a8w8anygemm_a8w8anygemm_a8w8anygemm_a8w8anygemm_a8w8anygemm_a8w8anygemm_a8w8anygemm_a16w16N=12288, K=3072, M_LEQ_4096gemm_a16w16N=12288, K=3072, M_LEQ_4096gemm_a16w16N=21504, K=3072, M_LEQ_8192gemm_a16w16N=21504, K=3072, M_LEQ_8192gemm_a16w16N=3072, K=12288, M_LEQ_4096gemm_a16w16N=3072, K=12288, M_LEQ_4096The search and the selection ran with
NUM_XCDS8; the claim above rests only on the repetitions withNUM_XCDS1. On Triton 3.9 the newgemm_a16w16entries for N=12288, K=3072 and N=21504, K=3072 (128×128×64, 4 warps) spill 56 VGPRs on Triton 3.9; the current entries they replace (128×256×64, 8 warps) spill 54; the new entry for N=3072, K=12288 (128×64×64, 4 warps) does not spill. The search did not penalize spills.Testing
The measurement harness is not part of this repository. The shapes and the per-process results can be provided.
The config loader on this branch,
_get_configof_triton_kernels/gemm/basic/gemm_a8w8.pyandgemm_a16w16.py, was called for 170 (M, N, K) points: M from 1 to 16384 across every bucket boundary, the five per-shape (N, K) pairs ofgemm_a16w16, and N, K pairs that have no per-shape file. Againstmain, 52 points get a different config, and every one of them falls in one of the five changed entries; the other 118 get the same config as onmain. No kernel was launched for this check.Documentation
Config values only; no interface or documented behavior changes.
Dependencies
Breaking Changes
None. Only gfx1101 shapes served by the five entries get a different tile.
PR Self-Review
Reviewed revision
6ff4047
Behavior and intent
On gfx1101 with Triton 3.9,
gemm_a8w8with 128 < M ≤ 512 or M > 1024, andgemm_a16w16at N=12288, K=3072 (1024 < M ≤ 4096), N=21504, K=3072 (1024 < M ≤ 8192) and N=3072, K=12288 (1024 < M ≤ 4096) get a different tile. The current entries were tuned with Triton 3.8 and run slower with Triton 3.9; the new ones are faster than the current ones by the median ratios in the Performance table.Validation and unverified scope
NUM_XCDS8, Triton 3.8 and flushed-cache checks were run on AITER8e69f10cand not repeated._get_configon this branch and onmain; only points in the five changed entries differ.op_tests/triton_tests/gemm/basic/test_gemm_a8w8.pyandtest_gemm_a16w16.py.NUM_XCDS, triton-windows 3.9.0.post30 and Triton 3.9.0 on Linux produced the same machine code for these entries; their speed on Linux was not measured.gemm_a8w8anyandgemm_a16w16N=3072, K=12288 entries are not faster than the current ones, and withNUM_XCDS8 the N=3072, K=12288 entry is slower (0.898).PR-specific question
The change is consumed by
get_gemm_config("GEMM-A8W8", M, N, K)on gfx1101 for M in (128, 512] and M > 1024, and byget_gemm_config("GEMM-A16W16", M, N, K)on gfx1101 for the three (N, K) files at 1024 < M ≤ 4096 or ≤ 8192. Other shapes keep their selection: on 170 points the loader returns the same config as onmainfor the 118 points outside these entries, every other key in the four files is byte-identical, and no other arch's files are touched.Changed op tests
None.