Skip to content

[Triton/Gluon] [ASM] [HIP] Extend the DeepSeek-V4 a8w8 blockscale GEMM tunings for gfx950 - #5473

Closed
LiuYinfeng01 wants to merge 1 commit into
ROCm:mainfrom
LiuYinfeng01:dsv4-a8w8-blockscale-tuning
Closed

LiuYinfeng01 wants to merge 1 commit into
ROCm:mainfrom
LiuYinfeng01:dsv4-a8w8-blockscale-tuning

Conversation

@LiuYinfeng01

@LiuYinfeng01 LiuYinfeng01 commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds 734 rows to aiter/configs/model_configs/dsv4_a8w8_blockscale_tuned_gemm.csv.

Addressing @valarLip's review: the first revision put these in the global
aiter/configs/a8w8_blockscale_tuned_gemm.csv. That was wrong twice over. The
per-model file already exists, and 81 of the rows I had proposed duplicated keys
already in it. get_config_file merges model_configs/ with configs/ at load
time, so per-model rows belong here.

The file already covers four of the six (N, K) families this model drives, but
only at a coarse M ladder, and carries no entry at all for the two vocabulary
projections:

N K before added after
7168 7168 61 594 655
6144 7168 15 39 54
7168 3072 15 39 54
65536 1536 15 39 54
129280 7168 0 16 16
16160 7168 0 7 7

Pure addition: the existing 310 rows are byte-identical, no key is duplicated,
every new row has errRatio = 0.0. Tuned with aiter's own tuner at the default
ERR_RATIO on gfx950 with cu_num=256, matching the rest of the file. M values
follow the ladder the file already uses, restricted to the range each family
reaches at runtime.

Without these rows the entry point reports not found tuned config for every
distinct (M, N, K) DeepSeek-V4 issues; in one 3600-second AgentX run on MI355X
that fires 14066 times.

Per-shape effect

Same entry point the model calls, aiter.gemm_a8w8_blockscale, run twice in the
same image: once against the current table, where all 40 sampled shapes report
not found tuned config, and once with these rows present. 40 shapes sampled
across the M range of all six families.

M N K fallback tuned speedup
4 6144 7168 25.31 us 21.72 us 1.17x
112 6144 7168 43.64 30.72 1.42x
448 6144 7168 114.00 49.88 2.29x
16384 6144 7168 3458.92 647.58 5.34x
64 7168 3072 12.42 13.15 0.94x
448 7168 3072 58.43 26.25 2.23x
16384 7168 3072 1706.08 362.31 4.71x
7332 7168 7168 1822.48 362.20 5.03x
22832 7168 7168 5620.46 958.78 5.86x
32768 7168 7168 8046.69 1509.39 5.33x
272 16160 7168 225.69 62.01 3.64x
368 16160 7168 295.69 59.81 4.94x
112 65536 1536 59.67 22.06 2.71x
16384 65536 1536 7715.77 2649.00 2.91x
8 129280 7168 160.42 157.02 1.02x
128 129280 7168 609.75 196.51 3.10x

Over the 40 sampled shapes: median 2.79x, mean 2.94x, max 5.86x, and
50,860 us to 11,700 us in aggregate. The gain grows with M, which is the
expected shape of the problem.

One shape regresses, M=64 N=7168 K=3072 at 0.94x. It is the only one of the
40 and the absolute difference is 0.7 us, within run-to-run spread, but it is
listed rather than omitted.

In situ

The same effect on a live run, summing every blockscale-family GEMM kernel per
prefill step per rank from a captured trace:

GEMM per step largest contributor
current table 500.1 ms ck::kernel_gemm_xdl_cshuffle_v3 352.2 ms, n=171, 2059 us/call
+ these rows 244.8 ms same kernel: 25.6 ms, n=46, 555 us/call

GEMM time per prefill step halves, and it is the untuned
kernel_gemm_xdl_cshuffle_v3 fallback that disappears as the work moves onto
tuned cktile kernels.

End to end

DeepSeek-V4-Pro, MI355X x8, TP1/DP8, FP8 KV, MTP-3, concurrency 64, full
3600-second window, everything else held byte-identical:

Configuration tokens/$ P90 interactivity requests a8w8 fallbacks
current table 27,003,552 7.055 2836 14066
+ these rows 30,319,229 8.654 3140 7180

+12.3% tokens/$ and +22.7% P90 interactivity from a data file alone.

The remaining 7180 fallbacks are M values between ladder points. The lookup
still resolves those, they are simply not exact hits.

Relation to #4664

#4664 added DeepSeek-V4 coverage but left these six families out. The rows here
are diffed against current main, not against that PR.

Scope

Tuned on gfx950 with cu_num=256 only. The shipped table is gfx950/256
throughout so this matches it, but these rows say nothing about other
architectures.

@LiuYinfeng01
LiuYinfeng01 requested a review from a team September 12, 2026 04:44
@github-actions

Copy link
Copy Markdown
Contributor

🏷️ CI Guide

