Repository navigation
[Triton/Gluon] [Tune] gfx950 gemm_a16w8_blockscale: add N=1280 K=8192 config - #8106
Conversation
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: Reviews: |
WAITING ON AUTHORPR Self-ReviewRevision Waiting for the PR author. The readiness report will appear after the self-review answers are complete for this revision. Questions to answer in the PR description
Edit the Missing or invalid answers
Shadow mode reports what would block but keeps the status successful. Set |
There was a problem hiding this comment.
🟡 Changes recommended
The retuned configuration lacks tests at N=1280, K=8192 for M=32 and M=64, leaving its split-K results unverified on gfx950.
1 open issue
What changed in this PR
Adds a shape-specific gfx950 tuning config for gemm_a16w8_blockscale at N=1280, K=8192, targeting the small-M performance regression reported after the explicit FMA changes in #7544.
Changes:
- Uses eight split-K partitions and four warps for the M=32 and M=64 buckets.
- Defines additional M buckets and an
anyentry for larger inputs.
| File | Description |
|---|---|
aiter/ops/triton/configs/gfx950/triton/gemm/gemm_a16w8_blockscale/GEMM-A16W8_BLOCKSCALE-N=1280-K=8192.json |
Adds shape-specific tile sizes, launch settings, and split-K values for gfx950. |
Review effort: Balanced
k50112113
left a comment
There was a problem hiding this comment.
LGTM, but please resolve conflicts thanks
Add a shape-specific config for N=1280 K=8192 on gfx950. With the explicit tl.fma change (PR ROCm#7544), M=32/64 at this shape regressed 4-6% with DEFAULT. The new config uses NUM_KSPLIT=8, num_warps=4 for small M buckets, recovering performance to match Triton 3.8. gfx950, N=1280 K=8192, kernel time (us): M 3.8 3.9+fma+retune 32 19.7 8.5 64 19.7 10.7 1024 79.8 78.8 2048 87.4 88.8 16384 489.3 487.9 Co-Authored-By: Claude <[email protected]>
27c156c to
eb71cf5
Compare
…3.9 (#7544) Triton 3.8 enables implicit FP contraction by default, but Triton 3.9 disables implicit FP contraction by default. Expressions like accumulator += tl.dot(a, b) * scale are no longer lowered to a single FMA instruction — the compiler emits separate mul and add instead, causing performance regression. Two changes in the fp8 K loop: Use tl.range(num_stages=2) for the loop. With num_stages on the loop, the Triton pipeliner also pipelines loads that do not feed tl.dot. The a_scale and b_scale loads are then issued one iteration ahead. Before, the wait for the scales also waited for the A/B prefetch. Compute the scale outer product first and use tl.fma for the accumulation. Triton 3.9 does not fuse mul and add by default, so the old expression gave separate mul and add instructions. gfx950, M=4096 N8=512 N16=256 K=7168, median of 5 (us): 3.9 fp8 3.9 both 3.8 fp8 3.8 both before 129.9 141.5 122.8 131.6 after 77.8 120.3 76.9 119.7 The same explicit tl.fma fix is applied to four more kernels that had the same Triton 3.9 regression: gemm_a8w8_blockscale (and preshuffle variant): ~7% regression recovered. gather_kv_b_proj: 12-15% regression recovered. gemm_a16w8_blockscale (PREQUANT and plain branches). batched_gemm_a8w8_a_per_token_group_prequant: explicit FMA + skip split-K range math when NUM_KSPLIT==1 to keep the K loop aligned. Test: test_gemm_a16w8_blockscale.py now parametrizes prequant={False, True}. The N=1280 K=8192 gfx950 retune config is in PR #8106

For Triton 3.9.0 perf regression, add a shape-specific config for N=1280 K=8192 on gfx950. With the explicit tl.fma change (PR #7544), M=32/64 at this shape regressed 4-6% with DEFAULT. The new config uses NUM_KSPLIT=8, num_warps=4 for small M buckets, recovering performance to match Triton 3.8.
Summary
Add a tuned gfx950 config for
gemm_a16w8_blockscaleat N=1280 K=8192, and add test coverage for M=32/64 at this shape to verify the split-K results.Motivation
After the explicit
tl.fmachange in PR #7544, the DEFAULT config regresses 4-6% at M=32/64 for N=1280 K=8192 on gfx950. A shape-specific config withNUM_KSPLIT=8andnum_warps=4recovers performance and is faster than Triton 3.8 at small M.Changes
configs/gfx950/triton/gemm/gemm_a16w8_blockscale/GEMM-A16W8_BLOCKSCALE-N=1280-K=8192.jsonwith tuned tile sizes and split-K values for each M bucket.test_gemm_a16w8_blockscale.py.Performance (if applicable)
Testing
Documentation
Dependencies
Breaking Changes
None
PR Self-Review
Reviewed revision
d802633
Behavior and intent
Small-M performance at N=1280 K=8192 regressed after the explicit
tl.fmachange because the DEFAULT config does not split K enough for this shape. The tuned config usesNUM_KSPLIT=8to distribute the K dimension across 8 partitions, recovering small-M throughput.Validation and unverified scope
Benchmarked on gfx950 with
bench_gemm_a16w8_blockscale.pyat N=1280 K=8192 for M in {32, 64, 1024, 2048, 16384}. Large-M performance is neutral.PR-specific question
N/A
Changed op tests
Added (64, 1280, 8192) to gemm_shapes.py DECODE shapes to cover the split-K path at the newly tuned shape. (32, 1280, 8192) was already added by #8214.