Repository navigation
[FlyDSL][gfx950] Optimize FP4 MQA prefill and decode - #5707
Draft
jiacao-amd wants to merge 7 commits into
Draft
jiacao-amd wants to merge 7 commits into
jiacao-amd wants to merge 7 commits into
Conversation
Contributor
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
PR title tags & labels: |
jiacao-amd
force-pushed
the
jiacao/fp4-prefill-4wave
branch
3 times, most recently
from
September 20, 2026 23:33
c7af86a to
6b301d2
Compare
jiacao-amd
force-pushed
the
jiacao/fp4-prefill-4wave
branch
from
September 20, 2026 23:46
6b301d2 to
f6bf06e
Compare
Signed-off-by: jiacao-amd <jiahui.cao@amd.com>
jiacao-amd
force-pushed
the
jiacao/fp4-prefill-4wave
branch
6 times, most recently
from
September 21, 2026 06:49
cd969cc to
db82535
Compare
Signed-off-by: jiacao-amd <jiahui.cao@amd.com>
jiacao-amd
force-pushed
the
jiacao/fp4-prefill-4wave
branch
from
September 21, 2026 07:13
db82535 to
3ab6dfc
Compare
Signed-off-by: jiacao-amd <jiahui.cao@amd.com>
This branch has not been deployed
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
pa_mqa_logits_fp4_prefill.pynext_n, with cooperative head waves and no decode-to-prefill routingDependency
Depends on #5518. This branch should be rebased onto the updated
mainafter #5518 merges so it inherits the corresponding page-stride, 64-bit addressing, and page128 support without duplicating that dependency's history here.Implementation
Prefill
32x32x64FP4 MFMADecode
The decode kernel now handles all
next_nvalues directly:block_kandnum_warpsFor the ordinary
next_n=1/2direct shapes, each CTA owns one token chunk. Extra LDS stages therefore do not form a cross-chunk pipeline, andnext_ndoes not itself create additional waves. Their improvement comes from exposing more grid-level parallelism with 32/64-token tiles and bypassing KV LDS staging; head waves only parallelize the head reduction.Performance
Measured on MI355X using median GPU kernel time. Decode results use nine paired CUDA Graph rounds with identical inputs and randomized Old/New execution order. Unless noted otherwise, rows use H64, D128, page64, and ragged context lengths averaging approximately half of
max_ctx.Prefill
B x Q x KV)Decode
Here, Old is the original 256-token/4-wave MXFP4 decode configuration and New is the production configuration selected by the current dispatcher.
B x next_n x max_ctx)The first ten general decode rows have a 1.311x geometric-mean paired speedup. Compared with the original MXFP4 timings published in the first PR table, the current New timings are 1.432x faster geometrically. The AgentX/DSv4 MTP4 row contains 32 requests and 128 total query rows.
Validation
git diff --checkpassesnext_n1/2/3/4/5/8; H16-H128; D128/D256; page64/page128; zero and ragged contexts; strided pages/output; and CUDA Graph replay