Repository navigation
[Qwen3.8] Cherry pick qsa decode to qwen4_v0.5.21 - #96
Merged
Merged
Conversation
* [AMD] Add opt-in paged GQA sparse attention for Qwen3.8 decode Adapt the paged sparse GQA kernel and token-based split-K scheduling from ROCm/ATOM#2311 to SGLang token-slot caches and MTP query metadata. Keep legacy as the default and provide an explicit pr2311 opt-in with compatibility fallback. Add gfx942 correctness, masking, layout, dispatch and graph-replay coverage. No ATOM dependency or AITER source change. * [AMD] Enable automatic QSA paged GQA dispatch Remove SGLANG_QSA_SPARSE_IMPL and automatically select direct paged GQA for compatible gfx942 BF16 QSA decode and MTP verification inputs. Retain HIP-only lazy imports and compatibility fallback. The attention kernel, split-K scheduling, and reduction code are unchanged. Validate TP2 on MI308X with MTP off/on at concurrency 1, 4, and 32, including mixed lengths, logprobs, and traces on both TP ranks. All 117 kernel/regression tests and eight validation checks pass. Across 16 formal performance runs (512 requests), QPS differs by less than 0.33% from the original manually enabled implementation rerun under matched conditions. MTP c4 mean TTFT decreases 12.740%, while mean TPOT increases 2.961%; this is not an across-the-board latency improvement. GSM8K scores are 1279/1319 without MTP and 1280/1319 with MTP, each one question below the corresponding current legacy control (-0.0758 pp). All 5276 evaluation requests succeed. Against the historical PR40 manually enabled runs, each new score is two questions lower; those cross-date comparisons do not isolate the effect of automatic dispatch. Signed-off-by: madhang <[email protected]> --------- Signed-off-by: madhang <[email protected]> Co-authored-by: root <root> (cherry picked from commit ebc1afd)
Collaborator
|
hi @apinge could you clarify the source PR in comments, thanks |
Owner
Author
Thanks for the reminder. I've updated the comments. |
yicyang
approved these changes
Nov 9, 2026
sammysun0711
approved these changes
Nov 9, 2026
sammysun0711
left a comment
Collaborator
There was a problem hiding this comment.
Mainly focus on Qwen3.8 QSA decode perf (Mean TPOT) optimization (decreased by 21.9% w/o MTP and 9.8% w/ MTP, respectively), Qwen3.5 CI test data is variation run-to-run.
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
This PR is to cherry pick qsa decode #40 to
qwen4_v0.5.21. The feature is default on for qwen3.8 flash next.Modifications
Accuracy Tests
Speed Tests and Profiling
Comparison of before and after for this pr.
Qwen3.8 Flash TP2 output throughput improved by 21.4% without MTP and 7.9% with MTP, while mean TPOT decreased by 21.9% and 9.8%, respectively. The four Qwen3.5 Base/DFlash cases remained roughly flat in output throughput, with changes ranging from -2.8% to +4.3%.
All 6/6 model cases and the CPU validation job passed in the after run. Each case evaluated 200 GSM8K examples and passed the accuracy gate allowing at most a 3% relative drop from its recorded reference.
Checklist
Review and Merge Process
/tag-and-rerun-ci,/tag-run-ci-label,/rerun-failed-ci