Skip to content

[Triton/Gluon] [Config] gemm_a8w8, gemm_a16w16: retune five gfx1101 entries for Triton 3.9 - #8216

Merged
azaidy merged 4 commits into
ROCm:mainfrom
Ragua1:gemm-gfx1101-triton39-retune
Dec 1, 2026
Merged

azaidy merged 4 commits into
ROCm:mainfrom
Ragua1:gemm-gfx1101-triton39-retune

Conversation

@Ragua1

@Ragua1 Ragua1 commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Five entries of the gfx1101 Triton configs of gemm_a8w8 and gemm_a16w16 get 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 for gemm_a8w8 and 0.833–0.973 for gemm_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_a16w16 tiles 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_512 and any.
  • 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_FALLBACK and the "any" entries of the per-shape files are unchanged. The gemm_a8w8 entries M_LEQ_64, M_LEQ_128 and M_LEQ_1024, gemm_a16w16/DEFAULT.json and 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_XCDS 1, AITER at the head of this PR (main at 26b4dc1f plus this change). Before is the current entry on main, 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.

Op Entry Shapes Before, µs After, µs Current / new, median (min–max)
gemm_a8w8 M_LEQ_512 8 255.1 202.1 1.266 (1.259–1.272)
gemm_a8w8 any 8 458.7 436.3 1.051 (1.046–1.058)
gemm_a16w16 N=12288, K=3072, M_LEQ_4096 2 3006.2 2441.1 1.234 (1.225–1.273)
gemm_a16w16 N=21504, K=3072, M_LEQ_8192 2 15435.4 12250.4 1.260 (1.259–1.261)
gemm_a16w16 N=3072, K=12288, M_LEQ_4096 2 6065.4 5335.8 1.137 (1.124–1.152)

These 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 wheel 2.16.0a0+rocm10.3.0a20261106, gave medians within 0.013 of these.

Protocol, other Triton versions and per-shape times
  • Shapes: gemm_a8w8 8 random shapes per entry with M inside the entry's range and random N and K; gemm_a16w16 2 random M per file inside the entry's range, at the file's N and K. Seed 20261108, not used by the search.
  • Timing: hot cache, 5 warm-up calls, then 20 timed windows of 32 (gemm_a8w8) or 10 (gemm_a16w16) consecutive calls. No sample fell below the timing floor.
  • Repetition: 10 fresh processes per entry. In each process both arms run on every shape, in rotated order. Per process the ratio current / new is the geometric mean over the entry's shapes. The best and the worst process are trimmed; the table shows median (min–max) of the remaining 8.
  • Decision rule, written before the run: the new entry holds when min > 1 and median − 1 > (max − min) / 2.
  • Correctness: every arm on every row is compared with a reference computed in the same process; 0 mismatches.
  • Flushed cache, gemm_a8w8 only, measured on AITER 8e69f10c with torch wheel 2.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_512 1.428 (1.418–1.464), any 1.118 (1.086–1.250). The retuned M_LEQ_64 entry, which passed with a hot cache (1.045), measured 0.747 (0.705–0.802) here and is therefore not part of this PR. The gemm_a16w16 shapes exceed 110 MiB of working data, larger than the last-level cache.

The same entries with the XCD count AITER uses when chip_info reports none (8), and with Triton 3.8 (triton-windows 3.8.0.post29, torch wheel 2.16.0a0+rocm10.3.0a20261101). All three columns of this table were measured on AITER 8e69f10c with the tables of main, before #7591; the Triton 3.9 columns used torch wheel 2.16.0a0+rocm10.3.0a20261106. They were not repeated on 26b4dc1f. NO-CLAIM means the decision rule did not pass. This PR targets Triton 3.9; on Triton 3.8 the current gemm_a8w8 any and N=3072, K=12288 entries are not slower than the new ones.

Op Entry Triton 3.9, NUM_XCDS 1 Triton 3.9, NUM_XCDS 8 Triton 3.8, NUM_XCDS 1
gemm_a8w8 M_LEQ_512 PASS 1.264 (1.240–1.287) PASS 1.264 (1.255–1.273) PASS 1.232 (1.225–1.238)
gemm_a8w8 any PASS 1.045 (1.039–1.050) PASS 1.023 (1.019–1.030) NO-CLAIM 0.988 (0.984–0.997)
gemm_a16w16 N=12288, K=3072, M_LEQ_4096 PASS 1.247 (1.242–1.251) PASS 1.144 (1.141–1.149) PASS 1.173 (1.168–1.184)
gemm_a16w16 N=21504, K=3072, M_LEQ_8192 PASS 1.268 (1.266–1.269) PASS 1.132 (1.130–1.133) PASS 1.170 (1.167–1.170)
gemm_a16w16 N=3072, K=12288, M_LEQ_4096 PASS 1.133 (1.128–1.137) NO-CLAIM 0.898 (0.897–0.901) NO-CLAIM 0.978 (0.973–0.981)

