Repository navigation
[Triton/Gluon] [Config] gemm_a16w16: add gfx1101 (RDNA3) configs - #5961
Conversation
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: |
|
@carlushuang, this is the second gfx1101 GEMM table, for gemm_a16w16, next to #5960. Measurements and the test method are in the description. |
There was a problem hiding this comment.
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.
1fb3803 to
cacca43
Compare
Signed-off-by: Martin Domanský <[email protected]>
Signed-off-by: Martin Domanský <[email protected]>
…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]>
cacca43 to
33035a0
Compare
…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.
Motivation
gemm_a16w16cannot run on gfx1101 (RDNA3, RX 7800 XT):configs/gfx1101/triton/gemm/gemm_a16w16/DEFAULT.jsondoes not exist, soget_gemm_configraisesAssertionError: Required config file doesn't exist(aiter/ops/triton/utils/gemm_config_utils.py:64-67). This PR adds aDEFAULT.jsonand five per-shape files for gfx1101, all measured on that card. TheDEFAULT.jsonis 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/:DEFAULT.jsonDEFAULTfrom #4234 ate81cee88, byte-for-byte, moved to the nested layoutGEMM-A16W16-N=9216-K=3072.json"DEFAULT_FALLBACK": true, tunedM_LEQ_4096,anyfromDEFAULT.jsonGEMM-A16W16-N=12288-K=3072.jsonGEMM-A16W16-N=3072-K=12288.jsonGEMM-A16W16-N=21504-K=3072.json"DEFAULT_FALLBACK": true, tunedM_LEQ_8192,anyfromDEFAULT.jsonGEMM-A16W16-N=3072-K=15360.jsonThe 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, whichmainno 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 thisDEFAULT.jsonis byte-identical to the gfx1100DEFAULT.jsonit added. Its fourN=…-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_4096for the three shapes measured at M = 4096,M_LEQ_8192for the two measured at M = 4608. Itsanyis the one fromDEFAULT.json, aswrite_best_configs.pywrites it. All other bins come fromDEFAULT.json. The tuned entry is therefore served for 1024 < M ≤ 4096 or 1024 < M ≤ 8192, and every other M behaves exactly as withDEFAULT.json. This was verified through the loader: every measured shape is served the entry it was tested with, withis_tunedTrue, andverify_configs.py --expect-tunedgivesis_tuned Truefor 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) withbackend="triton", bf16, layout TN: upstream'sgenerate_gemm_a16w16_inputs,F.linearreference andassert_close(atol=1e-1, rtol=1e-2). Shapes areget_x_vals()(27) plus 14 diffusion-model and LLM-like shapes. pytest cannot run on this Windows host, so the body was executed directly withgemm_a16w16(..., config=None)through the loader, and the served entry was checked for every shape.test_gemm_a16_w16_atomic*need agemm_a16w16_atomictable, 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
main599a01c8. Each process ran 5 interleaved rounds with the arm order rotated per round; the ratio is the per-process median of the time withDEFAULT.jsonover 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 theDEFAULT.jsonarm's own between-process spread.DEFAULT.jsonmsDEFAULT.jsonspreadN=9216-K=3072N=12288-K=3072N=3072-K=12288N=21504-K=3072N=3072-K=15360msis the median across processes. A tunedM_LEQ_512entry forN=9216-K=3072did not pass (0.985–1.049 at 512 × 9216 × 3072), so that bin serves theDEFAULT.jsonentry. Three control shapes without a per-shape file measured 0.955–1.058, median 0.992–1.000.Against torch bf16
F.linearthis is parity, not a win. Over the same 14 shapes, taking each shape's median over the 10 processes,DEFAULT.jsonalone 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, AITER8253efc4. Since thenmainhas 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/Nin {32, 64, 128, 256},BLOCK_SIZE_Kin {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 16fixed. There is no LDS pre-pruning; a configuration that fails to compile counts as failed. The start is the entryDEFAULT.jsonserves 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.jsonitself, on the same grid, proposed one bin that did not reproduce in fresh processes, soDEFAULT.jsonstays byte-for-byte as in #4234.Submission Checklist