[ROCm][DSV4][Perf] Use FP8 WO_A output projection - #54894
Open
LiuYinfeng01 wants to merge 1 commit into
Open
Conversation
Signed-off-by: Liuyinfeng01 <yinfeliu@amd.com>
LiuYinfeng01
force-pushed
the
rocm-dsv4-fp8-woa-mxscale
branch
from
September 2, 2026 05:29
c9628e5 to
a9cf3bc
Compare
LiuYinfeng01
marked this pull request as ready for review
September 2, 2026 07:47
LiuYinfeng01
requested review from
AndreasKaratzas,
dllehr-amd,
hongxiayang,
tjtanaa and
zyongye
as code owners
September 2, 2026 07:47
LiuYinfeng01
marked this pull request as draft
September 2, 2026 07:53
Collaborator
|
please do a full 1319 gsm8k test, current result seems to be lower than the baseline. We expect the full test score near 0.96 |
LiuYinfeng01
marked this pull request as ready for review
September 3, 2026 02:01
Contributor
Author
|
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
Replace the ROCm DeepSeek V4 BF16
wo_aoutput-projection path on gfx950 with:inverse_rope_group_quant, which fuses inverse RoPE with per-tokenE8M0 group quantization.
batched_gemm_a8w8_mxscale, which consumes the quantized activationand the checkpoint's native FP8
wo_aweight.This removes the BF16 grouped einsum and keeps
wo_ain its checkpoint FP8form. Unsupported weights, scales, devices, and older AITER installations
retain the existing BF16 fallback.
Dependency
This fast path requires AITER >= 0.1.20, which added the MX-scale batched GEMM.
It therefore depends on #52826. Current
mainremains safe: the capabilityprobe logs once and falls back to BF16 when the op is unavailable.
Implementation
VLLM_ROCM_USE_AITER_FP8BMMgate and restrict the path togfx950.
float8_e8m0fnu/uint8scales, or losslessly convert positivepower-of-two FP32 scales to biased E8M0 exponent bytes.
rocm_inv_rope_einsumpath as the fallback.Performance
Measured on 8 x MI355X, TP1/PP8, one 100,000-token prefill request, 8K prefill
chunks, prefix caching disabled, three runs:
wo_aDelta: TTFT -7.35% and input throughput +7.93%.
TP8/PP1 prefill concurrency
Measured on 8 x MI355X with TP8/PP1, fixed 8,192-token prompts and one output
token, prefix caching disabled, and 10 requests per concurrency slot. Both arms
use the same image and differ only in the FP8
wo_agate.wo_atotal tok/swo_atotal tok/sAll 1,110 requests in each arm completed without errors.
Revisions and runtime:
a9cf3bc3498eb71bb2d6f5d44c4b0049b62feb7asha256:cef549da00e0efaeadd9338ac8f351f2b96ff71a5ab8651a99bf989458bf1684a6d2b564fd671724a3720b8edf70e8d674e4d6940.3.1sha256:0f851f268bc6bdb41c5ed22663a106339b3b269a88afbef17dbda156f2fb7893Triton sparse prefill, 8K max batched tokens, no prefix cache
VLLM_ROCM_USE_AITER_FP8BMM=0/1The enabled-arm logs load
module_inverse_rope_group_quantandopus_bmm_a8w8_mxscale; neither appears in the disabled-arm logs.TP1/PP8 prefill concurrency
Measured with the same fixed 8,192-token prompts, one output token, disabled
prefix caching, and 10 requests per concurrency slot. The image, revisions,
runtime settings, and A/B gate are identical to the TP8/PP1 measurements above;
only the topology changes to TP1/PP8.
wo_atotal tok/swo_atotal tok/sAll 1,110 requests in each arm completed without errors. The enabled-arm logs
load
module_inverse_rope_group_quantandopus_bmm_a8w8_mxscaleon all eightpipeline stages; neither appears in the disabled-arm logs.
Correctness
Greedy GSM8K, zero invalid responses:
TP8/PP1 GSM8K
Topology-matched greedy 5-shot evaluation on the TP8 stack above:
wo_awo_aThe FP8 candidate first passed the 100-question gate at 93/100 with zero
invalid responses. Full-set accuracy was +0.99 percentage points versus the
topology-matched BF16 reference; one response did not contain a parseable
answer.
Validation
git diff --check: passedtests/models/test_deepseek_v4_rocm_wo_a.py: 7 passedRelated work
#45103 fused inverse RoPE and cached a BF16
wo_a; this PR retains that path asfallback and uses the native FP8 weight on supported gfx950 configurations.
AI assistance
Cursor assisted with implementation, testing, benchmark analysis, and drafting.
The human submitter reviewed the resulting change and is responsible for it.
Re-measurement on the older
DeepSeek-V4-ProcheckpointSetup
vllm/vllm-openai-rocm:nightly-d9105ea8001e0a6d77a96327d17515bb5791fb360.28.1rc1.dev472+gd9105ea80+ this PR applied tovllm/models/deepseek_v4/amd/rocm.pyDeepSeek-V4-Pro(older snapshot), FP4VLLM_ROCM_USE_AITER_FP8BMM=0vs=1, same image and same patched fileAITER_CONFIG_GEMM_A8W8_BLOCKSCALEpointed at a merged a8w8-blockscale tuning tableFast-path confirmation: the enabled arm's server log loads
module_inverse_rope_group_quantand themxscaleBMM; the disabled arm's logcontains neither (verified per run).
TP8/PP1 prefill concurrency
wo_atotal tok/swo_atotal tok/sMean gain across the sweep: +1.29%. All 1,110 requests per arm completed successfully.
TP1/PP8 prefill concurrency
wo_atotal tok/swo_atotal tok/sMean gain across the sweep: +6.09%. All 1,110 requests per arm completed successfully.
TP1/PP8 single 100,000-token prefill
Three runs per arm, 8K prefill chunks, prefix caching disabled. The first run of
each arm carries a cold-start spike (~13.8 s on both arms) and is excluded from
the median.
wo_awo_aDelta: TTFT -2.89%, input throughput +2.98%.
GSM8K (full 1,319, greedy, 5-shot)
Addresses the request for a full-set run. Both arms use the same image, the same
patched file, and the same topology (TP8/PP1, DP attention, FP8 KV cache); only
the gate differs.
wo_awo_aThe FP8 arm scores 0.9651, i.e. above the 0.96 bar, and +0.30 pp
(flexible-extract) over the topology-matched BF16 reference on this checkpoint.
Both arms exited 0 with zero invalid responses.
Summary on this checkpoint
The direction and magnitude match the 0813 numbers above: a small gain at
TP8/PP1 and a larger one at TP1/PP8, with accuracy at or above the BF16
reference.