Per shape, median over the 10 processes, Triton 3.9, NUM_XCDS 1, same run as the Performance table. The geometric mean hides losses on single shapes: the new gemm_a8w8 M_LEQ_512 entry is slower on two of eight shapes, by 10.6 % on M=503, N=5568, K=14080, and the new any entry on three of eight shapes, by up to 10.2 %.

Op Entry M, N, K Current, µs New, µs Current / new
gemm_a8w8 M_LEQ_512 149, 12880, 5632 738.8 520.2 1.420
gemm_a8w8 M_LEQ_512 137, 32, 9216 78.6 28.8 2.731
gemm_a8w8 M_LEQ_512 275, 14576, 22528 4885.0 4259.3 1.147
gemm_a8w8 M_LEQ_512 411, 1376, 28672 918.3 729.3 1.259
gemm_a8w8 M_LEQ_512 267, 528, 2304 25.5 20.2 1.261
gemm_a8w8 M_LEQ_512 443, 2736, 3584 183.1 175.2 1.045
gemm_a8w8 M_LEQ_512 503, 5568, 14080 1617.7 1809.4 0.894
gemm_a8w8 M_LEQ_512 477, 1104, 256 9.1 9.3 0.976
gemm_a8w8 any 1558, 4800, 512 152.4 167.4 0.910
gemm_a8w8 any 4644, 256, 256 20.9 16.6 1.258
gemm_a8w8 any 3628, 58464, 768 6842.2 7619.1 0.898
gemm_a8w8 any 1985, 30976, 6656 17561.8 17116.2 1.026
gemm_a8w8 any 3080, 464, 256 25.8 20.8 1.241
gemm_a8w8 any 1752, 1168, 512 48.7 46.0 1.058
gemm_a8w8 any 3040, 464, 4864 287.6 266.0 1.081
gemm_a8w8 any 2573, 7632, 17152 14153.0 14207.3 0.996
gemm_a16w16 N=12288, K=3072, M_LEQ_4096 1322, 12288, 3072 2490.9 2009.8 1.239
gemm_a16w16 N=12288, K=3072, M_LEQ_4096 2020, 12288, 3072 3628.1 2965.0 1.224
gemm_a16w16 N=21504, K=3072, M_LEQ_8192 3618, 21504, 3072 11727.9 9290.7 1.262
gemm_a16w16 N=21504, K=3072, M_LEQ_8192 6400, 21504, 3072 20315.0 16153.1 1.258
gemm_a16w16 N=3072, K=12288, M_LEQ_4096 2895, 3072, 12288 5684.0 4909.7 1.158
gemm_a16w16 N=3072, K=12288, M_LEQ_4096 3238, 3072, 12288 6472.4 5798.9 1.116

The search and the selection ran with NUM_XCDS 8; the claim above rests only on the repetitions with NUM_XCDS 1. On Triton 3.9 the new gemm_a16w16 entries 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

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

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_config of _triton_kernels/gemm/basic/gemm_a8w8.py and gemm_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 of gemm_a16w16, and N, K pairs that have no per-shape file. Against main, 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 on main. No kernel was launched for this check.

Documentation

  • No documentation change is needed, with the reason stated below

Config values only; no interface or documented behavior changes.

Dependencies

  • No new third-party dependencies added

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_a8w8 with 128 < M ≤ 512 or M > 1024, and gemm_a16w16 at 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

  • Performance: 10 fresh processes per entry on gfx1101 with triton-windows 3.9.0.post30 at the head of this PR, decision rule written before the run, table above; all five entries passed. Correctness against an in-process reference: 0 mismatches. The NUM_XCDS 8, Triton 3.8 and flushed-cache checks were run on AITER 8e69f10c and not repeated.
  • Loader: 170 (M, N, K) points through _get_config on this branch and on main; only points in the five changed entries differ.
  • Not run on this branch: op_tests/triton_tests/gemm/basic/test_gemm_a8w8.py and test_gemm_a16w16.py.
  • Not tested: Linux. With an identical 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.
  • Limitation: on Triton 3.8 the new gemm_a8w8 any and gemm_a16w16 N=3072, K=12288 entries are not faster than the current ones, and with NUM_XCDS 8 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 by get_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 on main for 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.

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]>
@Ragua1
Ragua1 requested a review from a team November 18, 2026 19:55
@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 8216 --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.

@github-actions github-actions Bot changed the title gemm_a8w8, gemm_a16w16: retune five gfx1101 entries for Triton 3.9 [Triton/Gluon] [Config] gemm_a8w8, gemm_a16w16: retune five gfx1101 entries for Triton 3.9 Nov 18, 2026
@Boss2002n
Boss2002n requested a balanced review from Copilot November 18, 2026 22:33

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.

🔵 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_a8w8 default buckets.
  • Updates three shape-specific gemm_a16w16 buckets.
  • 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

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

@aiter-bot

aiter-bot commented Nov 27, 2026 •

Copy link
Copy Markdown

WAITING ON AUTHOR

PR Self-Review

Revision ba54d4e2c66e · 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.

@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 c05e093 into ROCm:main Dec 1, 2026
73 of 81 checks passed
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.

5 participants