Skip to content

[Triton/Gluon] [Config] gemm_a16w16: add gfx1101 (RDNA3) configs - #5961

Merged
azaidy merged 4 commits into
ROCm:mainfrom
Ragua1:gfx1101-gemm-a16w16-config
Oct 21, 2026
Merged

azaidy merged 4 commits into
ROCm:mainfrom
Ragua1:gfx1101-gemm-a16w16-config

Conversation

@Ragua1

@Ragua1 Ragua1 commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

gemm_a16w16 cannot run on gfx1101 (RDNA3, RX 7800 XT): configs/gfx1101/triton/gemm/gemm_a16w16/DEFAULT.json does not exist, so get_gemm_config raises AssertionError: Required config file doesn't exist (aiter/ops/triton/utils/gemm_config_utils.py:64-67). This PR adds a DEFAULT.json and five per-shape files for gfx1101, all measured on that card. The DEFAULT.json is the gfx1100 table from #4234, re-validated on gfx1101. Data only; no kernel, loader or test code is changed.

Technical Details

Six new files in aiter/ops/triton/configs/gfx1101/triton/gemm/gemm_a16w16/:

file content
DEFAULT.json the gfx1100 DEFAULT from #4234 at e81cee88, byte-for-byte, moved to the nested layout
GEMM-A16W16-N=9216-K=3072.json "DEFAULT_FALLBACK": true, tuned M_LEQ_4096, any from DEFAULT.json
GEMM-A16W16-N=12288-K=3072.json same construction
GEMM-A16W16-N=3072-K=12288.json same construction
GEMM-A16W16-N=21504-K=3072.json "DEFAULT_FALLBACK": true, tuned M_LEQ_8192, any from DEFAULT.json
GEMM-A16W16-N=3072-K=15360.json same construction

The starting point is the gfx1100 table from #4234, written for another card. When this PR was opened, #4234 still used the flat layout configs/gemm/gfx1100-GEMM-A16W16*.json, which main no longer resolves (#4948). The table was therefore moved to the nested layout and re-validated on gfx1101. #4234 has since been merged in the nested layout (d7531271), and this DEFAULT.json is byte-identical to the gfx1100 DEFAULT.json it added. Its four N=…-K=… files were not taken over, because their shapes were not measured here. Nothing is claimed about gfx1100; this PR adds only gfx1101 paths.

