Repository navigation
Conversation
Contributor
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
|
Contributor
There was a problem hiding this comment.
Pull request overview
Adds the missing gfx1151 Triton tuning defaults needed for get_gemm_config("GEMM-A16W16", ...) to resolve successfully on gfx1151, enabling the existing gemm_a16w16 Triton path without changing kernel or resolver code.
Changes:
- Add nested-layout default config for gfx1151 Triton
GEMM-A16W16under.../gfx1151/triton/gemm/gemm_a16w16/DEFAULT.json. - Provide three M buckets via
M_LEQ_256,M_LEQ_1024, andany, including required config fields (BLOCK_SIZE_*,GROUP_SIZE_M,num_warps,num_stages,waves_per_eu,matrix_instr_nonkdim,cache_modifier,NUM_KSPLIT).
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This was referenced Sep 29, 2026
Contributor
|
No activity for 15 days, so this is now labelled |
azaidy
pushed a commit
that referenced
this pull request
Oct 9, 2026
* [Triton] [Config] Seed gfx1150 (RDNA3.5) configs from gfx1151 gfx1150 ships no table for MHA, unified_attention, conv_3x3_nchw, gemm_a8w8, gemm_a8w8_blockscale and gemm_afp4wfp4, so flash_attn_func and the three GEMMs fail at config resolution on that arch. Seed them from gfx1151, as configs/CLAUDE.md describes for an arch without tuning: 15 files, each a byte-identical copy of the same path under gfx1151/triton/. gfx1150 and gfx1151 are both RDNA3.5; this is a placeholder, not tuning. - unified_attention_utils.py: drop the gfx1150 entry from _ARCH_ALIAS, so the new gfx1150 file is the one read. Its content is identical. - gemm_afp4wfp4.py: the triton-backend exception to is_fp4_avail() admits gfx1150 beside gfx1151. Other FP4 entry points are unchanged. - configs/CLAUDE.md: list gfx1151 -> gfx1150 among the seeding rules. Signed-off-by: Martin Domanský <[email protected]> * [Triton] [Config] Seed gfx1150 gemm_a16w16 config from #4814 gemm_a16w16 has no RDNA3.5 table on main yet. Copy the gfx1151 table proposed in #4814 (head df9d0a8) byte-identical to gfx1150, so gemm_a16w16 and fused_gemm_a16w16_quant_x resolve a config there. Co-authored-by: tangzzycc <[email protected]> Signed-off-by: Martin Domanský <[email protected]> --------- Signed-off-by: Martin Domanský <[email protected]> Co-authored-by: tangzzycc <[email protected]>
1 task done
klin-amd
added a commit
that referenced
this pull request
Oct 19, 2026
…kets The M_LEQ_1024 tile from #4814 (32x32x256) is slow for large N and K on gfx1151. For example, 666 x 9728 x 2432 ran at 7.2 TFLOPS. - M_LEQ_64: the #4814 M_LEQ_256 tile (32x16x256, 2 warps). It is the best or near the best for M <= 64. - M_LEQ_256: 64x64x128, 4 warps (new). - M_LEQ_1024: 128x64x64, 4 warps (new). Over 10 shapes for each bucket, which include the LLM shapes of #4814, the geomean goes from 17.0 to 27.1 TFLOPS for 256 < M <= 1024. No shape is slower than with the #4814 tile. Co-authored-by: tangzzycc <[email protected]> Co-Authored-By: Claude <[email protected]>
azaidy
pushed a commit
that referenced
this pull request
Oct 21, 2026
* [Triton/Gluon] [Config] Add gfx1151 gemm_a16w16 DEFAULT.json On gfx1151, gemm_a16w16 stops before it compiles a kernel, because there is no configs/gfx1151/triton/gemm/gemm_a16w16/DEFAULT.json. The M_LEQ_256 and M_LEQ_1024 buckets are the gfx1151 table from #4814 (@tangzzycc), the same values that #5997 seeded into gfx1150. The "any" bucket (M > 1024) changes from 64x64x256 to 128x128x64: over 12 large-M shapes on gfx1151 it measured 32.4 TFLOPS geomean against 25.3. Co-authored-by: tangzzycc <[email protected]> * [Triton/Gluon] [Config] gfx1151 gemm_a16w16: retune the M <= 1024 buckets The M_LEQ_1024 tile from #4814 (32x32x256) is slow for large N and K on gfx1151. For example, 666 x 9728 x 2432 ran at 7.2 TFLOPS. - M_LEQ_64: the #4814 M_LEQ_256 tile (32x16x256, 2 warps). It is the best or near the best for M <= 64. - M_LEQ_256: 64x64x128, 4 warps (new). - M_LEQ_1024: 128x64x64, 4 warps (new). Over 10 shapes for each bucket, which include the LLM shapes of #4814, the geomean goes from 17.0 to 27.1 TFLOPS for 256 < M <= 1024. No shape is slower than with the #4814 tile. Co-authored-by: tangzzycc <[email protected]> --------- Co-authored-by: tangzzycc <[email protected]>
4 of 8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Enable the Triton
GEMM-A16W16path ongfx1151.Before this change, calling
gemm_a16w16on a gfx1151 device failed during config resolution because no architecture-specific default config existed:This prevented BF16 A16W16 GEMMs from using the existing Triton kernel on gfx1151. The goal of this PR is to provide a robust generic default config so the public wrapper works without adding architecture-specific kernel code.
Related gfx1151 enablement precedent: #3917.
Technical Details
Added the gfx1151 Triton default config using the current nested config layout:
The default is split into three M ranges based on correctness and performance screening across synthetic and representative LLM shapes:
(BM, BN, BK)M <= 256(32, 16, 256)257 <= M <= 1024(32, 32, 256)(64, 64, 256).cgAll entries use
GROUP_SIZE_M=1,num_stages=2,matrix_instr_nonkdim=16, andNUM_KSPLIT=1.The small-M config favors decode and small-batch projection workloads. The middle bucket avoids regressions observed when extending the small tile to
M=512/1024. The fallback prioritizes stable performance across larger M and mixed N/K shapes.This PR changes only JSON tuning data. It does not modify the kernel, config resolver, dispatcher, or public API.
Test Plan
Test environment:
gfx1151, 40 CUs)2.12.1+rocm7.23.7.1Run the existing real-shape GEMM correctness coverage for the Triton backend:
pytest -q \ op_tests/triton_tests/gemm/basic/test_gemm_a16w16.py::test_gemm_a16_w16 \ -k 'bandwidth_bound and triton and (7168 or 2880)'Run representative performance measurements through the existing benchmark:
python op_tests/op_benchmarks/triton/bench_gemm_a16w16.py \ --shape M N K --metric time --backend tritonPerformance screening used
triton.testing.do_benchwith 25 warmup iterations and 100 measured iterations. AITER andtorch.addmmboth used preallocated BF16 outputs and included bias. Each candidate config was checked againsttorch.nn.functional.linearbefore timing.Representative shapes were taken from GPT-OSS 120B, DeepSeek-R1/Kimi-K2, and Llama 3 8B projection/FFN layers, covering decode, small-batch, and prefill M ranges.
Test Result
Existing pytest coverage:
Additional public-wrapper correctness validation passed for all 16 tested model shapes, including both config boundaries and the fallback range.
Representative BF16 latency results:
(M, N, K)torch.addmm(1, 128, 2880)(256, 2880, 4096)(64, 256, 7168)(1024, 256, 7168)(64, 4096, 14336)(1024, 4096, 14336)(2048, 4096, 14336)AITER was faster than
torch.addmmon 12 of the 16 representative model shapes, with up to 5.69x speedup on small-M projection workloads. This config is intended as a robust generic default; additional N/K-specific tuning can be added separately for workloads that benefit from specialized configs.Submission Checklist