Repository navigation
[ROCm][Perf][Qwen3.8] Add dense mono decode for Qwen3.8-27B on MI355X. - #61573
Open
abrahamzewoudie wants to merge 2 commits into
Open
abrahamzewoudie wants to merge 2 commits into
abrahamzewoudie wants to merge 2 commits into
Conversation
abrahamzewoudie
requested review from
AndreasKaratzas,
DarkLight1337,
Harry-Chen,
dllehr-amd,
hongxiayang,
khluu,
tjtanaa,
vadiklyutiy and
ywang96
as code owners
October 14, 2026 06:18
Contributor
|
This pull request has merge conflicts that must be resolved before it can be |
Contributor
Author
|
@AndreasKaratzas @tjtanaa @dllehr-amd @hongxiayang @vadiklyutiy @DarkLight1337 @ywang96 can you please have a look at my PR. |
6 tasks done
This was referenced Oct 30, 2026
Co-authored-by: Cursor <cursoragent@cursor.com>
6 tasks done
6 tasks done
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.
Overview
Opt-in FlyDSL decode for
amd/Qwen3.8-27B-Quark-AWQ-MXFP4(qwen3_5_text, TP1 or TP2, gfx950). SetVLLM_ROCM_MONO_DECODE=1. The K1 and K2 kernels are adapted from SGLang #43558. This pull request is their vLLM integration and the TP1 and TP2 dispatch. The MoE mono decode for the larger Qwen3.8 is #60833.Claims
On a pure decode inside the row cap, K1 replaces the linear-attention mixer and K2 replaces the MXFP4 feed-forward. Norms, full attention, and the tensor-parallel all-reduces stay outside those launches.
8k input / 1k output,
sglang.bench_serving, random dataset. A positive percent is an improvement: more output tokens per second, or a lower median TTFT, ITL, or TPOT. The TP1 cells set both row caps to 8. TP2 uses the default cap of 8.Validation
TP1 serving image:
nightly-aiter-5350-5669-5598-flydsl-qr4970-gdn57560-dense-mono-layer-graphs. TP2 serving image:nightly-aiter-5350-5669-5598-flydsl-qr4970-gdn57560-aiter6218-dense-mono-layer-graphs-tp2-split. The non-mono arm is the same stack on...-gdn57560-aiter6218.DenseFfnTestchecks K2 against the stock MXFP4 GEMM, Gemma norm, and SiLU-mul, including the TP2 down partial before the all-reduce.DenseGdnTestchecks K1 against the stock conv update, gated delta rule, and RMSNormGated, including pad rows and the TP2out_projpartial.RowCapsTest,StockAccumulationTest,StockSplitTest, andStockChainTestcheck the row caps and that K2 follows the stock GEMM's split-K order. The Buildkite jobqwen38-27b-dense-mono-numerics-amdruns this file on one MI355.GPQA Diamond, thinking on, 32 threads, 198 questions. NIAH is RULER
niah_single_2. MMMU ismmmu_val, 900 questions, seed 4321.TP2 GPQA mean answer length is 43,452 characters versus 41,440 for non-mono (165/198 versus 163/198). An earlier TP2 build that wrapped the stock modules scored 0.1818 on the same eval.
Concurrency 16 and above (stock graph)
Details
A step enters the mono graph only when it is a pure decode (
num_prefills == 0, at least one decode row, no spec-decode mask) and the row count is inside the kernel build. The builds cover 1–8 rows at TP1 and 1–16 rows at TP2. Serving defaults are narrower: K1 and K2 each default to 4 rows at TP1 and 8 rows at TP2. Override either cap withVLLM_ROCM_QWEN38_DENSE_MONO_K1_MAX_ROWSorVLLM_ROCM_QWEN38_DENSE_MONO_K2_MAX_ROWS. A value outside 1..8 at TP1 or 1..16 at TP2 is clamped and a warning is logged.TP1 compiles one whole-step graph and folds the norms into K1 and K2. TP2 compiles a split graph: stock norms and the full-attention block stay visible, and each rank's K1 and K2 partial is all-reduced after the launch.
VLLM_ROCM_QWEN38_DENSE_MONO_OPROJ(default on) foldsout_projinto the TP1 graph and into the TP2 K1 partial.VLLM_ROCM_QWEN38_DENSE_MONO_K2(default on) selects the K2 launch on the TP2 graph.The flag applies only to
qwen3_5_text. A set flag on a deployment these kernels cannot run raises and lists the reason: TP other than 1 or 2, a GPU other than gfx950, pipeline parallel, LoRA, a KV connector, sequence parallel, speculative tokens, or a shape or quant method other than this Quark MXFP4 27B dense MLP.Full write-up:
vllm/models/qwen3_5/amd/mono/README.md.Pull Request Checklist
I used vLLM's
/pr-checklistskill. (Mandatory for agents, optional for humans).AI assistance was used during the creation of this PR.
Design Fit: Minimizes impact on core components, reuses existing functionality, and justifies added complexity.
Testing and Validation: Validates the change and ensures any added tests are meaningful and reliable, with CI coverage or documented CI resource constraints and validation performed outside CI.
Code Quality and Style: Keeps code and comments clear and concise, and updates relevant documentation and examples.
Pull Request Contents: Includes a brief summary and relevant links, supports claims with evidence, explains root causes and implementation trade-offs, and follows the contributing guide.