feat(gemm_a8w8_blockscale_bpreshuffle): cold-cache retune triton routing for DeepSeek MLA decode-M#4264
Merged
Merged
Conversation
…ing for DeepSeek MLA decode-M Re-measure a8w8 blockscale B-preshuffle triton routing cache-rotated (the #4202 tuning used a no-arg lambda that defeated perftest arg-rotation -> hot-cache optimistic + suboptimal configs), and validate end-to-end via the op-test. - op-test: add run_triton + triton columns; drop -m choices allowlist; fail-loud - wqkv_a (N=2048,K=7168): fix #4202 hot-cache regression (BM4/8,KSPLIT4 -> BM16, KSPLIT8,stages3); route M in {1,2,4,8,16,32,48,64,80,128}, all err=0 - wo_b (N=7168): new routing tp1 K=16384 M<=64, tp4 K=4096 M<=32 (+new JSON); tp8 K=2048 unchanged (triton loses on shallow K) - tuned CSVs: unify bw column to TB/s (asm/ck/cktile rows were GB/s) - wq_b unchanged: #4202 routing verified correct cold-cache
Contributor
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Cold-cache re-tune of the a8w8 blockscale B-preshuffle GEMM triton routing for
DeepSeek MLA decode-M shapes on gfx950 (MI355X), plus a test harness that can
actually measure triton, and a units fix in the tuned CSVs.
The routing decisions in #4202 were made with an in-process timing harness that
wrapped the call in a no-arg lambda, which defeats
perftest's arg-rotationcache-busting → every iteration hit a hot L2 → optimistic numbers and, worse,
cold-cache-suboptimal configs. This PR re-measures everything cache-rotated
(tensors passed positionally so
perftestrotates the weights) and validates everychange end-to-end through the op-test dispatch.
Changes
1.
op_tests/test_gemm_a8w8_blockscale.py— measure tritonrun_tritonpath +triton us/TFLOPS/TB/s/errandtriton/ckcolumns sothe harness times triton alongside ck (dispatch) and asm. Previously triton was
never exercised unless a CSV row already routed to it.
-m choices=[...]allowlist so arbitrary decode M (e.g. 48, 80) can bebenchmarked; the default M list is unchanged.
ck_preshuffle=Falsethe triton columns are simply omitted (pandas NaN-fills).2. wqkv_a (N=2048, K=7168) — fix #4202 regression
The #4202 triton configs for wqkv_a were hot-cache tuned (
BLOCK_SIZE_M=4/8,NUM_KSPLIT=4) and are slower than asm cold-cache (13–16µs vs ~10–13µs) — i.e.#4202 was a regression on this shape as-shipped. Re-tuned cold-cache
(
BLOCK_SIZE_M=16,NUM_KSPLIT=8,num_stages=3) → triton now wins 9–16% atM≤32, and routing extended to M∈{1,2,4,8,16,32,48,64,80,128} (all err=0).
3. wo_b (N=7168) — new triton routing
wo_b was not in #4202.
RowParallelLinear(o_groups·o_lora_rank=16384, dim=7168):Pattern: triton's split-K advantage scales with K depth (tp1 > tp4 > tp8).
4. Tuned CSVs — unify
bwcolumn to TB/sThe
bwcolumn mixed units: asm/ck/cktile rows in GB/s (~600–4400), triton rows inTB/s (~1–5). Converted all asm/ck/cktile rows to TB/s so the column is internally
consistent.
us(which drives routing/dedup) andtflopswere already consistent.Not changed (verified correct cold-cache)
cold-cache — its shipped configs perform fine; no change needed.
Test plan
op_tests/test_gemm_a8w8_blockscale.py--ck_preshuffle 1; dispatch (ckcolumn) now runs triton for routed M witherr=0 and matches the standalone
tritoncolumn.get_CKGEMM_config) confirms libtype per M for every shape.(gfx,cu_num,M,N,K)keys).