[gfx950][FlyDSL] Add dense BF16 x MXFP4 GEMM - #4772
Draft
LiuYinfeng01 wants to merge 1 commit into
Draft
Conversation
Contributor
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
|
LiuYinfeng01
force-pushed
the
feat/flydsl-gemm-a16wfp4-gfx950
branch
from
August 15, 2026 02:17
e32145f to
f45dc11
Compare
Fuse MXFP4 weight decode with BF16 MFMA so emulation preserves Quark activation semantics without caching a full BF16 weight.
LiuYinfeng01
force-pushed
the
feat/flydsl-gemm-a16wfp4-gfx950
branch
2 times, most recently
from
August 15, 2026 16:33
e489b19 to
7c880d2
Compare
LiuYinfeng01
force-pushed
the
feat/flydsl-gemm-a16wfp4-gfx950
branch
from
August 16, 2026 02:37
7c880d2 to
e489b19
Compare
This was referenced Aug 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a gfx950 FlyDSL dense GEMM for BF16 activations and packed MXFP4 weights.
This is the fused MXFP4 weight-dequant + BF16 GEMM path used to preserve emulation semantics. Direct A4W4 is intentionally out of scope and will be proposed separately.
Accuracy
Reference: canonical MXFP4 weight decode to BF16 followed by BF16
F.linearon the original activation. Deterministic random packed weights, E8M0 scale0x7f, M=128.The existing Triton path requantizes arbitrary BF16 activations to MXFP4, while this kernel preserves BF16 activation semantics. When activations already lie on the MXFP4 grid, all paths are exactly equal to the reference.
Latency
MI355X (gfx950), PyTorch
2.11.0+gitd0c8b1f, HIP7.2.53211, FlyDSL0.3.0. Weight preparation and JIT compilation excluded.This PR was 1.75x-4.86x faster than the faster existing AITER Triton path across the measured Kimi-K3 TP2 shapes.
Packed weights plus scales use 73.44% less storage than cached BF16 weights. Warmed launches with preallocated output add zero bytes of peak PyTorch allocation.
Validation
13 passed:op_tests/flydsl_tests/test_flydsl_gemm_a16wfp4.pyF.linearpy_compile, andgit diff --checkScope