Repository navigation
[Triton/Gluon] [Config] Add gfx1151 gemm_a16w16 DEFAULT.json - #6671
Conversation
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]> Co-authored-by: Claude <[email protected]>
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: |
…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]>
There was a problem hiding this comment.
🔵 Needs a closer look
The hardware-specific settings need human review of the reported gfx1151 correctness and performance evidence.
No open issues 🎉
What changed in this PR
Adds the missing gfx1151 default configuration for the existing Triton gemm_a16w16 path.
Changes:
- Adds three M-size buckets and an
anyfallback with hardware-tuned launch settings. - Leaves kernels, public APIs, and other architectures unchanged.
| File | Description |
|---|---|
aiter/ops/triton/configs/gfx1151/triton/gemm/gemm_a16w16/DEFAULT.json |
Supplies four default configurations for gfx1151 GEMM. |
Review effort: Balanced
…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]>
…AULT.json re-pick 18 GEMM-A16W16-N=<N>-K=<K>.json files from the official tuner on gfx1151, with the large-M buckets re-timed with and without fused activations, and the DEFAULT.json buckets above M = 64 re-picked: #6671 was tuned before #5505 changed the tile remap, and its GROUP_SIZE_M 1 entries are now much slower on wide N. Signed-off-by: Lin, KuanTing <[email protected]>
Motivation
gemm_a16w16is broken on AMD Ryzen AI Max+ 395 (gfx1151). It raises anAssertionError:All 180 Triton tests fail. The kernel is correct. Only the tuned config file is absent. gfx1150 has this file. gfx1151 does not.
#4814 did similar work for gfx1151. That PR is closed. This PR adds the file with values tuned on gfx1151 hardware.
Technical Details
This PR adds one file. It changes no code.
M_LEQ_64M_LEQ_256M_LEQ_1024anyAll buckets use
GROUP_SIZE_M1,num_stages2,waves_per_eu1,matrix_instr_nonkdim16,cache_modifiernull andNUM_KSPLIT1. These are the keys of the family, asconfigs/AGENTS.mdrequires.A tile sweep on gfx1151 selected these values. For M of 64 and below, a small tile is faster. Thus the file gives that
range its own bucket.
These values are measured on gfx1151, not copied from another architecture.
Not in this PR
GEMM-A16W16-PERSISTENT,GEMM-A16W16-ATOMIC), which have no gfx1151 file. A follow-up PR can add them.activation="gelu"or"gelu_tanh", the kernel is slow on gfx1151. [Triton/Gluon] gfx1151 gemm_a16w16: round before the activation to avoid spills #6676 corrects most of this in the kernel. A config change cannot correct it.Test Plan
Run the Triton tests on a gfx1151 host. Run them first on
main, then with this PR.pytest op_tests/triton_tests/gemm/basic/test_gemm_a16w16.py \ -k "triton and not persistent and not atomic"This command covers the plain, activation and layout tests.
Reproduce
On
main, this raises theAssertionErrorabove. With this PR, it prints the tile for each bucket.tunedisFalsefor every M, because this PR adds the default file only.Test Result
On AMD Ryzen AI Max+ 395 (gfx1151) + torch 2.13.0+rocm7.15.0a20260728 + Triton 3.8.0+git4cff872c :
main(727439c)Both runs skip 540 Gluon tests and deselect 300. Gluon does not support gfx1151.
Submission Checklist