Repository navigation
[Triton/Gluon] [Config] [gfx1250] gemm_a16w16: add N=32768 K=512 config (DeepSeek kv_b_proj) - #7962
Conversation
DeepSeek-V3/R1 kv_b_proj at attention TP1. M<=128 keeps the DEFAULT entries; M<=256 uses compute_bound 256x128x64 and larger M 256x256x64.
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: Reviews: |
READY FOR HUMAN REVIEWPR Self-ReviewRevision Author self-review accepted. Readiness report: Author answers
Show the author's self-review answersBehavior and intentValidation and unverified scopePR-specific questionChanged op testsPR state
Copilot findings
Code and op-test hygiene
Required CI
Shadow mode reports what would block but keeps the status successful. Set |
There was a problem hiding this comment.
🟡 Changes recommended
All seven compute_bound entries omit the required waves_per_eu and REGISTER_STORE keys; both must be set to 0 to satisfy the complete-entry rule while preserving wrapper defaults.
1 open issue
What changed in this PR
Adds a shape-specific gfx1250 Gluon GEMM config for DeepSeek-V3/R1’s kv_b_proj at tensor parallelism 1. This changes tuning data only; no kernel or wrapper code changes.
Changes:
- Adds configuration for N=32768, K=512.
- Preserves DEFAULT settings for M ≤ 128.
- Uses compute-bound tiles of 256×128×64 for 128 < M ≤ 256 and 256×256×64 for larger M.
| File | Description |
|---|---|
aiter/ops/triton/configs/gfx1250/gluon/gemm/gemm_a16w16/GEMM-A16W16-N=32768-K=512.json |
Adds shape-specific tile and launch settings across M buckets. |
Review effort: Balanced
k50112113
left a comment
There was a problem hiding this comment.
M_LEQ_1 and M_LEQ_4 should be merged into M_LEQ_8, in M_LEQ_1 you have "num_warps": 1 but the runtime should only be noise compared to "num_warps": 2 Please do a quick test on this and if the runtime does not change a lot, please only keep M_LEQ_8 and remove M_LEQ_1 and M_LEQ_4
|
I will compare num_warps=1 and 2 for M=1..8 before changing the buckets. The current PR keeps M_LEQ_1, M_LEQ_4 and M_LEQ_8. The executable MI455X/gfx1250 package compares the current config with a local candidate that removes only M_LEQ_1 and M_LEQ_4. It includes complete M-bucket correctness, bit identity and CUDA graph timing checks. It records raw rounds and repeats the BF16 run independently. The baseline is e9d66dc. The local candidate is 64b263f50f8d6db877f33a37240acfb95296fee3; it has not been pushed to this PR. I do not have the GPU measurements from this session. I will report the measured difference and run variation before applying the bucket change. The same push separately repairs the gfx950 stand-in setup that failed Standard shard 3, and includes the latest main. |
|
one quick question why do you have |
…nfig Drop M_LEQ_1, M_LEQ_4 and M_LEQ_8: on MI455X the M_LEQ_16 config (BLOCK_N 32, 2 warps) is the fastest at M=2..8 and within 0.1 us at M=1, bit-identical. Also drop the rank-agreement fixture line; main fixed that test in ROCm#8117.
|
@k50112113 Thanks, both addressed in 1603337.
You were right that the small buckets are not needed, but merging them into
|
valarLip
left a comment
There was a problem hiding this comment.
✅ LGTM
The file is the one the gfx1250 Gluon gemm_a16w16 wrapper loads for N=32768, K=512. Replaying get_gemm_config on CPU gives:
- M ≤ 16 →
M_LEQ_16(16x32x512, 2 warps) - M 17-128 → DEFAULT's buckets, copied unchanged
- M 129-256 → 256x128x64 compute_bound
- M 257-8192 → 256x256x64 compute_bound
- M > 8192 →
any
Copying DEFAULT's M ≤ 128 buckets is needed: without DEFAULT_FALLBACK, it is what lets M ≤ 8 take the faster M_LEQ_16 tile.
Every entry has exactly DEFAULT.json's key set. K=512 divides every BLOCK_K. NUM_BUFFERS=4 passes the compute_bound static assert (≥2), and REGISTER_STORE=0 / waves_per_eu=0 match the wrapper defaults. Both tiles are already used in sibling gfx1250 configs.
@k50112113's asks are addressed at 1603337:
- M_LEQ_1, M_LEQ_4 and M_LEQ_8 are gone, with M=1..8 timings showing
M_LEQ_16fastest at M=2..8 and within 0.1 µs at M=1. - The flydsl test change is reverted (fixed on main by #8117).
Please re-review or dismiss the change request so this can merge.
Reviewed at 1603337. Squash note for merge: drop the reverted "[FlyDSL] initialize the gfx950 fused rank-test fixture" line, and do not keep "M<=128 keeps the DEFAULT entries".

Change
aiter/ops/triton/configs/gfx1250/gluon/gemm/gemm_a16w16/GEMM-A16W16-N=32768-K=512.json. It tunes DeepSeek-V3/R1kv_b_projat attention TP1: 128 heads x (128 + 128), withkv_lora_rank=512.M_LEQ_1,M_LEQ_4orM_LEQ_8: M <= 16 takes theM_LEQ_16values, which are faster at M=1..8 on MI455X (see the self-review). M <= 256 uses compute_bound 256x128x64. Larger M uses compute_bound 256x256x64, with 4 warps and 4 buffers.waves_per_eu=0andREGISTER_STORE=0. These values match the wrapper defaults and give every entry the complete DEFAULT key set.Results
Original measurements on MI455X (gfx1250), single GPU, BF16:
The config follow-up makes two existing defaults explicit. These GPU measurements were not rerun on the current revision.
Relation to #6397
#6397 is open. It sends large untuned gfx1250 shapes to the FlyDSL BF16 GEMM by default. This file supplies a shape-specific Gluon config for N=32768, K=512. The current loader marks the explicit M buckets as tuned. Its
anybucket still returnsis_tuned=False.We have not compared this config with #6397's FlyDSL path for this shape.
PR Self-Review
Reviewed revision
1603337152f1881bed8d6d1d8fb52b31578867b3Behavior and intent
This PR adds the gfx1250 Gluon
gemm_a16w16config for DeepSeek-V3/R1 kv_b_proj at attention TP1 (N=32768, K=512), where DEFAULT is slower at large M. Per review, the small-M bucketsM_LEQ_1,M_LEQ_4andM_LEQ_8are removed: M <= 16 now takes theM_LEQ_16config (BLOCK_N 32, 2 warps), which measured fastest at M=2..8 and within 0.1 us at M=1. The earlier one-line_is_gfx1250fixture change is dropped; main fixed that test in #8117, and the file now matches main.Validation and unverified scope
On MI455X (gfx1250), bf16, each small-M bucket's config called directly at M=1..8 (
do_bench_cudagraph, 11 interleaved rounds, median):M_LEQ_163.47-4.05 us,M_LEQ_13.37-4.62 us,M_LEQ_4/M_LEQ_84.88-6.02 us; all four outputs bit-identical, max abs error vs fp32 about 0.25. Throughget_gemm_configwith this JSON, M=1..16 selectM_LEQ_16(tuned) and M=17 selectsM_LEQ_32. The timing used the aiter in the gfx1250 image with the config passed explicitly, not a build of this branch; the kernel is the same.Unverified on this head: the large-M buckets were not re-timed (unchanged from the earlier revision), and FP16 and the FlyDSL comparison were not measured.
PR-specific question
The loader takes the first
M_LEQ_xwith M <= x that the file has, so removing the three small buckets sends M <= 16 toM_LEQ_16; the buckets fromM_LEQ_32up are unchanged. Theget_gemm_configcheck above confirms the selection at M = 1, 2, 4, 8, 9, 16 and 17.Changed op tests
None.