Skip to content

[FlyDSL] Gfx950/dsv41 flydsl mxfp8 perf optimization - #8296

Merged
valarLip merged 5 commits into
mainfrom
gfx950/dsv41-flydsl-mxfp8
Nov 20, 2026
Merged

valarLip merged 5 commits into
mainfrom
gfx950/dsv41-flydsl-mxfp8

Conversation

@solinzby1

@solinzby1 solinzby1 commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

optimization1:

N K M range M Rows Avg Min Max
1792 5120 288–800 352, 384, 448, 480, 512, 544, 576, 608, 640, 672, 704, 736, 768, 800 14 +9.3% +6.1% +14.3%
1792 5120 832–1024 864, 896, 928, 960, 1024 5 +4.4% +2.5% +5.6%
1792 5120 1088–1536 1088, 1152 2 +5.6% +4.5% +6.7%
4096 1280 1088–1536 1088, 1152, 1216, 1344 4 +3.7% +3.0% +4.6%
4608 5120 288–800 768, 800 2 +4.8% +3.7% +5.8%
4608 5120 832–1024 832, 896, 992, 1024 4 +6.3% +0.8% +12.6%
4608 5120 1088–1536 1088, 1216, 1408, 1472 4 +5.9% +3.4% +10.0%
5120 2304 832–1024 960 1 +7.1% +7.1% +7.1%
5120 2304 1088–1536 1088, 1152, 1280, 1344, 1472 5 +4.0% +2.2% +6.2%
5120 8192 288–800 416, 448, 480, 512, 544, 576, 608, 640, 672, 704, 736, 768, 800 13 +10.6% +5.6% +16.9%
5120 8192 832–1024 832, 864, 896, 928, 960, 992, 1024 7 +8.2% +6.3% +10.7%
5120 8192 1088–1536 1088, 1152, 1216, 1280, 1408, 1472, 1536 7 +5.8% +4.5% +6.8%

optimization 2:
Decode: grouped by N, K and M range (only M values with changes are counted; all other M values are unchanged)

N K M range Changed M Rows Avg Min Max
5120 2304 832–1024 832, 864 2 +3.4% +3.4% +3.4%
25600 6144 288–800 288, 320, 352, 384, 416, 448, 512, 672, 704, 736, 800 11 +7.8% +2.3% +13.8%
25600 6144 832–1024 832, 864, 896, 928, 960, 992, 1024 7 +1.6% +0.7% +2.5%
25600 6144 1088–1536 1088, 1152, 1216, 1280, 1344, 1408, 1472, 1536 8 +1.3% −0.3% +2.7%
32768 1280 288–800 288, 352, 416, 448, 512, 544, 800 7 +3.8% +1.2% +5.9%
32768 1280 832–1024 832, 864, 896, 928, 960, 992, 1024 7 +4.5% +3.0% +6.1%
32768 1280 1088–1536 1216, 1280, 1344, 1408, 1472, 1536 6 +5.1% +3.9% +6.0%

Prefill: grouped by N, K and M range (using the 8w rows)

N K M range M Rows Old TFLOPS New TFLOPS Avg Min Max
1792 5120 2048–8192 6144, 8192 2 1969–2286 2026–2352 +2.9% +2.9% +2.9%
1792 5120 10240–16384 10240, 12288, 14336, 16384 4 1681–2352 1740–2395 +2.5% +1.6% +3.5%
1792 5120 32768 32768 1 2344 2380 +1.5% +1.5% +1.5%
4608 5120 2048–8192 2048, 6144 2 1743–2302 1805–2315 +2.1% +0.6% +3.5%
4608 5120 10240–16384 10240, 12288, 14336, 16384 4 2337–2483 2390–2521 +1.6% +1.2% +2.3%
4608 5120 32768 32768 1 2474 2515 +1.7% +1.7% +1.7%
5120 2304 2048–8192 2048, 4096, 6144, 8192 4 1560–2138 1579–2138 +0.2% −0.5% +1.2%
5120 2304 10240–16384 10240, 12288, 14336, 16384 4 2055–2257 2073–2265 +0.4% −0.0% +0.9%
5120 2304 32768 32768 1 2239 2241 +0.1% +0.1% +0.1%
5120 8192 2048–8192 2048, 4096, 6144, 8192 4 1952–2537 2000–2595 +2.2% +1.2% +2.8%
5120 8192 10240–16384 10240, 12288, 14336, 16384 4 2306–2630 2351–2669 +1.6% +1.3% +2.0%
5120 8192 32768 32768 1 2600 2615 +0.6% +0.6% +0.6%
25600 6144 2048–8192 2048, 4096, 6144, 8192 4 2134–2500 2178–2537 +1.6% +1.4% +2.1%
25600 6144 10240–16384 10240, 12288, 14336, 16384 4 2493–2553 2524–2593 +1.5% +1.2% +1.8%
25600 6144 32768 32768 1 2548 2588 +1.6% +1.6% +1.6%
32768 1280 2048–8192 2048 1 1819 1936 +6.4% +6.4% +6.4%