Runs automatically on every PR:

  • ✅ Pre-checks (submodule verification, code formatting)
  • ✅ Aiter op tests (gfx942 + gfx950)
  • ✅ Triton tests on MI35X (only when aiter/ops/triton/** or related paths are changed)

Extended tests (opt-in via labels):

Label Tests
ci:gfx1250-ffm-triton Run the five-shard gfx1250 FFM Triton test suite
ci:triton-300x Run an additional Triton test job on MI300X in PRs; main branch always runs both MI35X and MI300X
multigpu Aiter multi-GPU tests on the 8-GPU runner
ci:sglang SGLang integration tests: DeepSeek-R1-MXFP4 accuracy, Qwen 3.5 accuracy
ci:atom ATOM benchmark: DeepSeek-R1-0528, GPT-OSS-120B
ci:atom_full ATOM accuracy suite for PR and main models from ATOM models_accuracy.json
ci:vllm vLLM benchmark: GPT-OSS-120B, DeepSeek-R1-0528, Kimi-K2.5
ci:all All standard extended tests (excludes ci:atom_full)

Only add ci:atom_full for FlyDSL or Triton upgrades.
Add labels via the sidebar or gh pr edit 5473 --add-label <label>

PR title tags & labels:
Component tags ([Triton/Gluon], [HIP], [CK], [ASM], ...) are added to the PR title and as PR labels automatically from the changed files and re-synced on every push — change-type tags like [fix]/[Perf], op tags like [MLA], and human labels (ci:*) are left untouched. Add the no-auto-title label to opt this PR out.

@github-actions github-actions Bot changed the title Add DeepSeek-V4 a8w8 blockscale GEMM tunings for gfx950 [Config] Add DeepSeek-V4 a8w8 blockscale GEMM tunings for gfx950 Sep 12, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move new configs to model_configs

@LiuYinfeng01
LiuYinfeng01 force-pushed the dsv4-a8w8-blockscale-tuning branch from 4bcbe26 to a3c6694 Compare September 13, 2026 16:17
@LiuYinfeng01 LiuYinfeng01 changed the title [Config] Add DeepSeek-V4 a8w8 blockscale GEMM tunings for gfx950 Extend the DeepSeek-V4 a8w8 blockscale GEMM tunings for gfx950 Sep 13, 2026
Adds 734 rows to aiter/configs/model_configs/dsv4_a8w8_blockscale_tuned_gemm.csv
and updates 4. `get_config_file` merges model_configs/ with configs/ at load
time, so per-model rows belong here rather than in the global table.

The file already covers four of the six (N, K) families this model drives, but
only at a coarse M ladder, and has no entry at all for the two vocabulary
projections.

  N       K     before  added  after
  7168    7168      61    594    655
  6144    7168      15     39     54
  7168    3072      15     39     54
  65536   1536      15     39     54
  129280  7168       0     16     16
  16160   7168       0      7      7

The 4 updated rows are all N=65536 K=1536, at M = 4, 128, 256 and 512, where
tuning moved the pick from the ck kernels to the ck_tile aqrm variants. Timed
here against the rows they replace, both kernels back to back in one process on
the same tensors, medians over 7 repeats of 50 iterations: 1.26x at M=512,
1.19x at M=128, 1.06x at M=4 and 1.04x at M=256.

Tuning also produced a different pick for 15 further shapes already in the file,
but re-timing them the same way showed every one within 1% of the existing row:
13 resolve to the same ck_tile tile config and differ only in a trailing variant
index, so those rows are left untouched.

Otherwise a pure addition: the remaining 306 original rows are byte-identical,
no key is duplicated, and every added row has errRatio 0.0. Tuned with aiter's
own tuner at the default ERR_RATIO on gfx950 with cu_num=256, matching the rest
of the file.

Without the added rows the entry point reports "not found tuned config" for
every distinct (M, N, K) DeepSeek-V4 issues; in one 3600-second AgentX run on
MI355X that fires 14066 times, each falling back to a kernel chosen without
knowledge of the tile.

Per-shape, 40 shapes sampled across the M range of all six families, measured
against the current table where all 40 fall back: median 2.79x, mean 2.94x,
max 5.86x, 50860us -> 11700us in aggregate; the gain grows with M. One shape,
M=64 N=7168 K=3072, is 0.94x, within run-to-run spread at 12us.

In a captured prefill trace the blockscale-family GEMM time per step per rank
falls from 500.1ms to 244.8ms, with the untuned ck::kernel_gemm_xdl_cshuffle_v3
fallback going from 171 calls at 2059us to 46 at 555us.

End to end on DeepSeek-V4-Pro, MI355X x8, TP1/DP8, FP8 KV, MTP-3, concurrency
64, full 3600-second window with everything else byte-identical: 27,003,552 ->
30,319,229 tokens/$ (+12.3%) and 7.055 -> 8.654 P90 interactivity (+22.7%).
@LiuYinfeng01
LiuYinfeng01 force-pushed the dsv4-a8w8-blockscale-tuning branch from a3c6694 to fc7139c Compare September 13, 2026 16:37
@github-actions github-actions Bot changed the title Extend the DeepSeek-V4 a8w8 blockscale GEMM tunings for gfx950 [Triton/Gluon] [ASM] [HIP] Extend the DeepSeek-V4 a8w8 blockscale GEMM tunings for gfx950 Sep 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants