Repository navigation
[Perf] [AMD] dsv4: optional e8m0 mxscale GEMM for dense 128x128 fp8 linears (6/8) - #44007
Merged
Merged
Conversation
… 128x128 fp8 linears SGLANG_DSV4_DENSE_MXSCALE=1 (default off) routes the DeepSeek-V4 dense block-fp8 linears (wqkv_a, wq_b, wo_b, indexer wq_b, DSpark main_proj, ...) on gfx950 from the fp32-scale CK/asm/triton bpreshuffle GEMM to aiter's e8m0 mxscale bpreshuffle GEMM (flydsl, dsv4 mxscale tuned rows). - load: the (16,16)-preshuffled weight is shared; whitelisted (N, K) (SGLANG_DSV4_DENSE_MXSCALE_SHAPES, default = shapes that win in the cold-weight microbench) get an e8m0 copy of their power-of-two 128x128 scale (N*K/16384 bytes); non-power-of-two scales stay on fp32. - activations: ue8m0 per-1x128 quant (aiter per_group_quant_hip) inside the linear; the fused input_norm / q_norm producers switch to a Triton RMSNorm + ue8m0 quant kernel when every consumer runs the e8m0 GEMM, so no extra launch is added. - fp32-scaled operands still take the fp32 GEMM; an e8m0 operand into a linear without an e8m0 scale raises.
Older aiter (e.g. the current e7d2453f pin) has no e8m0 dispatch in gemm_a8w8_blockscale_bpreshuffle and silently treats the e8m0 bytes as fp32 scales. set_dense_mxscale() now keeps the fp32-scale GEMM with a warning when the installed aiter lacks get_mxscale_bpreshuffle_config, and the unit test skips there.
kkHuang-amd
requested review from
Alisehen,
AniZpZ,
BBuf,
DarkSharpness,
Edwardf0t1,
FlamingoPg,
Fridge003,
HaiShaw,
HydraQYH,
OrangeRedeng,
b8zhong,
celve,
ch-wan,
fzyzcjy,
ispobock,
mmangkad and
yuan-luo
as code owners
October 13, 2026 07:45
5 tasks
4 of 5 tasks
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.
Motivation
DeepSeek-V4's dense block-fp8 weight scales are powers of two, so the dense linears can run on aiter's e8m0 mxscale bpreshuffle GEMM on gfx950, which is faster than the fp32-scale GEMM for a set of shapes.
Depends on: ROCm/aiter#5896 (in aiter main, needs the aiter pin bump in #44035).
Modifications
SGLANG_DSV4_DENSE_MXSCALE, default off;SGLANG_DSV4_DENSE_MXSCALE_SHAPES, default built-in list).Accuracy Tests
GSM8K: main 0.953 -> 0.951 with
SGLANG_DSV4_DENSE_MXSCALE=1(aiter 02575f1c3a).Speed Tests and Profiling
8K in / 1K out, DP8 attention + EAGLE, median ITL off -> on: c16 6.78 -> 6.68 ms (-1.5%), c64 9.80 -> 9.16 ms (-6.5%). Output throughput is within run-to-run noise (about 5%).
Co-authored-by: @AMD-yanfeiwang
Checklist
Review and Merge Process
/tag-and-rerun-ci,/tag-run-ci-label,/rerun-failed-ciCI States
Latest PR Test (Base): ⏳ Run #38880154756
Latest PR Test (Extra): ⏳ Run #38880154341
Latest PR Test (AMD ROCm 10): ⏳ Run #38880154739