Skip to content

[Config] [gfx1250] DSv4.1 engram wkv / main_proj MXFP8 compute-kernel rows at decode M 928..1536 (after #7827) - #8048

Merged
yifehuan merged 1 commit into
ROCm:mainfrom
yhl-amd:hyi/dsv41-mx32-c1024-compute-rows
Nov 27, 2026
Merged

yifehuan merged 1 commit into
ROCm:mainfrom
yhl-amd:hyi/dsv41-mx32-c1024-compute-rows

Conversation

@yhl-amd

@yhl-amd yhl-amd commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Rebased on current main (#7827 has merged). The compute kernel these rows name is in main (#7659, #7827); there is no key overlap with #7827.

Motivation

Exact gfx1250 rows for two DSv4.1-Flash dense MXFP8 GEMMs (32x32 weight scale) at the high-concurrency decode widths (M 928..1536):

  • engram wkv, N=25600, K=6144
  • DSpark main_proj, N=5120, K=15360

At these M the existing rows (or, above M 1024, the M 2048 row they fell back to) use the batched kernel; the 2-D compute kernel is better when measured inside the decode layer sequence (other large GEMMs before and after), which is what these rows are chosen on.

The rows name the 32x32-scale flydsl_mxfp8_32_bpreshuffle_compute_wmma_* kernel, which is in main since #7659; they were validated on main + #7827 (now merged), and #7827 has no rows at these keys. This PR contains only CSV rows; no code from #7827. The wo_a / wq_b decode rows of the same sweep are already in #7827 and are not repeated here.

Technical Details

aiter/configs/model_configs/dsv41_a8w8_blockscale_mxscale_bpreshuffle_tuned_gemm.csv:

shape M change
25600 x 6144 928, 960, 992, 1024 batched kernel -> compute t256x256x128 nb2 cm4 cn1
25600 x 6144 1216, 1280, 1344, 1408, 1472, 1536 new rows, same compute kernel
5120 x 15360 928, 960, 992, 1024 batched kernel -> compute t128x256x128 nb3 cm2 cn2
5120 x 15360 1088 .. 1536 (step 64) new rows, same compute kernel

Rows are replaced in place or inserted next to their shape; no duplicate keys. Prefill rows and other shapes are unchanged.

Test Plan

On gfx1250, main + #7827 vs main + #7827 + this PR: gemm_a8w8_blockscale(..., isBpreshuffled=True) (the production entry) at 22 M values (1 .. 2048, including 1025 / 1153 / 1345 / 1535 and every new row) for engram wkv, main_proj and the indexer wq_b, with normal and wide-range activations (zero rows, ±2^6 row scales): tuned-row selection (AITER_LOG_TUNED_CONFIG=1), output hashes, and cosine against an fp32 dequantized reference.

Test Result

PR Self-Review

Reviewed revision

846c20c202

Behavior and intent

  • Changes the gfx1250 MXFP8 (32x32 scale) GEMM selection of two DSv4.1-Flash dense shapes at decode M 928..1536: engram wkv (N 25600, K 6144) and DSpark main_proj (N 5120, K 15360). M 928..1024 rows switch from the batched kernel to the 2-D compute kernel, and the missing M 1088..1536 rows are added with the same compute kernel. Before, M above 1024 fell back to the M 2048 batched row.
  • Why: measured inside the decode layer sequence (other large GEMMs before and after), the compute kernel is the better pick at these M; isolated single-kernel timing is not used for this choice.
  • Risk: medium-low. The compute kernel is a different kernel from the batched one; it keeps the K accumulation order (outputs byte-identical in the run below), but its speed depends on the neighbouring kernels; the validation stack included [FlyDSL] [gfx1250] DSv4.1 Flash 32x32 GEMMs: tune C1024 decode, prefetch a8w8/a4w4 compute kernel code #7827 (compute-kernel code prefetch), which is now in main.
  • Compatibility: gfx1250 / cu_num 256 rows only; prefill rows, other shapes and other architectures are untouched. No API, code or environment-variable change.

Validation and unverified scope

PR-specific question

The keys consumed are (gfx1250, cu_num 256, 32x32 scale) with (N, K) = (25600, 6144) at M 928/960/992/1024 (replaced) and 1216..1536 step 64 (new), and (5120, 15360) at M 928/960/992/1024 (replaced) and 1088..1536 step 64 (new), in dsv41_a8w8_blockscale_mxscale_bpreshuffle_tuned_gemm.csv. Unrelated shapes keep their selection: rows are replaced in place or inserted next to their shape, no duplicate keys, no key overlap with #7827, and the 22-M run covered the unchanged indexer wq_b shape with identical selection and outputs.

Changed op tests

None. This PR only changes CSV rows; no file under op_tests/ changes.

🤖 Generated with Claude Code

@yhl-amd
yhl-amd requested a review from a team November 16, 2026 18:00
@yhl-amd yhl-amd added the Config label Nov 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🏷️ CI Guide

Runs automatically on every PR:

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

Extended tests (opt-in via labels):

Label Tests
ci:mi300x Run Aiter standard tests on MI300X in PRs; main branch always runs them
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 (added automatically when gfx942 configs change); main branch always runs both MI35X and MI300X
ci:triton-355 Run the full Triton test suite on MI35X, not only the tests the change affects
ci:windows Windows JIT op smoke test on the Radeon R9700 ROCm runner
ci:multi-gpu 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: DeepSeek-V4-Pro, MiniMax-M3-MXFP4
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 8048 --add-label <label>

One backend per PR:
A PR changes one kernel backend: [Triton/Gluon] (Triton and Gluon count as one), [HIP], [ASM], [CK], [OPUS] or [FlyDSL]. If the title ends up with two backend tags, split the PR -- as stacked pull requests when one part cannot merge without the other.

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 stop the title rewrites; labels stay in sync either way.

Reviews:
A reviewer is usually assigned within one working day after the PR is ready for review (see Code Review Process). If nobody has responded for about a week, mention the area contact listed in CONTACTS.md. Want to help review? See REVIEWERS.md.

@aiter-bot

aiter-bot commented Nov 16, 2026 •

Copy link
Copy Markdown

READY FOR HUMAN REVIEW

PR Self-Review

Revision 846c20c20289 · mode shadow

Author self-review accepted. Readiness report:

Author answers

  • PASS — current-SHA answers are present and structurally specific
Show the author's self-review answers

Behavior and intent

- Changes the gfx1250 MXFP8 (32x32 scale) GEMM selection of two DSv4.1-Flash dense shapes at decode M 928..1536: engram wkv (N 25600, K 6144) and DSpark main_proj (N 5120, K 15360). M 928..1024 rows switch from the batched kernel to the 2-D compute kernel, and the missing M 1088..1536 rows are added with the same compute kernel. Before, M above 1024 fell back to the M 2048 batched row.
- Why: measured inside the decode layer sequence (other large GEMMs before and after), the compute kernel is the better pick at these M; isolated single-kernel timing is not used for this choice.
- Risk: medium-low. The compute kernel is a different kernel from the batched one; it keeps the K accumulation order (outputs byte-identical in the run below), but its speed depends on the neighbouring kernels; the validation stack included #7827 (compute-kernel code prefetch), which is now in main.
- Compatibility: gfx1250 / cu_num 256 rows only; prefill rows, other shapes and other architectures are untouched. No API, code or environment-variable change.

Validation and unverified scope

- gfx1250, at the previous head `24e2cc754f` (this head `846c20c202` is a rebase onto current main with the same row changes), main + #7827 vs main + #7827 + this PR: `gemm_a8w8_blockscale(..., isBpreshuffled=True)` at 22 M values (1..2048, including 1025 / 1153 / 1345 / 1535 and every new row) for engram wkv, main_proj and the indexer wq_b, normal and wide-range activations, with `AITER_LOG_TUNED_CONFIG=1`. Result: the new rows are selected at their M; 132/132 outputs byte-identical; cosine against an fp32 dequantized reference at the bf16 level (passed).
- The rows were part of the gfx1250 DSv4.1-Flash serving stack (older aiter tree based on main `e9efac0e2`, plus #7827's code) that passed its accuracy checks.
- Unverified: not re-run on the current main (gfx1250 validation pending); the #7827 head used in the run was the one current at that time; no op test covers this table, so CI does not exercise the rows.

PR-specific question

The keys consumed are `(gfx1250, cu_num 256, 32x32 scale)` with `(N, K) = (25600, 6144)` at M 928/960/992/1024 (replaced) and 1216..1536 step 64 (new), and `(5120, 15360)` at M 928/960/992/1024 (replaced) and 1088..1536 step 64 (new), in `dsv41_a8w8_blockscale_mxscale_bpreshuffle_tuned_gemm.csv`. Unrelated shapes keep their selection: rows are replaced in place or inserted next to their shape, no duplicate keys, no key overlap with #7827, and the 22-M run covered the unchanged indexer wq_b shape with identical selection and outputs.

Changed op tests

None. This PR only changes CSV rows; no file under `op_tests/` changes.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

PR state

  • PASS — pull request is marked ready for review

Copilot findings

  • PASS — no active Copilot finding lacks a substantive author reply
  • ADVISORY — Copilot did not review the current head SHA

Code and op-test hygiene

  • PASS — no committed artifact or conflict marker detected

Required CI

  • PASS — Black: passed
  • PASS — Ruff: passed
  • PASS — Repository dependency: passed
  • PASS — Aiter Test Gate: passed

Shadow mode reports what would block but keeps the status successful. Set AITER_PR_SELF_REVIEW_MODE=enforce only after reviewing real false positives.

…j at decode M 928..1536

Two DSv4.1 dense MXFP8 (32x32 weight scale) shapes at the high-concurrency
decode widths:

- engram wkv (N=25600, K=6144): M 928 / 960 / 992 / 1024 move from the
  batched kernel to the 2-D compute kernel t256x256x128 nb2 cm4 cn1; M 1216,
  1280, 1344, 1408, 1472, 1536 had no row (they used the M 2048 row) and get
  the same kernel.
- DSpark main_proj (N=5120, K=15360): M 928 / 960 / 992 / 1024 move to the
  compute kernel t128x256x128 nb3 cm2 cn2; M 1088..1536 (step 64) had no row
  and get the same kernel.

Rows were chosen from measurements inside the decode layer sequence (other
large GEMMs before and after), not back-to-back runs of one kernel. Outputs
are bit identical to the previous kernels. Prefill rows and other shapes are
unchanged.

The 32x32-scale compute kernel these rows name is already in main
(ROCm#7659, ROCm#7827).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@yhl-amd
yhl-amd force-pushed the hyi/dsv41-mx32-c1024-compute-rows branch from 24e2cc7 to 846c20c Compare November 23, 2026 05:30
@yhl-amd

yhl-amd commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto current main (9a6a02b79) now that #7827 has merged; new head 846c20c202 (previous head kept as bak/8048-pre1123a). The only conflict was textual: main had added the M 16384 engram wkv row right after the rows this PR replaces. No key this PR touches was changed on main, the row changes are identical to the previous head, and the family-wide duplicate-shape check (test_config_shape_collision, test_csv_validation) passes. The "merge after #7827" note has been removed from the description; Self-Review revision updated.

@yifehuan yifehuan 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.

LGTM

@yifehuan
yifehuan merged commit 1a191f8 into ROCm:main Nov 27, 2026
84 of 86 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants