Skip to content

[FlyDSL] [gfx950] flydsl batched mxfp8 GEMM: optional fused mxfp8 quant epilogue - #8101

Merged
valarLip merged 4 commits into
mainfrom
gfx950/bmm-fused-mxfp8-quant
Nov 19, 2026
Merged

valarLip merged 4 commits into
mainfrom
gfx950/bmm-fused-mxfp8-quant

Conversation

@solinzby1

Copy link
Copy Markdown
Contributor

Summary

Motivation

Changes

Performance (if applicable)

Hardware Workload/configuration Before After Change

Testing

  • Unit tests added or updated
  • Performance benchmarks run
  • Tested on MI250X
  • Tested on MI300X

Documentation

  • Docstrings updated
  • User guide updated
  • Performance guide updated
  • No documentation change is needed, with the reason stated below

Dependencies

  • No new third-party dependencies added
  • New dependencies are listed and justified below

Breaking Changes

PR Self-Review

Reviewed revision

Behavior and intent

Validation and unverified scope

PR-specific question

Changed op tests

@solinzby1
solinzby1 requested review from a team and a balanced review from Copilot November 17, 2026 11:23
@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 8101 --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 17, 2026 •

Copy link
Copy Markdown

WAITING ON AUTHOR

PR Self-Review

Revision a7f2759e3919 · 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. What behavior would each changed op test fail on before this PR, and why is that coverage not already provided by an existing canonical test?
  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 — 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_bmm_a8w8_fused_quant_supported.py
  • FAIL — changed op test not explained in Changed op tests: op_tests/test_flydsl_batched_gemm.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.

@solinzby1

Copy link
Copy Markdown
Contributor Author
B M N K Before (us) After (us) Change
1 1 1024 4096 5.72 5.18 +10.4%
1 32 1024 4096 7.26 6.00 +21.1%
1 128 1024 4096 8.04 8.00 +0.6% ¹
1 288 1024 4096 9.74 7.77 +25.4%
1 512 1024 4096 10.81 8.65 +24.9%
1 768 1024 4096 13.33 10.90 +22.4%
1 1024 1024 4096 13.37 11.34 +17.9%
1 1536 1024 4096 15.82 13.32 +18.8%
1 2048 1024 4096 17.50 14.76 +18.6%
1 4096 1024 4096 24.70 21.20 +16.5%
1 16384 1024 4096 70.40 63.16 +11.5%
2 1 1024 4096 6.79 5.23 +29.9%
2 32 1024 4096 7.72 6.50 +18.9%
2 128 1024 4096 10.04 10.10 -0.5% ¹
2 288 1024 4096 12.68 10.39 +22.0%
2 512 1024 4096 13.57 11.44 +18.6%
2 768 1024 4096 16.93 14.30 +18.4%
2 1024 1024 4096 18.21 15.28 +19.2%
2 1536 1024 4096 21.87 18.47 +18.4%
2 2048 1024 4096 25.56 22.02 +16.1%
2 4096 1024 4096 39.74 34.38 +15.6%
2 16384 1024 4096 136.29 121.24 +12.4%
4 1 1024 4096 7.34 5.60 +31.2%
4 32 1024 4096 9.89 9.88 +0.1% ¹
4 128 1024 4096 11.64 9.60 +21.2%
4 288 1024 4096 15.89 13.51 +17.6%
4 512 1024 4096 18.64 15.40 +21.0%
4 768 1024 4096 22.72 19.46 +16.8%
4 1024 1024 4096 27.30 23.32 +17.0%
4 1536 1024 4096 34.51 29.40 +17.4%
4 2048 1024 4096 42.42 35.55 +19.3%
4 4096 1024 4096 73.22 64.94 +12.7%
4 16384 1024 4096 287.15 265.22 +8.3%
8 1 1024 4096 9.05 7.36 +23.0%
8 32 1024 4096 11.99 10.98 +9.2%
8 128 1024 4096 15.61 13.08 +19.3%
8 288 1024 4096 24.25 19.61 +23.7%
8 512 1024 4096 29.00 22.07 +31.4%
8 768 1024 4096 36.22 30.98 +16.9%
8 1024 1024 4096 42.68 37.23 +14.6%
8 1536 1024 4096 57.65 51.34 +12.3%
8 2048 1024 4096 77.72 70.15 +10.8%
8 4096 1024 4096 146.98 132.51 +10.9%
8 16384 1024 4096 577.78 510.61 +13.2%
16 1 1024 4096 13.93 12.31 +13.1%
16 32 1024 4096 17.08 14.89 +14.7%
16 128 1024 4096 22.87 19.59 +16.8%
16 288 1024 4096 36.19 31.06 +16.5%
16 512 1024 4096 44.28 40.93 +8.2%
16 768 1024 4096 60.14 53.51 +12.4%
16 1024 1024 4096 80.13 70.84 +13.1%
16 1536 1024 4096 107.51 97.98 +9.7%
16 2048 1024 4096 158.57 138.36 +14.6%
16 4096 1024 4096 305.39 267.05 +14.4%
16 16384 1024 4096 1125.98 1057.36 +6.5%

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 critical defects can violate the bit-identical quantization contract and allow invalid GPU memory accesses through an output scale buffer on the wrong device.

4 open issues
What changed in this PR

Adds optional fused MXFP8 output quantization to the gfx950 FlyDSL batched GEMM, extending the existing gfx1250 capability through the shared batched-GEMM API.

Changes:

  • Adds an epilogue that writes FP8 output and group-32 scale bytes.
  • Adds gfx950 kernel selection and a BF16-plus-quant fallback for selected tuned configurations.
  • Extends fused-output checks and architecture-support tests to gfx950.
File Description
op_tests/​test_flydsl_batched_gemm.py Extends fused quantization checks to gfx950.
op_tests/​test_bmm_a8w8_fused_quant_supported.py Checks gfx950 support across weight-scale blocks.
aiter/​ops/​flydsl/​kernels/​bmm_a8w8_mxscale_gfx950.py Implements the fused quantization epilogue.
aiter/​ops/​flydsl/​batched_gemm_a8w8.py Advertises gfx950 fused quantization support.
aiter/​ops/​flydsl/​batched_gemm_a8w8_gfx950.py Adds scale-output handling and unsplit kernel selection.
aiter/​ops/​batched_gemm_op_a8w8.py Connects tuned-row selection and fallback to the public API.

Review effort: Balanced

Comment thread aiter/ops/batched_gemm_op_a8w8.py Resolved
Copilot AI balanced review requested due to automatic review settings November 17, 2026 11:42

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 gfx950 path advertises support for shapes it cannot execute, misses legal unsplit kernel variants, and lacks public-wrapper tests covering fused and fallback routes.

2 open issues
2 previously missed issues

In code that hasn't changed since last review

Medium severity Align gfx950 support predicate with fused-output shape restrictions

aiter/​ops/​flydsl/​batched_gemm_a8w8.py:82

Enabling gfx950 here also makes the public shape-level batched_gemm_a8w8_mxscale_bpreshuffle_fused_quant_supported((2, 16, 128), 16, 4096) return True, but the new runner rejects that N=16 shape with RuntimeError because it requires N % 32 == 0. Callers using the advertised support check therefore select a path that cannot run instead of retaining BF16 GEMM plus standalone quantization. Please make the shape-level predicate enforce the gfx950 fused-output restriction, and have unsupported calls raise NotImplementedError consistently with the public fallback contract.

Medium severity Exercise tuned-row and split-K fallback through the public wrapper

op_tests/​test_flydsl_batched_gemm.py:518

The gfx950 test calls the backend runner directly, bypassing batched_gemm_a8w8_mxscale_bpreshuffle_fused_quant. Consequently, the new tuned-row lookup and the split-K bf16 + HIP-quant fallback are never exercised; reverting that public-wrapper logic would leave these checks passing. Please extend the existing public-op tests with pinned fused-eligible and fallback tuned rows, and compare both the FP8 codes and E8M0 scales against the corresponding bf16-plus-quant reference.

2 resolved since last review

Review effort: Balanced

@solinzby1
solinzby1 requested review from coderfeli and yadaish and a balanced review from Copilot November 17, 2026 11:50

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 gfx950 support predicate accepts N=16 even though the fused runner rejects it with RuntimeError, bypassing callers’ expected fallback handling.

1 open issue
2 resolved since last review

Review effort: Balanced

Comment on lines +80 to +82
return entry[:2] == _GFX1250_MX32 or (
entry[:2] == _GFX950 and not x_scale_transposed
)
@solinzby1
solinzby1 force-pushed the gfx950/bmm-fused-mxfp8-quant branch from a105498 to 8a8d33e Compare November 18, 2026 12:18
Copilot AI balanced review requested due to automatic review settings November 18, 2026 12:18

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 selector rejects valid shapes because its fallback retains LDS-heavy scale preloading, while the added tests leave the public wrapper’s tuned-row selection and bf16-plus-quant fallback untested.

2 open issues

Review effort: Balanced

Comment on lines +487 to +491
kernel_name = _fused_quant_tuned_kernel(g, m, n, k, w_scale_block, gfx, cu_num)
if kernel_name is not None and gfx == "gfx950":
from .flydsl.batched_gemm_a8w8_gfx950 import _fused_quant_falls_back

if _fused_quant_falls_back(kernel_name):
@solinzby1

Copy link
Copy Markdown
Contributor Author

@copilot resolve the merge conflicts in this pull request

…8-quant

# Conflicts:
#	op_tests/test_flydsl_batched_gemm.py

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Copilot AI balanced review requested due to automatic review settings November 19, 2026 05:16

Copilot AI commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts in this pull request

Merged main and resolved the conflict in op_tests/test_flydsl_batched_gemm.py, preserving both branches’ test coverage details. Merge commit: a7f2759e.

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 fallback retries an LDS-incompatible tile instead of finding valid unsplit variants, rejecting supported fused shapes, while public dispatch and fallback behavior lack end-to-end coverage.

3 open issues

Review effort: Balanced

Comment on lines +518 to +519
run_ref = functools.partial(bmm.run_bmm_a8w8_mxfp8_gfx950, kernel_name=tile)
run_fused = bmm.run_bmm_a8w8_mxfp8_gfx950
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