Repository navigation
[Triton/Gluon] Seed gfx1150 (RDNA3.5) configs from gfx1151 - #5997
Conversation
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]>
gemm_a16w16 has no RDNA3.5 table on main yet. Copy the gfx1151 table proposed in ROCm#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]>
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The gfx1150 FP4 path remains skipped by pytest, the A16W16 seed depends on an unmerged source config, and README guidance is not synchronized.
Review effort: Balanced
Findings: 2
Open (3)
What changed in this PR
Seeds gfx1150 Triton configurations from gfx1151 and enables unshuffled MXFP4 GEMM on RDNA3.5.
Changes:
- Adds gfx1150 configs for attention, convolution, and GEMM families.
- Enables gfx1150 in the Triton AFP4WFP4 architecture gate.
- Documents gfx1151-to-gfx1150 seeding and removes the unified-attention alias.
| File | Description |
|---|---|
utils/unified_attention_utils.py |
Removes the obsolete gfx1150 alias. |
gemm/basic/gemm_afp4wfp4.py |
Permits unshuffled Triton MXFP4 on gfx1150. |
configs/gfx1150/triton/attention/mha/DEFAULT.json |
Seeds MHA tuning. |
configs/gfx1150/triton/attention/unified_attention/DEFAULT.json |
Seeds unified-attention tuning. |
configs/gfx1150/triton/conv/conv_3x3_nchw/DEFAULT.json |
Adds exact-shape direct-convolution routing. |
configs/gfx1150/triton/gemm/gemm_a8w8/DEFAULT.json |
Seeds A8W8 tuning. |
configs/gfx1150/triton/gemm/gemm_afp4wfp4/DEFAULT.json |
Seeds AFP4WFP4 tuning. |
configs/gfx1150/triton/gemm/gemm_a16w16/DEFAULT.json |
Adds A16W16 defaults sourced from pending PR #4814. |
configs/gfx1150/triton/gemm/gemm_a8w8_blockscale/DEFAULT.json |
Seeds default blockscale tuning. |
.../GEMM-A8W8_BLOCKSCALE-N=8192-K=1024.json |
Seeds specialized blockscale tuning. |
.../GEMM-A8W8_BLOCKSCALE-N=512-K=4096.json |
Seeds specialized blockscale tuning. |
.../GEMM-A8W8_BLOCKSCALE-N=4096-K=4096.json |
Seeds specialized blockscale tuning. |
.../GEMM-A8W8_BLOCKSCALE-N=4096-K=256.json |
Seeds specialized blockscale tuning. |
.../GEMM-A8W8_BLOCKSCALE-N=4096-K=12288.json |
Seeds specialized blockscale tuning. |
.../GEMM-A8W8_BLOCKSCALE-N=4096-K=1024.json |
Seeds specialized blockscale tuning. |
.../GEMM-A8W8_BLOCKSCALE-N=2048-K=4096.json |
Seeds specialized blockscale tuning. |
.../GEMM-A8W8_BLOCKSCALE-N=16384-K=1024.json |
Seeds specialized blockscale tuning. |
.../GEMM-A8W8_BLOCKSCALE-N=1536-K=4096.json |
Seeds specialized blockscale tuning. |
configs/CLAUDE.md |
Documents the new architecture-seeding rule. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
@Ragua1 If the software emulated fp4 path is solid for these archs, ca we get another helper function in the arch helper in the future? something like "is_sw_emulated_fp4_avail"? This should cover archs that doesnt support fp4 in HW but can lower correctly via software emulation. Assuming this requires some test across archs, we can leave this for another PR. Having a centralized check for it might be useful for later. Besides that, LGTM! I started the CI. |
|
Agreed, I will add
Note that Triton lowers gfx1101 already works on that path (Triton 3.8.0, gfx1151 table as a temporary donor):
Would you be open to similar follow-up PRs for the other Triton GEMM families on RDNA3/RDNA3.5, where they compile and pass their tests? Each with arch-specific tuned tables and test gates narrowed to the supported cases, split per family or dtype group. |
I think so, as long as these PRs targeting enabling performance or model support. |
* [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]>
…fx1150 The gfx1150 file has the values that #5997 copied from gfx1151. #6671 then replaced the gfx1151 values for M > 64, but not the gfx1150 values. This copies the current gfx1151 file to gfx1150. On gfx1150 (Radeon 890M), bf16 + bias, 37 shapes: geomean 1.59x faster than main; 36 of 37 shapes are the same or faster. Co-Authored-By: Claude <[email protected]>
) * [Triton/Gluon] [Config] Use the gfx1151 gemm_a16w16 DEFAULT.json on gfx1150 The gfx1150 file has the values that #5997 copied from gfx1151. #6671 then replaced the gfx1151 values for M > 64, but not the gfx1150 values. This copies the current gfx1151 file to gfx1150. On gfx1150 (Radeon 890M), bf16 + bias, 37 shapes: geomean 1.59x faster than main; 36 of 37 shapes are the same or faster. * [Triton/Gluon] [Config] gfx1150 gemm_a16w16: use values from a gfx1150 search A tile search on gfx1150 (Radeon 890M) replaced the copied gfx1151 values: - M_LEQ_256: 64x64x64, 2 warps (was 64x64x128, 4 warps). - Split M_LEQ_1024 at 512: M_LEQ_512 keeps 128x64x64; 512 < M <= 1024 uses the any tile, 128x128x64. Against main, 45 shapes: geomean 1.62x; 2 shapes are slower (768x1536x1536 0.88x, 640x3072x768 0.98x). Co-authored-by: menglcai <[email protected]>
The gfx1150 unified_attention table was seeded from gfx1151 (#5997) and not measured on gfx1150. Retune the attn_2d, attn_3d and kv_split entries that the search's shapes reach, from a search on gfx1150; each changed entry is >= 2% faster than main's value. reduce is unchanged. Signed-off-by: Lin, KuanTing <[email protected]>
The gfx1150 gemm_a8w8 DEFAULT.json is a single "any" entry seeded from gfx1151 (#5997), not measured on gfx1150. Replace it with M buckets (M_LEQ_8 ... M_LEQ_2048, any) from a search on gfx1150 (int8, plain layout). Signed-off-by: Lin, KuanTing <[email protected]>
The gfx1150 conv2d tables were seeded from gfx1151 (#5997) and not measured on gfx1150. Add or change per-shape pins in all nine gfx1150 conv files (1x1, general, 3x3 direct NCHW / cblocked / NHWC, prepack, Winograd F(4,3) input / GEMM / output) for the conv2d model layers of conv_shapes.json, from a search on gfx1150. A pin is kept only where a CUDA-graph timing of the layers that use it confirms it is >= 2% faster than main. Two shapes leave the direct NCHW 3x3 kernel for the cblocked route. The bucket and "any" entries are unchanged. Signed-off-by: Lin, KuanTing <[email protected]>
The gfx1150 gemm_afp4wfp4 DEFAULT.json was seeded from gfx1151 (#5997) and not measured on gfx1150. Retune its three buckets (M_LEQ_16, M_LEQ_128, any) from a search on gfx1150 (software-emulated FP4). Signed-off-by: Lin, KuanTing <[email protected]>
…MM buckets The gfx1150 SonicMoE table was seeded from gfx1151 (#5997) and not measured on gfx1150. Retune the medium_NK and large_NK buckets of _grouped_gemm_kernel by forward time on gfx1150. The weight-gradient kernel (training only) is unchanged. Signed-off-by: Lin, KuanTing <[email protected]>
The gfx1150 gemm_a8w8_blockscale files (DEFAULT.json and 9 per-shape files) are byte copies of gfx1151's, added by #5997 as a placeholder. Retune their buckets from a search on gfx1150; a bucket keeps main's value unless the pick is >= 2% faster. Signed-off-by: Lin, KuanTing <[email protected]>


Motivation
On gfx1150 (RDNA3.5),
flash_attn_func(forward and backward),gemm_a8w8,gemm_a8w8_blockscale,gemm_a16w16andgemm_afp4wfp4fail before any kernel is compiled:The first four have no gfx1150 table on
main.gemm_afp4wfp4is stopped earlier, by the arch check that admits gfx1151 but not gfx1150.This PR seeds gfx1150 from gfx1151 as
configs/CLAUDE.md("Seeding a new architecture") describes: byte-identical copies from the closest measured arch. gfx1150 and gfx1151 are both RDNA3.5 with the same LDS and wave size; gfx1150 has 16 CUs, gfx1151 has 40. The seed is a placeholder, not tuning, and no performance is claimed.Technical Details
16 files under
configs/gfx1150/triton/, each byte-identical to the same path undergfx1151/triton/:attention/mhaflash_attn_funcforward, onekernel and fused backwardattention/unified_attentionunified_attentionconv/conv_3x3_nchwroute_exact_only)gemm/gemm_a8w8gemm_a8w8gemm/gemm_a8w8_blockscalegemm_a8w8_blockscale, andfused_gemm_a8w8_blockscale_mul_addas its fallbackgemm/gemm_a16w16gemm_a16w16,fused_gemm_a16w16_quant_xgemm/gemm_afp4wfp4gemm_afp4wfp4(unshuffled weights)Three further changes:
unified_attention_utils.py: the"gfx1150": "gfx1151"entry leaves_ARCH_ALIAS, since gfx1150 now has its own file. The file is identical, so the served config does not change.gemm_afp4wfp4.py: the triton-backend exception tois_fp4_avail()names gfx1150 beside gfx1151,get_arch() in ("gfx1150", "gfx1151"). Both are RDNA3.5, anddot_scaledlowers without native FP4 instructions on gfx1150 as on gfx1151. The other FP4 entry points keepis_fp4_avail()alone.configs/CLAUDE.md: the list of seeding rules gainsgfx1151 → gfx1150, triton only, next togfx950 → gfx1250.The
gemm_a16w16file is the gfx1151 table proposed in #4814 by @tangzzycc, not yet onmain; its commit carries aCo-authored-bytrailer. If #4814 changes the values before it merges, this copy should follow.conv_3x3_nchwis the one seed that changes a path that already worked. Its four exact shapes move from the cblocked 3x3 kernel to the direct NCHW kernel; every other conv shape routes as before.Test Plan
One process per arm:
main@80a3b0b0without the change, and this branch (0f922e65+ the two commits). The onemaincommit in between touches only gfx942 CK tuning CSVs. Each output is compared against an fp32 torch reference built from the same (already quantized) inputs.unified_attentionruns upstream's owntest_triton_unified_attnon 12 cases of its grid.Test Result
mainflash_attn_funcfwd, bf16, B=1 S=256 H=4 D=64FileNotFoundErrorflash_attn_funcbwd, onekernelFileNotFoundErrorflash_attn_funcbwd, fusedFileNotFoundErrorunified_attentionconv_3x3_nchwshapesgemm_a8w8, fp8, 64×256×512AssertionErrorgemm_a8w8_blockscale, fp8AssertionErrorfused_gemm_a8w8_blockscale_mul_addAssertionErrorgemm_a16w16, bf16AssertionErrorfused_gemm_a16w16_quant_x, Y onlyAssertionErrorgemm_afp4wfp4, MXFP4, scales not shuffledAssertionErrortorch's bf16 backward errors on the same inputs are 1.65e-3 to 1.66e-3.
Stack: gfx1150 (Radeon 890M), Windows 11 native ROCm, torch
2.15.0a0+rocm10.2.0a20260926, HIP 7.17.26384, triton 3.8.0.Notes on the test
The branch run imports this branch's tree directly, with no config redirect and no patching. The upstream
op_testsfor the GEMMs and MHA could not run on this machine, because importing them buildsmodule_aiter_core(HIP), which fails under the Triton-only Windows path;unified_attentionruns its upstream test with those imports stubbed. conv2d runs undertorch.no_grad(), since undertorch.inference_mode()it raises in_pack_cache_keyregardless of the table (#5889).