optimization 3:

Decode (M < 2048), by N, K and M range

N K M range M Rows Before (us) After (us) Change avg Change min Change max
640 5120 1–256 1, 2, 4, 8, 16–256 step 16 20 4.84–8.97 3.99–7.15 +33.2% +20.7% +53.4%
640 5120 288–800 288–800 step 32 17 14.44–18.70 7.31–8.94 +98.4% +78.0% +110.4%
640 5120 832–1024 832–1024 step 32 7 18.70–19.09 10.31–11.56 +75.5% +63.7% +81.3%
640 5120 1088–1984 1088–1984 step 64 15 19.44–27.05 10.73–14.94 +75.7% +57.3% +107.0%
5120 320 1–256 1, 2, 4, 8, 16–256 step 16 20 2.72–4.77 2.59–4.00 +16.9% +0.0% +31.9%
5120 320 288–800 288–800 step 32 17 6.12–10.81 4.06–6.64 +32.5% +20.1% +62.8%
5120 320 832–1024 832–1024 step 32 7 10.88–11.71 6.68–7.14 +63.5% +61.9% +66.0%
5120 320 1088–1984 1088–1984 step 64 15 8.52–14.00 7.24–9.50 +28.4% +8.4% +50.9%
5120 1024 1–256 1, 2, 4, 8, 16–256 step 16 20 3.48–8.14 2.86–5.53 +34.5% +7.9% +49.0%
5120 1024 288–800 288–800 step 32 17 10.89–13.27 5.61–9.89 +59.8% +34.2% +119.5%
5120 1024 832–1024 832–1024 step 32 7 13.39–14.27 10.06–11.13 +31.7% +28.3% +35.8%
5120 1024 1088–1984 1088–1984 step 64 15 14.24–25.71 11.19–16.55 +33.1% +11.4% +58.8%

Prefill (M >= 2048), by N, K and M range

N K M range M Rows Before (us) After (us) Before TFLOPS After TFLOPS Change avg Change min Change max
640 5120 2048–8192 2048, 2304, 2560, 2688, 2816, 3072, 3328, 3456, 3584, 3840, 4096, 6144, 8192 13 26.5–47.6 14.9–34.5 323–1129 901–1555 +128.8% +37.8% +197.1%
640 5120 10240–16384 10240, 12288, 14336, 16384 4 48.1–91.1 36.8–55.6 1032–1654 1745–1931 +44.7% +14.9% +69.2%
640 5120 32768 32768 1 136.4 106.2 1574 2021 +28.4% +28.4% +28.4%
5120 320 2048–8192 2048, 2304, 2560, 2688, 2816, 3072, 3328, 3456, 3584, 3840, 4096, 6144, 8192 13 13.8–34.5 9.7–26.4 482–806 690–1018 +37.5% +11.5% +67.9%
5120 320 10240–16384 10240, 12288, 14336, 16384 4 43.7–57.7 32.8–48.7 768–931 1023–1102 +25.6% +18.4% +33.2%
5120 320 32768 32768 1 118.6 101.7 905 1056 +16.7% +16.7% +16.7%
5120 1024 2048–8192 2048, 2304, 2560, 2688, 2816, 3072, 3328, 3456, 3584, 3840, 4096, 6144, 8192 13 21.9–58.1 17.0–51.1 866–1554 1264–1681 +25.7% +5.4% +55.0%
5120 1024 10240–16384 10240, 12288, 14336, 16384 4 73.5–103.6 61.4–95.5 1461–1658 1719–1799 +12.2% +8.1% +19.7%
5120 1024 32768 32768 1 211.4 187.2 1626 1835 +12.9% +12.9% +12.9%

@solinzby1
solinzby1 requested review from a team and a balanced review from Copilot November 19, 2026 09:34
@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 8296 --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.

@github-actions github-actions Bot changed the title Gfx950/dsv41 flydsl mxfp8 perf optimization [FlyDSL] Gfx950/dsv41 flydsl mxfp8 perf optimization Nov 19, 2026
@aiter-bot

