Skip to content

[Config] DSv4 TP8 a8w8 blockscale bpreshuffle: add Flash and Pro gfx950 rows - #5219

Closed
kevin-mii wants to merge 4 commits into
ROCm:mainfrom
kevin-mii:config/dsv4-tp8-flash-pro-gfx950
Closed

kevin-mii wants to merge 4 commits into
ROCm:mainfrom
kevin-mii:config/dsv4-tp8-flash-pro-gfx950

Conversation

@kevin-mii

@kevin-mii kevin-mii commented Sep 2, 2026 •

Copy link
Copy Markdown

Summary

Add 56 gfx950 TP8 A8W8 blockscale bpreshuffle tuning rows: 41 DeepSeek-V4-Flash rows across N/K=512/4096, 4096/12288, 1536/4096 and 8192/1024, and 15 DeepSeek-V4-Pro rows at N=7168, K=21504. Matching untuned shapes are included.

The original 71-row patch omits nine shapes covered upstream, three rows that already select the same kernel through main's padded-M lookup, and three rows with no measured benefit on current main.

Current performance validation

Compared against main 1dd826c42 on an otherwise idle MI355X VF (gfx950, 256 CUs), ROCm 10 / PyTorch 2.11. The code is identical between arms; the baseline uses the merged main config with the PR's added keys removed, preserving padded-M lookup. Each shape uses identical synthetic tensors, two CUDA graphs of 10 GEMMs, and six alternating rounds of 31 replay timings per arm. Reported latency is the median of the six round medians; JIT compilation and warm-up are excluded.

All 56 retained shapes improved GEMM latency by 4.4–58.9% in this experiment. These are operator measurements with repeated weights, not an end-to-end serving or cold-weight benchmark. CSV latency fields retain the original MI350X tuning measurements.

Removed after this comparison:

  • Flash N=512/K=4096, M=2048: tied (0.2% difference).
  • Flash N=512/K=4096, M=4096: 3.7% slower.
  • Flash N=4096/K=12288, M=192: 2.3% slower.
  • Pro N=7168/K=21504, M=12/24/224: same kernel and split-K already selected by main's padded-M lookup.

SGLang's current default DeepSeek-V4 FP32-scale dense path still calls this dispatcher. Its opt-in E8M0 MX-scale path uses a different tuning table; this PR does not claim to accelerate that path.

Correctness and config checks

All 62 pre-trim shapes passed the dequantized PyTorch comparison (finite output, cosine difference <1e-3). The retained kernel choices are unchanged. The comparative run also checked main/PR output agreement for every shape. Runtime config merge/collision passed. All 56 retained rows select the intended kernels. After removal, five shapes select main's kernels; M=192/N=4096/K=12288 inherits the retained M=256 row through padded-M lookup, measured separately at 3.6% faster than main. The six removed shapes were rechecked after trimming with no observed latency regression.

…50 rows

DeepSeek-V4-Flash-0731 TP8 (N,K = 512/4096, 1536/4096, 4096/12288,
8192/1024 at the M values not yet covered) and DeepSeek-V4-Pro-0813 TP8
(N=7168 K=21504, M 1..16384), tuned with
csrc/ck_gemm_a8w8_blockscale/gemm_a8w8_blockscale_tune.py --preshuffle
on gfx950 (8x MI350X). All rows errRatio 0. Rows whose (M,N,K) already
exist in the file are not re-added.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@kevin-mii
kevin-mii requested review from a team and a lite review from Copilot September 2, 2026 23:55
@github-actions

github-actions Bot commented Sep 2, 2026

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 5219 --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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The change is limited to appending schema-consistent tuned CSV rows with no detected key duplication within the file and no code-path risk.

Pull request overview

Adds missing tuned GEMM config rows for DeepSeek-V4 TP8 on gfx950 (MI350X) for A8W8 blockscale + B-pre-shuffle, preventing runtime fallback to default configs for previously uncovered (M,N,K) shapes.

Changes:

  • Append gfx950 (cu_num=256) tuned rows for DeepSeek-V4-Flash shapes at (N,K) ∈ {(512,4096), (4096,12288), (1536,4096), (8192,1024)} for the missing M values.
  • Append gfx950 tuned rows for DeepSeek-V4-Pro shape (N,K)=(7168,21504) covering M=1..16384 (27 discrete rows).
