Repository navigation
[Config] [Perf] Tune gfx1250 DSv4.1 BF16 LM-head and router GEMMs - #7246
Conversation
Signed-off-by: jun <[email protected]>
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: |
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 |
Signed-off-by: jun <[email protected]>
…rows (#7247) Tuned on MI455X (gfx1250, cu_num 256) for the exact shapes DeepSeek-V4.1-Flash (target + MTP draft) runs under DEP4. Complements #7246: the draft lm_head (N=129280, K=5120) is left to #7246 entirely, and no key added by #7246 is repeated here. - dsv41_bf16_tuned_gemm.csv: +181 gfx1250 rows (144 FlyDSL hgemm, 37 OPUS) for target lm_head N=32320 K=5120, N=1024 (fp32 out)/512/384/128/32 K=5120, N=128 K=512 and the draft N=1 K=5376 (fp32 out). These shapes had no gfx1250 row and ran the default Triton path. Rows are inserted right after the header so they do not textually conflict with #7246's appended rows. - dsv41_a8w8_blockscale_mxscale_bpreshuffle_tuned_gemm.csv: +181 gfx1250 32x32 rows (kernelId bmm, FlyDSL mxfp8_32 wmma) at M values not covered by the existing gfx1250 rows. - dsv41_batched_gemm_a8w8_blockscale_mxscale_bpreshuffle_tuned.csv (new): 30 gfx1250 32x32 batched rows (b=8). No existing row is changed and no shape repeats across configs/ and model_configs/, with or without #7246 merged. The new gfx1250 OPUS row for (16384, 512, 5120) shares its M/N/K with a gfx950 row, so it is added to _EXPECTED_GFX_KEY_FIXES in test_opus_a16w16_policy_parity.py, like the other kid-596 entries. Co-authored-by: Claude Opus 5.5 <[email protected]>
) * [OPUS][Perf] Tune gfx1250 DSv4.1 BF16 LM-head GEMMs Signed-off-by: jun <[email protected]> * [Config] [Perf] Tune gfx1250 DSv4.1 BF16 router and sharded LM head Signed-off-by: jun <[email protected]> --------- Signed-off-by: jun <[email protected]> Co-authored-by: jun <[email protected]>
…rows (#7247) Tuned on MI455X (gfx1250, cu_num 256) for the exact shapes DeepSeek-V4.1-Flash (target + MTP draft) runs under DEP4. Complements #7246: the draft lm_head (N=129280, K=5120) is left to #7246 entirely, and no key added by #7246 is repeated here. - dsv41_bf16_tuned_gemm.csv: +181 gfx1250 rows (144 FlyDSL hgemm, 37 OPUS) for target lm_head N=32320 K=5120, N=1024 (fp32 out)/512/384/128/32 K=5120, N=128 K=512 and the draft N=1 K=5376 (fp32 out). These shapes had no gfx1250 row and ran the default Triton path. Rows are inserted right after the header so they do not textually conflict with #7246's appended rows. - dsv41_a8w8_blockscale_mxscale_bpreshuffle_tuned_gemm.csv: +181 gfx1250 32x32 rows (kernelId bmm, FlyDSL mxfp8_32 wmma) at M values not covered by the existing gfx1250 rows. - dsv41_batched_gemm_a8w8_blockscale_mxscale_bpreshuffle_tuned.csv (new): 30 gfx1250 32x32 batched rows (b=8). No existing row is changed and no shape repeats across configs/ and model_configs/, with or without #7246 merged. The new gfx1250 OPUS row for (16384, 512, 5120) shares its M/N/K with a gfx950 row, so it is added to _EXPECTED_GFX_KEY_FIXES in test_opus_a16w16_policy_parity.py, like the other kid-596 entries. Co-authored-by: Claude Opus 5.5 <[email protected]>
…Cm#7246) * [OPUS][Perf] Tune gfx1250 DSv4.1 BF16 LM-head GEMMs Signed-off-by: jun <[email protected]> * [Config] [Perf] Tune gfx1250 DSv4.1 BF16 router and sharded LM head Signed-off-by: jun <[email protected]> --------- Signed-off-by: jun <[email protected]> Co-authored-by: jun <[email protected]>
…rows (ROCm#7247) Tuned on MI455X (gfx1250, cu_num 256) for the exact shapes DeepSeek-V4.1-Flash (target + MTP draft) runs under DEP4. Complements ROCm#7246: the draft lm_head (N=129280, K=5120) is left to ROCm#7246 entirely, and no key added by ROCm#7246 is repeated here. - dsv41_bf16_tuned_gemm.csv: +181 gfx1250 rows (144 FlyDSL hgemm, 37 OPUS) for target lm_head N=32320 K=5120, N=1024 (fp32 out)/512/384/128/32 K=5120, N=128 K=512 and the draft N=1 K=5376 (fp32 out). These shapes had no gfx1250 row and ran the default Triton path. Rows are inserted right after the header so they do not textually conflict with ROCm#7246's appended rows. - dsv41_a8w8_blockscale_mxscale_bpreshuffle_tuned_gemm.csv: +181 gfx1250 32x32 rows (kernelId bmm, FlyDSL mxfp8_32 wmma) at M values not covered by the existing gfx1250 rows. - dsv41_batched_gemm_a8w8_blockscale_mxscale_bpreshuffle_tuned.csv (new): 30 gfx1250 32x32 batched rows (b=8). No existing row is changed and no shape repeats across configs/ and model_configs/, with or without ROCm#7246 merged. The new gfx1250 OPUS row for (16384, 512, 5120) shares its M/N/K with a gfx950 row, so it is added to _EXPECTED_GFX_KEY_FIXES in test_opus_a16w16_policy_parity.py, like the other kid-596 entries. Co-authored-by: Claude Opus 5.5 <[email protected]>
Summary
Add 32 OPUS tuning entries for DSv4.1 BF16 GEMMs on gfx1250 with 256 CUs. The draft LM head, DP-sharded target LM head and selected router shapes now use measured OPUS configurations instead of the untuned Gluon fallback.
Motivation
Model traces showed expensive BF16 LM-head GEMMs. The existing tables had no entries for these hardware and N/K combinations. OPUS-only searches found faster configurations for the full-vocabulary draft head and sharded target head, plus three router buckets.
Changes
Append rows to
aiter/configs/model_configs/dsv41_bf16_tuned_gemm.csv. All 175 original rows remain byte-for-byte unchanged. The PR changes no runtime or kernel code.All new rows use K=5120, BF16 input/output, TN layout, no bias, no scaling and no weight preshuffle.
The router and sharded-head search independently evaluated all 13 standard M buckets (1, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192), plus router M=144/192 and target-head M=576/768. Only the 17 configurations with at least 3% median latency reduction are included. Router M=144/192 and target-head M=1 keep their prior selection.
The router M=64 entry uses splitK=7. Target-head M=4/16 use splitK=1. All other new rows use splitK=0. Each row records its measured latency and TFLOPS/bandwidth calculated from that latency and shape.
Performance
Hardware: gfx1250, 256 CUs. Workload: BF16
[M,5120] @ [N,5120].T. Search candidates are OPUS only; the unchanged production Gluon configuration is the reference.Final isolated measurements use 25 graph replays and the median of five alternating OPUS/default rounds, with a 4096 MiB input-copy budget. Draft-head measurements use 24 calls per graph; the router and sharded-head measurements use
max(24, input-copy count)calls per graph, with at most 64 copies. Split-K timings include the reduction kernel where applicable.Draft LM head (N=129280)
M=120 and M=160 use the winners for M=128 and M=256, respectively, with independent timing and correctness checks.
Router and DP-sharded target LM head
Model trace validation
These are profiled per-kernel durations, separate from the isolated measurements above:
The target-head comparison uses a five-second, four-GPU trace. Target-head M=768 was absent from this short sample, so its validation is limited to the isolated GEMM and production launch-route checks. Shape distributions and workload progress differ across traces. Router M=144/192 retain their default configurations; their trace timing variation is not attributed to this tuning.
Testing
All 32 submitted configurations passed full-output comparison against FP32 matmul cast to BF16 (
atol=0.1,rtol=0.01) and production tgemm launch-route checks during tuning. All 30 router/target-head search winners passed these checks before selecting the 17 improvements. The final proposed CSV also passed lookup checks for all 32 submitted configurations.This is a CSV-only change for gfx1250/256 CUs. No new unit test is added. Other GPU architectures were not tested locally.
Documentation
The existing CSV schema and loading behavior are unchanged. Measurement details are included here.
Dependencies
Breaking Changes
None.
PR Self-Review
Reviewed revision
d6b8b2b6afccae4ae69367d32e7b14af0cccdadaBehavior and intent
The existing model-config merge discovers the 32 added rows. For the architecture, CU count, BF16 types and shape/flag keys listed above, the lookup selects measured OPUS kernels and splitK values. The change preserves every original model-table row and modifies one CSV file.
Validation and unverified scope
git diff bd4ff1c7087970a5b9af92f90c83635e4240f562 HEAD --check: passed.get_GEMM_A16W16_tuned_configto the intended OPUS kid, kernel name and splitK with the proposed model CSV selected byAITER_CONFIG_GEMM_BF16.6ff69e426e2eaf8f8ba32837eeece590de5a1426and ATOMdd8ce2e95c78e357b66698654ce0ddb8783eee3f. This config-only branch is based on upstream mainbd4ff1c7087970a5b9af92f90c83635e4240f562. A separate model trace on this upstream-main checkout and other GPU architectures remain unverified.PR-specific question
Which exact workload keys consume these configuration changes, and what evidence shows that unrelated shapes keep their previous selection?
The lookup key is
(gfx, cu_num, M, N, K, bias, dtype, outdtype, scaleAB, bpreshuffle). New keys usegfx1250,256, the M/N pairs in the Changes table, K=5120,False,torch.bfloat16,torch.bfloat16,False,False.The existing lookup checks exact M first, then its padded-M buckets. Intermediate M values can also use the added rows when their normal bucket resolves to a supported OPUS candidate. This bucketing behavior is unchanged. Router M=144/192 and target-head M=1 have no new matching exact or padded entry.
The diff only appends 32 rows; all 175 original rows are byte-for-byte unchanged. The new keys have no collisions with the canonical or other model BF16 tables. Lookup code still keys on architecture, CU count, N/K, dtype and flags, so other workload families retain their previous entries and selection rules.
Changed op tests
None.