aiter-bot commented Nov 19, 2026 •

Copy link
Copy Markdown

WAITING ON AUTHOR

PR Self-Review

Revision 32e2df33a163 · mode shadow

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

  1. What behavior does this PR change, and why is the existing behavior insufficient?
  2. What did you validate, and what remains unverified? Include commands, hardware/configuration and results.
  3. Which exact workload keys consume these configuration changes, and what evidence shows that unrelated shapes keep their previous selection?
  4. For every changed op_tests/ file, what behavior does it cover and why is it not redundant? Write None if no op test changed.

Edit the PR Self-Review section in the PR description. Include the current revision SHA; this comment refreshes automatically.

Missing or invalid answers

  • FAIL — missing ### Reviewed revision in the PR description
  • FAIL — missing ### Behavior and intent in the PR description
  • FAIL — missing ### Validation and unverified scope in the PR description
  • FAIL — missing ### PR-specific question in the PR description
  • FAIL — missing ### Changed op tests in the PR description
  • FAIL — Reviewed revision must contain at least the first 7 characters of the current head SHA
  • FAIL — Behavior and intent has no substantive answer
  • FAIL — Validation and unverified scope has no substantive answer
  • FAIL — PR-specific question has no substantive answer
  • FAIL — changed op test not explained in Changed op tests: op_tests/test_gemm_group32_interface.py
  • FAIL — Changed op tests must explain why each changed op test is necessary and non-redundant

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

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.

🟡 Changes recommended

Unresolved split-tail stride handling and workspace descriptor overflow can corrupt outputs or leave partial results unwritten.

5 open issues
What changed in this PR

This PR targets gfx950 MXFP8 GEMM performance for DSv4.1 workloads through FlyDSL kernel optimizations and updated model-specific tuning.

Changes:

  • Adds split-K processing for partial final waves, with FP32 workspace reduction into strided outputs.
  • Optimizes eight-wave output stores and epilogue synchronization.
  • Expands BMM swizzle candidates, updates tuned selections, and adds regression tests.
File Description
op_tests/​test_gemm_group32_interface.py Adds tail-split and swizzle-candidate tests.
aiter/​ops/​flydsl/​mxscale_preshuffle_kernels.py Updates reducer calls with output-stride arguments.
aiter/​ops/​flydsl/​kernels/​mxfp8_gemm_8wave.py Adds split-K workspace stores and optimizes the epilogue.
aiter/​ops/​flydsl/​kernels/​gemm/​mxscale_preshuffle.py Supports reduction into strided outputs.
aiter/​ops/​flydsl/​gemm_tune/​flydsl_gemm_mxscale_preshuffle_common.py Adds eligible eight-wave tail-split tuning candidates.
aiter/​ops/​flydsl/​gemm_a8w8_mxfp8_8wave.py Implements tail-split orchestration and strided-output handling.
aiter/​ops/​flydsl/​batched_gemm_a8w8_gfx950.py Expands the BMM swizzle tuning search.
aiter/​configs/​model_configs/​dsv41_a8w8_blockscale_mxscale_bpreshuffle_tuned_gemm.csv Updates DSv4.1 kernel selections and recorded timings.

Review effort: Balanced

Comment thread op_tests/test_gemm_group32_interface.py Resolved
Copilot AI balanced review requested due to automatic review settings November 20, 2026 01:16

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.

🟡 Changes recommended

Critical stride-handling defects can corrupt split-tail outputs and drop single-row output columns, while default CI does not execute the new regression tests.

6 open issues

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 20, 2026 03:04

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

The bounds check rejects valid strided outputs, new regression tests are not executed by default CI, and several tuning replacements record slower latencies.

No open issues 🎉

2 previously missed issues

In code that hasn't changed since last review

Medium severity Validate strided output size separately from logical dimensions

aiter/​ops/​flydsl/​gemm_a8w8_mxfp8_8wave.py:256

_validate also checks N * K, so passing the output row stride as N rejects valid strided outputs even when every buffer fits. For example, M=2, N=256, K=8192 and Out stride (262144, 1) need only 524800 output bytes and 2097152 weight bytes, but ldc * K == 2**31 causes a ValueError. Keep logical N for the input bounds and check M * ldc * 2 separately for the output descriptor.

Medium severity Use elementwise FP32 tolerances for the regression comparison

op_tests/​test_gemm_group32_interface.py:838

