Repository navigation
[Kernel][DSv4.1] Add batched MXFP8 GEMM with fused MXFP8 output on MI355X - #7
Merged
benenzhu merged 2 commits intoNov 20, 2026
Merged
Conversation
DeepSeek-V4.1's grouped wo_a (B x 1024 x 4096, 32x32 E8M0 weight blocks) writes bf16 that only wo_b reads, and wo_b quantizes it to MXFP8 in a separate launch. mxfp8_bmm_mxfp8_out does both in one launch: AITER's gfx950 FlyDSL batched GEMM main loop (single split, scaled 16x16x128 MFMAs in ascending K), with the bf16 store replaced by an MXFP8 quant of the LDS-staged bf16 tile (quad DPP amax, integer E8M0 byte, v_cvt_scalef32_pk_fp8_f32). Codes and scales equal AITER's FlyDSL batched GEMM + the Triton MXFP8 quantizer bit for bit, and AITER's tuned dispatch except on fp32-subnormal outputs, which its OPUS kernels flush. Tiles follow AITER's tuned FlyDSL rows; the entry warms every config up on its first call. Graph replay on one MI355X, 8 groups: -1.8 us at M 1 to -52.7 us at M 16384 against the AITER GEMM + vLLM quantizer pair. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Signed-off-by: shen-shanshan <[email protected]>
Member
|
wait for #5, mx gemm host.py need some change for upstream to vLLM |
Conflict in amd_kernels/README.md only: main's index (Inferact#5's TP2 packages, Inferact#9's shape folders) with this PR's gemm/mxfp8_bmm_mxfp8_out_n1024_k4096 line after the dense MLP gate_up lines. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Taoyu Zhu <[email protected]>
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.
Overview
On MI355X, vLLM runs DeepSeek-V4.1's grouped
wo_a(8 groups of 1024 x 4096 at attention TP1, 32x32 E8M0 weight blocks) on AITER'sbatched_gemm_a8w8_mxscale_bpreshuffle. That GEMM writes bf16, andwo_bthen quantizes the bf16 output to MXFP8 in a separate launch.This PR adds
gemm/mxfp8_bmm_mxfp8_out_n1024_k4096. Its entrymxfp8_bmm_mxfp8_outreturnswo_b's MXFP8 input directly, as row-major e4m3 codes and E8M0 scales, in one launch.v_cvt_scalef32_pk_fp8_f32.Numerics
Results
Kernel (one MI355X, graph replay, 8 groups, µs per call)
The baseline is AITER
batched_gemm_a8w8_mxscale_bpreshuffle+ vLLM_mxfp8_e4m3_quantize_triton.mxfp8_bmm_mxfp8_outvLLM end to end (DeepSeek-V4.1-Flash, 2x MI355X, DEP2,
vllm bench forward, ms per step)wo_b's output are bit-exact against the current vLLM path.Tests
python3 -m pytest tests/gemm/mxfp8_bmm_mxfp8_out_n1024_k4096 -q # 72 passed python3 benchmarks/gemm/mxfp8_bmm_mxfp8_out_n1024_k4096/benchmark_mxfp8_bmm_mxfp8_out.pyThe tests cover:
🤖 Generated with Claude Code