Repository navigation
[HIP] [FlyDSL] [GFX1250] Kimi-K3 DSpark PTPC/blockscale and f_b_proj GEMM rows - #7142
Conversation
Kimi-K3 TP8's KDA f_b_proj (N=1536, K=128) runs gemm_a8w8_blockscale_ bpreshuffle with 128x128 E8M0 scales and had no gfx1250 row: no FlyDSL mxfp8_128 kernel took K=128 until a two-buffer generic kernel could run it as one K tile. gemm_a8w8_mxfp8_bpreshuffle_tune.py --mxscale_table now tunes gfx1250's 128x128 table on the mxfp8_128 kernels the 2-D dispatch runs (row-major A), and keeps their kernels_list id like the table's other gfx1250 rows; gfx950 is unchanged. It produced 17 rows (M 1..32768 and 48), added to the Kimi-K3 table sorted by (N, K, M).
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: |
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
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 |
The seven gfx1250 OPUS rows added for N=7168 K=35840 carried pre-#6937 global kids (21172, 21177, 21317), which no longer exist in the gfx1250 a16w16 registry, so test_shipped_tuned_selection_diff_is_exhaustive failed on them. Renumber them to the local kids of the same kernel symbols (kid_for_name): 591, 596 and 716. Kernels and timings are unchanged. Co-authored-by: Cursor <cursoragent@cursor.com>
…GEMM rows (#7142) * Enable K=128 for gfx1250 FlyDSL GEMM * [Config] [FlyDSL] Kimi-K3 gfx1250 mxfp8_128 rows for N=1536 K=128 Kimi-K3 TP8's KDA f_b_proj (N=1536, K=128) runs gemm_a8w8_blockscale_ bpreshuffle with 128x128 E8M0 scales and had no gfx1250 row: no FlyDSL mxfp8_128 kernel took K=128 until a two-buffer generic kernel could run it as one K tile. gemm_a8w8_mxfp8_bpreshuffle_tune.py --mxscale_table now tunes gfx1250's 128x128 table on the mxfp8_128 kernels the 2-D dispatch runs (row-major A), and keeps their kernels_list id like the table's other gfx1250 rows; gfx950 is unchanged. It produced 17 rows (M 1..32768 and 48), added to the Kimi-K3 table sorted by (N, K, M). * [Config] Tune Kimi-K3 DSpark GEMMs on gfx1250 Co-authored-by: Cursor <cursoragent@cursor.com> * [Config] Tune Kimi-K3 DSpark blockscale GEMMs on gfx1250 Co-authored-by: Cursor <cursoragent@cursor.com> * [Config] Tune Kimi-K3 DSpark kv_b_proj PTPC GEMM Co-authored-by: Cursor <cursoragent@cursor.com> * [Config] Use per-arch OPUS kids in the Kimi-K3 gfx1250 BF16 rows The seven gfx1250 OPUS rows added for N=7168 K=35840 carried pre-#6937 global kids (21172, 21177, 21317), which no longer exist in the gfx1250 a16w16 registry, so test_shipped_tuned_selection_diff_is_exhaustive failed on them. Renumber them to the local kids of the same kernel symbols (kid_for_name): 591, 596 and 716. Kernels and timings are unchanged. Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: aoli26 <Ao.Li@amd.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Conflicts, keeping both sides: - kernel_fits_shape and the mxfp8 runner K-tile check: our partial last K tile (one split, 32x32 w_scale) plus main's generic K=128 two-buffer case (#7142). - gemm_a8w8_mxfp8_bpreshuffle_tune.py: keep our gfx1250 32x32 + 128x128 tuning (a superset of #7142's 128x128-only path); merge the docstrings and take main's warning text. - test_gemm_a8w8_blockscale.py: union of the imports. - dsv41 dense mxscale table: 3-way per key; of the 27 keys both sides added, the lower-us row wins (23 ours, 4 main); every row is kept verbatim. Needed beyond the textual conflicts: - The gfx950 FlyDSL blockscale block from #5969 uses b_preshuffle (renamed here) and reports BW like the other columns. - The tuner's kernelId remap also covers gfx1250 32x32 rows ("mxfp8"); gfx1250 128x128 rows keep main's kernels_list id. - dsv41_batched (#7247) repeated 6 keys of dsv4_batched, which the runtime merge rejects; drop main's copies (ours have the lower us). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Motivation
Kimi-K3 TP8 on gfx1250 had three related tuning gaps:
f_b_proj(N=1536, K=128) runs as a 128x128 E8M0 blockscale GEMM. [Config] [GFX1250] Kimi-K3 TP8 gemm tune #6763 left it untuned because no FlyDSL mxfp8_128 kernel accepted K=128.per_block_fp8online quantization.Technical Details
gfx1250/flydsl-gemm-k128(@aoli26): a two-buffer generic kernel runs K=128 as one K tile (prologue + drain). If that commit lands separately, this PR reduces to the tuner/config changes.csrc/gemm_a8w8_mxfp8_bpreshuffle/gemm_a8w8_mxfp8_bpreshuffle_tune.py: on gfx1250,--mxscale_tabletunes 128x128 shapes on the mxfp8_128 kernels used by 2-D dispatch. Rows retain their numerickernels_listid; gfx950 is unchanged.fused_qkv_a_proj)q_b_proj, TP8+DCP8 QREP)kv_b_proj, observed in the DSpark runtime log)o_proj)gate_up_proj)down_proj)fused_qkv_a_proj; logical N=2112 padded to the 128-row kernel tile)context_proj).lm_headwas already covered.ATOM selects the new E8M0 table with
per_block_fp8,ATOM_FP8_BLOCKSCALE_USE_E8M0_SCALE=1, and the default-enabled blockscale weight preshuffle.Test Plan
python3 csrc/gemm_a8w8_mxfp8_bpreshuffle/gemm_a8w8_mxfp8_bpreshuffle_tune.py --mxscale_table -i <shapes> -o <out> --mp 1python3 csrc/ck_gemm_a8w8_bpreshuffle/gemm_a8w8_bpreshuffle_tune.py -i <102 shapes> -o <out> --libtype flydslpython3 csrc/gemm_a16w16/gemm_a16w16_tune.py -i <17 shapes> -o <out>op_tests/tuning_tests/test_csv_validation.pyandtest_config_shape_collision.py.Test Result
Submission Checklist