This new FlyDSL regression uses the local _assert_matches comparator, whose absolute tolerance is 0.01 * ref.abs().max(). With the widely varying E8M0 scales generated here, the largest output sets the allowance for every tail element, weakening detection of incorrect scales or missing writes in smaller-magnitude outputs. Use the required checkAllclose comparison in FP32 with justified elementwise tolerances, and assert that its returned mismatch ratio is zero.

6 resolved since last review

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 20, 2026 07:10

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.

🟡 Changes recommended

The changes reject valid padded outputs, select kernels with worse recorded latencies, and add regression tests that CI does not execute.

2 open issues

Review effort: Balanced

Comment on lines +255 to 256
N=ldc,
)
name = make_mxfp8_8wave_kernel_name(2, 4, n_split)
row = {"libtype": "flydsl", "kernelId": "mxfp8", "kernelName": name}
monkeypatch.setattr(gemm_op_a8w8, "get_mxscale_bpreshuffle_config", lambda *a: row)
_assert_matches(*_mxscale_gemm_vs_dequant(m, n, k, 32))
@valarLip
valarLip merged commit 1ff8c8f into main Nov 20, 2026
@valarLip
valarLip deleted the gfx950/dsv41-flydsl-mxfp8 branch November 20, 2026 12:55
coderfeli added a commit that referenced this pull request Nov 20, 2026
Conflicts in the two launchers main changed under #8296:
- mxscale_preshuffle_kernels: the split-K reduce gained row_dw/ldc_dw
  and a strided Constexpr; _bound_reduce_exe binds strided and takes the
  new runtime arguments, and its cache key includes strided.
- gemm_a8w8_mxfp8_8wave: the launcher gained ldc and Out may be a
  column slice; the tail split's K-split GEMM and strided reduce go
  through the AOT caches like the unsplit launch.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
iraj465 added a commit to iraj465/aiter that referenced this pull request Nov 24, 2026
Measured again on main 82b6b4f (after ROCm#8296 reworked the FlyDSL MXFP8
kernels, with FlyDSL 0.5.3) on an MI355X and an MI350X. The 186 rows from
M = 48 keep their gain on both. Of the 18 rows for M up to 32, nine no
longer reach 1.03x over the kernel the heuristic picks on both devices, one
of them (N = 6400, M = 16) is slower on both. Those nine now name that
kernel, with the values the tuner profiled for it, as the rows for M = 32 at
N = 12800 and 3200 already do. The rows stay because vLLM routes these
layers to AITER only when a row exists at M = 1 and at M = 8192.

Signed-off-by: Saptarshi Majumder <[email protected]>
yifehuan pushed a commit that referenced this pull request Nov 26, 2026
… and 3200 (K = 6144) (#8159)

* [Config] Add gfx950 DeepSeek-V4.1 MXFP8 GEMM rows for N = 12800, 6400 and 3200 (K = 6144)

Add 204 gfx950 rows (cu_num 256, w_scale_block 32x32) for N = 12800, 6400
and 3200 at K = 6144 to
aiter/configs/model_configs/dsv41_a8w8_blockscale_mxscale_bpreshuffle_tuned_gemm.csv,
at the 68 M values the table already uses. These N are N = 25600 / P for
P = 2, 4 and 8: the per-rank shards, in vLLM under tensor parallel without
sequence parallelism, of the N = 25600, K = 6144 weight the table already
tunes. They had no row. A direct gemm_a8w8_blockscale_bpreshuffle call ran
the FlyDSL batched-GEMM heuristic, and vLLM kept its own Triton GEMM for
these layers, because it routes a 32x32 layer to AITER only when rows exist
at M = 1 and M = 8192.

Rows only. No existing row changes.

Signed-off-by: Saptarshi Majumder <[email protected]>

* Nine decode rows now name the kernel main's heuristic picks

Measured again on main 82b6b4f (after #8296 reworked the FlyDSL MXFP8
kernels, with FlyDSL 0.5.3) on an MI355X and an MI350X. The 186 rows from
M = 48 keep their gain on both. Of the 18 rows for M up to 32, nine no
longer reach 1.03x over the kernel the heuristic picks on both devices, one
of them (N = 6400, M = 16) is slower on both. Those nine now name that
kernel, with the values the tuner profiled for it, as the rows for M = 32 at
N = 12800 and 3200 already do. The rows stay because vLLM routes these
layers to AITER only when a row exists at M = 1 and at M = 8192.

Signed-off-by: Saptarshi Majumder <[email protected]>

---------

Signed-off-by: Saptarshi Majumder <[email protected]>
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.

5 participants