File summaries
File Description
aiter/configs/model_configs/dsv4_a8w8_blockscale_bpreshuffle_tuned_gemm.csv Adds gfx950 tuned dispatch rows for previously uncovered DeepSeek-V4 TP8 shapes to eliminate default-config fallback.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@zufayu
zufayu requested a review from yzhou103 September 3, 2026 01:17
@yzhou103

yzhou103 commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Could you also update the untuned shapes in untuned csv? Thanks.

Copilot AI review requested due to automatic review settings September 9, 2026 08:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The change is limited to adding CSV tuning data with schema consistent with existing loaders (and get_config_file excludes untuned files from runtime merges).

Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

dsv4 had no bpreshuffle untuned csv, so the shapes tuned here were not in any
re-tune input. Lists the 71 (M,N,K) shapes this PR tuned, grouped by (N,K) with
M ascending, matching dsv4_a8w8_blockscale_untuned_gemm.csv's layout.

Co-Authored-By: Claude Opus 5 <[email protected]>
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

No activity for 15 days, so this is now labelled stale. A push or a comment clears it; keep-open exempts it. Nothing is closed automatically.

@github-actions github-actions Bot added the stale The PR hasn't been updated in 2 weeks label Oct 7, 2026
@zufayu
zufayu requested review from yifehuan and removed request for yzhou103 October 9, 2026 08:21
@github-actions github-actions Bot removed the stale The PR hasn't been updated in 2 weeks label Oct 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

No activity for 15 days, so this is now labelled stale. A push or a comment clears it; keep-open exempts it. Nothing is closed automatically.

@github-actions github-actions Bot added the stale The PR hasn't been updated in 2 weeks label Oct 26, 2026
Copilot AI lite review requested due to automatic review settings October 28, 2026 00:07
@kevin-mii

Copy link
Copy Markdown
Author

Updated against main and retained 62 uncovered rows. Nine Pro shapes now have newer upstream entries, so those duplicates were removed instead of replacing upstream picks. The matching 62-row untuned CSV addresses the earlier request.

Validation on gfx950 / ROCm 10: the default config merge/collision test passes, and all 62 retained shapes select the intended kernel and pass a synthetic comparison against a dequantized PyTorch reference (finite output; cosine difference < 1e-3). The PR is still useful for these remaining shapes. Stored timings remain the original measurements; new-head CI and human review are still required.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Independent confirmation of all 62 gfx950 dispatches and numerical results requires the unavailable ROCm 10/PyTorch 2.11 GPU validation environment.

No open issues 🎉

Review effort: Lite

Copilot AI lite review requested due to automatic review settings October 28, 2026 00:57
@kevin-mii

Copy link
Copy Markdown
Author

Rechecked against current main 1dd826c42 and pushed 3e1ec7c7a to trim six more rows. The PR now adds 56 rows.

Three Pro rows (M=12/24/224) already select the same kernel through main's padded-M lookup. Flash M=2048/N=512/K=4096 tied; M=4096/N=512/K=4096 and M=192/N=4096/K=12288 were slower, so those explicit entries are gone too. The last shape now inherits the retained M=256 row, separately checked at 3.6% faster than main.

On an idle gfx950/256-CU MI355X VF, ROCm 10/PyTorch 2.11, all 56 retained shapes reduced GEMM latency by 4.4–58.9% in repeated-weight operator measurements. Same tensors, separate ten-call CUDA graphs, six alternating rounds of 31 replays per arm; baseline preserves main's padded-M dispatch. This is not an end-to-end serving gain.

Final runtime config merge/collision passed, all 56 retained rows select their expected kernels, and all six removed shapes were rechecked after trimming. Numerical validation passed for every pre-trim shape; retained choices are unchanged. The description now includes the method, limitations and removed shapes. New-head CI and human review are still required.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Static review confirms the dispatch-table shape and schema, but human verification is needed for gfx950 CK/CKTile registry integration and runtime latency/correctness on the MI355X/ROCm environment.

No open issues 🎉

Review effort: Lite

@github-actions github-actions Bot removed the stale The PR hasn't been updated in 2 weeks label Oct 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

No activity for 15 days, so this is now labelled stale. A push or a comment clears it; keep-open exempts it. Nothing is closed automatically.

@github-actions github-actions Bot added the stale The PR hasn't been updated in 2 weeks label Nov 12, 2026
@yifehuan

Copy link
Copy Markdown
Contributor

Closing this stale PR because the DSv4 bpreshuffle table conflicts with main and the last code update was October 28. Please reopen with a rebase and refreshed CI and tuning validation if this work is still needed.

@yifehuan yifehuan closed this Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Config stale The PR hasn't been updated in 2 weeks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants