Repository navigation
[Config] [Perf] Tune DeepSeek-V4 M1/M2/M8/M64 FP8 GEMMs on gfx1250 - #7018
Conversation
Add twelve gfx1250 FlyDSL MXFP8-128 configurations at M=1, 2 and 8 for four DeepSeek-V4 TP4 projection shapes. Use split-K=1 configurations selected with cold-cache timings and changed-input numerical checks. Keep the six overlapping keys already present in the upstream Kimi K3 table to preserve unique keys in the runtime configuration merge. Signed-off-by: amd-ruitang3 <[email protected]>
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: |
Add three M64 configuration keys and retune three existing keys across DeepSeek-V4 and the shared Kimi K3 table. Keep merged shape keys unique. Select split-K=1 kernels using cold-cache measurements and bitwise checks against the validated local dispatch, including full-model real inputs. Local TP4 CONC64 total throughput improves 38.48%. Record all normal GSM8K repeats and the unresolved score reduction in the PR description; these results do not establish end-to-end accuracy non-regression. Signed-off-by: amd-ruitang3 <[email protected]>
Restore the two shared-shape Kimi rows because the DSV4 tuning experiment did not validate Kimi end-to-end performance or accuracy. Keep the four DSV4 M64 changes and the existing M1/M2/M8 additions. The runtime merge has no duplicate keys, and both shared shapes retain their pre-update lookup results for M=1..512. All 30 config collision tests pass. End-to-end results for the six-row local experiment do not measure the reduced final PR configuration. Signed-off-by: hwang <[email protected]>
NOT READY FOR HUMAN REVIEWPR 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 |
…7018) * Tune DeepSeek-V4 small-batch FP8 GEMMs on gfx1250 Add twelve gfx1250 FlyDSL MXFP8-128 configurations at M=1, 2 and 8 for four DeepSeek-V4 TP4 projection shapes. Use split-K=1 configurations selected with cold-cache timings and changed-input numerical checks. Keep the six overlapping keys already present in the upstream Kimi K3 table to preserve unique keys in the runtime configuration merge. Signed-off-by: amd-ruitang3 <[email protected]> * Tune DeepSeek-V4 M64 FP8 GEMMs on gfx1250 Add three M64 configuration keys and retune three existing keys across DeepSeek-V4 and the shared Kimi K3 table. Keep merged shape keys unique. Select split-K=1 kernels using cold-cache measurements and bitwise checks against the validated local dispatch, including full-model real inputs. Local TP4 CONC64 total throughput improves 38.48%. Record all normal GSM8K repeats and the unresolved score reduction in the PR description; these results do not establish end-to-end accuracy non-regression. Signed-off-by: amd-ruitang3 <[email protected]> * Preserve upstream Kimi K3 M64 GEMM configurations Restore the two shared-shape Kimi rows because the DSV4 tuning experiment did not validate Kimi end-to-end performance or accuracy. Keep the four DSV4 M64 changes and the existing M1/M2/M8 additions. The runtime merge has no duplicate keys, and both shared shapes retain their pre-update lookup results for M=1..512. All 30 config collision tests pass. End-to-end results for the six-row local experiment do not measure the reduced final PR configuration. Signed-off-by: hwang <[email protected]> --------- Signed-off-by: amd-ruitang3 <[email protected]> Signed-off-by: hwang <[email protected]> Co-authored-by: hwang <[email protected]>
…OCm#7018) * Tune DeepSeek-V4 small-batch FP8 GEMMs on gfx1250 Add twelve gfx1250 FlyDSL MXFP8-128 configurations at M=1, 2 and 8 for four DeepSeek-V4 TP4 projection shapes. Use split-K=1 configurations selected with cold-cache timings and changed-input numerical checks. Keep the six overlapping keys already present in the upstream Kimi K3 table to preserve unique keys in the runtime configuration merge. Signed-off-by: amd-ruitang3 <[email protected]> * Tune DeepSeek-V4 M64 FP8 GEMMs on gfx1250 Add three M64 configuration keys and retune three existing keys across DeepSeek-V4 and the shared Kimi K3 table. Keep merged shape keys unique. Select split-K=1 kernels using cold-cache measurements and bitwise checks against the validated local dispatch, including full-model real inputs. Local TP4 CONC64 total throughput improves 38.48%. Record all normal GSM8K repeats and the unresolved score reduction in the PR description; these results do not establish end-to-end accuracy non-regression. Signed-off-by: amd-ruitang3 <[email protected]> * Preserve upstream Kimi K3 M64 GEMM configurations Restore the two shared-shape Kimi rows because the DSV4 tuning experiment did not validate Kimi end-to-end performance or accuracy. Keep the four DSV4 M64 changes and the existing M1/M2/M8 additions. The runtime merge has no duplicate keys, and both shared shapes retain their pre-update lookup results for M=1..512. All 30 config collision tests pass. End-to-end results for the six-row local experiment do not measure the reduced final PR configuration. Signed-off-by: hwang <[email protected]> --------- Signed-off-by: amd-ruitang3 <[email protected]> Signed-off-by: hwang <[email protected]> Co-authored-by: hwang <[email protected]>
Summary
Several DeepSeek-V4 decode FP8 GEMM shapes on gfx1250 use oversized fallback tiles. Add measured M=1/2/8/M64 configurations for four projection shapes and retune one existing M64 entry, so the existing lookup selects tiles suited to these shapes.
The final diff changes only
dsv4_a8w8_blockscale_mxscale_bpreshuffle_tuned_gemm.csv: 15 added keys and one replacement. All submitted rows use split-K=1. Kernel code and APIs are unchanged.The exact final configuration has not been benchmarked or accuracy-tested end to end. The historical service experiment below used a different six-row local candidate and had an unresolved GSM8K score reduction. Its +38.48% throughput result is not a measured gain for this final PR.
Configuration scope
Target: gfx1250, 256 CUs, FP8 E4M3 inputs/weights, E8M0 activation scales in 1x128 column-major storage, E8M0 128x128 weight scales, (16,16) preshuffled weights, BF16 output.
The existing Kimi K3 CSV is byte-identical to upstream. In particular, the shared M64 keys (1536,7168) and (7168,768) retain their upstream configurations; their experimental DSV4 candidates are excluded. Kimi end-to-end performance and accuracy have not been tested.
AITER merges these model CSVs into a common shape-keyed table. Moving conflicting rows into the DSV4 CSV would not provide model isolation. This PR preserves the existing shared keys rather than adding duplicate alternatives. The resulting lookup for those two shared shapes matches the pre-M64-update lookup for every M=1..512.
Individual GEMM measurements
Before each single-GEMM CUDA Graph replay, flush 256 MiB of cache. Candidate order is randomized; medians use 24 GPU-event measurements after 5 warmups, excluding cache-flush time.
For the existing (64,7168,4096) row, the baseline is the same kernel as the pre-change PR configuration, remeasured under identical conditions. Old CSV
usfields were measured under different conditions and are not directly comparable to these cold-cache values.These four retained M64 candidates were included in six-seed changed-input graph checks and a broader six-shape/384-case numerical audit over actual M=33..64. The tested outputs matched the local pre-tuning dispatch bitwise and passed FP32 dequantized-reference checks: rtol=0.01, atol=0.01, nonclose fraction<=0.05, relative L2<=0.004. The local and PR dispatch tables differ, so this is not a claim that every submitted lookup matches the PR baseline bitwise.
The 12 submitted M1/M2/M8 rows passed 96 numerical cases, including M=5/6/7 tails. They matched the local fallback bitwise and passed the same reference checks. Individual measured speedups range from 2.24x to 5.42x for these rows.
GPU experiments used AITER
245e40cf24052611b6aa6e4921989511805e7a55and ATOM2c5403530f3c63a13e48398c0507bbe0c454d345. The FlyDSL GEMM kernel and common candidate/runner sources match the PR source; the complete AITER trees differ.Final PR checks
python3 -m unittest op_tests.tuning_tests.test_config_shape_collision -v: 30 tests passed, no skips.327cd37ad; only 3 M64 additions and 1 M64 replacement. All other existing rows, including M1/M2/M8 and Kimi rows, are preserved.git diff --check.These checks validate configuration integrity and selection. They do not substitute for end-to-end performance or accuracy measurements of the final configuration. CI status is shown in the PR checks.
Historical six-row local experiment: service measurements and accuracy limitations
The following results were measured before reducing the submitted M64 scope to four rows. The experimental candidate changed all six local M64 shapes, including (1536,7168) and (7168,768), which are excluded from the final PR. The local baseline also contained 18 earlier M1/M2/M8 rows, whereas this PR submits 12 and preserves six upstream shared keys. These service results therefore do not measure the final PR delta.
DeepSeek-V4-Pro, TP4 on 4 x gfx1250, TRITON_MOE=0, FP8 KV, FP4 index, graph level 3, custom-allreduce minimum size 131072. ISL/OSL=8192/1024, concurrency 64, three rounds per configuration, each with 64 warmups and 256 measured requests, random seed 0, unlimited request rate and EOS ignored. All measured requests succeeded with exact token lengths; metrics were independently recomputed. GPU processes were sampled every 10 seconds, with no foreign workload observed. Before/after ran in successive phases, not alternating restarts.
Throughput is the arithmetic mean of three rounds; interactivity is 1000 / pooled mean TPOT(ms), excluding TTFT. The six-row experiment improved total throughput by 38.48% and interactivity by 48.49%. Individual total-throughput rounds were 19076.16/17641.32/19091.63 before and 25739.99/25644.82/25900.79 after.
All valid normal-service GSM8K evaluations are retained: 1319 questions, 3-shot, concurrency 64, temperature 0, request seed 1234, max generation 2048. Responses, paired prompts and scoring were audited.
The latest strict result is 94.6171%, versus 95.0720% for the fresh baseline (-6 questions, -0.4549 percentage points). The cause is unresolved; observed baseline variation does not establish that the candidate's lower scores are harmless. End-to-end accuracy non-regression is not established.
In a separate instrumented full GSM8K run, old/new kernels consumed identical real activation, weight and scale tensors. All 2,667,940 comparisons across four ranks at actual M=48/64 were BF16-bitwise equal and finite, with maximum absolute error 0. A preceding 171,520-call diagnostic also passed. The full instrumented run scored 1253/1319 strict and 1252/1319 flexible. Its extra computation/copies/synchronization change timing, so it does not replace normal-service results.
The first candidate accuracy attempt faulted in
opus_mla_v4_prefill_a8w8_32mx1_16nx4_kernelafter the performance rounds, producing no valid score. Logs were retained; later valid evaluations restarted with the same six candidate configurations. The failure's cause and relationship to GEMM tuning are unresolved. GSM8K does not establish 8K long-context accuracy.The canonical local runtime table has not been switched to the six-row candidate or to the final PR configuration.