Each per-shape file sets "DEFAULT_FALLBACK": true (#6128) and holds only the tuned entry, in the bin of the M it was measured at: M_LEQ_4096 for the three shapes measured at M = 4096, M_LEQ_8192 for the two measured at M = 4608. Its any is the one from DEFAULT.json, as write_best_configs.py writes it. All other bins come from DEFAULT.json. The tuned entry is therefore served for 1024 < M ≤ 4096 or 1024 < M ≤ 8192, and every other M behaves exactly as with DEFAULT.json. This was verified through the loader: every measured shape is served the entry it was tested with, with is_tuned True, and verify_configs.py --expect-tuned gives is_tuned True for each of the five shapes at its measured M.

The sibling on another RDNA architecture is #4814 (gfx1151).

Test Plan

Correctness uses the body of test_gemm_a16_w16 (op_tests/triton_tests/gemm/basic/test_gemm_a16w16.py:78-97) with backend="triton", bf16, layout TN: upstream's generate_gemm_a16w16_inputs, F.linear reference and assert_close(atol=1e-1, rtol=1e-2). Shapes are get_x_vals() (27) plus 14 diffusion-model and LLM-like shapes. pytest cannot run on this Windows host, so the body was executed directly with gemm_a16w16(..., config=None) through the loader, and the served entry was checked for every shape.

test_gemm_a16_w16_atomic* need a gemm_a16w16_atomic table, which this PR does not add, and were not run. The activation, layout and persistent variants were not run either.

Test Result

41/41 correctness rows pass in each of 10 fresh processes, and again on this branch after the rebase onto main 599a01c8. Each process ran 5 interleaved rounds with the arm order rotated per round; the ratio is the per-process median of the time with DEFAULT.json over the time with the per-shape file, summarised across the 10 processes. The criterion, set before the run: minimum above 1.00 and median above the DEFAULT.json arm's own between-process spread.

file M × N × K DEFAULT.json ms per-shape ms ratio min median max DEFAULT.json spread
N=9216-K=3072 4096 × 9216 × 3072 4.812 4.240 1.127 1.134 1.140 1.018
N=12288-K=3072 4096 × 12288 × 3072 6.483 5.748 1.115 1.127 1.134 1.014
N=3072-K=12288 4096 × 3072 × 12288 6.527 5.824 1.112 1.121 1.123 1.012
N=21504-K=3072 4608 × 21504 × 3072 12.972 11.389 1.134 1.137 1.142 1.010
N=3072-K=15360 4608 × 3072 × 15360 9.299 8.377 1.101 1.110 1.117 1.015

ms is the median across processes. A tuned M_LEQ_512 entry for N=9216-K=3072 did not pass (0.985–1.049 at 512 × 9216 × 3072), so that bin serves the DEFAULT.json entry. Three control shapes without a per-shape file measured 0.955–1.058, median 0.992–1.000.

Against torch bf16 F.linear this is parity, not a win. Over the same 14 shapes, taking each shape's median over the 10 processes, DEFAULT.json alone measured 0.65–1.04× of torch and the full file set of this PR 0.67–1.18×; torch was timed once per shape per process, not in the interleaved rounds. No performance claim over torch is made.

Stack: gfx1101, Windows 11 native ROCm, display driver 32.0.31041.1004, torch 2.15.0a0+rocm10.2.0a20260926, HIP 7.17.26384, triton 3.8.0, AITER 8253efc4. Since then main has changed the kernel, the test and the loader (#6128 among them). The timings were not repeated; the correctness rows and the served entries were re-checked on the rebased branch.

How the tuned entries were chosen

Six large-shape targets were tuned over the full grid of the table's knobs, 768 configurations per shape: BLOCK_SIZE_M/N in {32, 64, 128, 256}, BLOCK_SIZE_K in {32, 64, 128}, GROUP_SIZE_M {1, 8}, num_warps {4, 8}, waves_per_eu {1, 2}, cache_modifier {None, .cg}; num_stages 2, NUM_KSPLIT 1, matrix_instr_nonkdim 16 fixed. There is no LDS pre-pruning; a configuration that fails to compile counts as failed. The start is the entry DEFAULT.json serves for that shape.

Time (measured 2026-09-28) is whole-call CUDA events on a hot cache, no L2 or Infinity Cache flush between iterations, median of 10 iterations after 3 warmup, calling gemm_a16w16(..., config=compute_splitk_params(entry, K)) with the entry the loader serves; every loader cache is cleared on a table switch. The noise floor in the sweep is max/min of repeated measurements of the start. Winners were then confirmed in the 10-process run above.

An M-binned retune of DEFAULT.json itself, on the same grid, proposed one bin that did not reproduce in fresh processes, so DEFAULT.json stays byte-for-byte as in #4234.

Submission Checklist

@Ragua1
Ragua1 requested a review from a team September 29, 2026 21:08
@github-actions

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
multigpu 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: GPT-OSS-120B, DeepSeek-R1-0528, Kimi-K2.5
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 5961 --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.

@github-actions github-actions Bot changed the title [Triton] [Config] gemm_a16w16: add gfx1101 (RDNA3) configs [Triton/Gluon] [Config] gemm_a16w16: add gfx1101 (RDNA3) configs Sep 29, 2026
@Ragua1

Ragua1 commented Sep 29, 2026

Copy link
Copy Markdown
Contributor Author

@carlushuang, this is the second gfx1101 GEMM table, for gemm_a16w16, next to #5960. Measurements and the test method are in the description.

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 review overview

🟢 Approval recommended

All tables follow the required layout, parse correctly, contain complete parameters and preserve the documented fallback behavior.

Review effort: Balanced
Findings: None

What changed in this PR

Enables Triton gemm_a16w16 on gfx1101 with architecture-specific tuning data.

Changes:

  • Adds a complete default configuration table.
  • Adds five N/K-specific large-M configurations while preserving default small-M bins.
File Description
DEFAULT.json Adds the gfx1101 fallback table.
GEMM-A16W16-N=9216-K=3072.json Tunes the specified large-M shape family.
GEMM-A16W16-N=12288-K=3072.json Tunes the specified large-M shape family.
GEMM-A16W16-N=3072-K=12288.json Tunes the specified large-M shape family.
GEMM-A16W16-N=21504-K=3072.json Tunes the specified large-M shape family.
GEMM-A16W16-N=3072-K=15360.json Tunes the specified large-M shape family.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@ahmed-bsod ahmed-bsod 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.

left comment

…les, add N=9216 K=3072

Signed-off-by: Martin Domanský <[email protected]>
Each per-shape file now holds only its tuned tile, in the bucket of the M
it was measured at: M_LEQ_4096 for N=9216-K=3072, N=12288-K=3072 and
N=3072-K=12288 (M = 4096), M_LEQ_8192 for N=21504-K=3072 and
N=3072-K=15360 (M = 4608). The buckets M_LEQ_4 to M_LEQ_1024 were copies
of DEFAULT.json and now come from it through DEFAULT_FALLBACK. "any" is
the one from DEFAULT.json, as write_best_configs.py writes it. The tiles
are unchanged.

Signed-off-by: Martin Domanský <[email protected]>
@Ragua1
Ragua1 force-pushed the gfx1101-gemm-a16w16-config branch from cacca43 to 33035a0 Compare October 19, 2026 11:53
@Ragua1
Ragua1 requested a review from ahmed-bsod October 19, 2026 11:55

@ahmed-bsod ahmed-bsod 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.

thanks. approved

@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 99e9877 into ROCm:main Oct 21, 2026
azaidy pushed a commit that referenced this pull request Dec 1, 2026
…8216)

The gfx1101 entries from #5960 and #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.
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