Skip to content

[Qwen3.8] Cherry pick qsa decode to qwen4_v0.5.21 - #96

Merged
sammysun0711 merged 2 commits into
qwen4_v0.5.21from
cherry-pick-qsa-decode
Nov 9, 2026
Merged

sammysun0711 merged 2 commits into
qwen4_v0.5.21from
cherry-pick-qsa-decode

Conversation

@apinge

@apinge apinge commented Nov 9, 2026 •

Copy link
Copy Markdown
Owner

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.

Case GSM8K (before → after) Output tokens/s (before → after) Throughput change Mean TPOT, ms (before → after) TPOT change
Qwen3.8-Flash-TP2-Base 98.00% → 97.50% 87.327 → 105.973 +21.4% 9.250 → 7.225 -21.9%
Qwen3.8-Flash-TP2-MTP 99.00% → 98.50% 107.608 → 116.061 +7.9% 6.922 → 6.246 -9.8%
Qwen3.5-35B-TP4-Base 97.50% → 98.50% 230.996 → 224.619 -2.8% 3.996 → 4.117 +3.0%
Qwen3.5-35B-TP1-DFlash 98.00% → 97.00% 285.911 → 294.170 +2.9% 2.831 → 2.729 -3.6%
Qwen3.5-397B-TP8-Base 99.00% → 99.50% 145.457 → 147.161 +1.2% 6.168 → 6.097 -1.2%
Qwen3.5-397B-TP8-DFlash 98.50% → 99.50% 267.264 → 278.710 +4.3% 2.999 → 2.849 -5.0%

Checklist

Review and Merge Process

  1. Ping Merge Oncalls to start the process. See the PR Merge Process.
  2. Get approvals from CODEOWNERS and other reviewers.
  3. Trigger CI tests with comments or contact authorized users to do so.
    • Common commands include /tag-and-rerun-ci, /tag-run-ci-label, /rerun-failed-ci
  4. After green CI and required approvals, ask Merge Oncalls or people with Write permission to merge the PR.

madhang and others added 2 commits November 9, 2026 05:22
* [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)
@apinge
apinge marked this pull request as ready for review November 9, 2026 06:06
@apinge apinge mentioned this pull request Nov 9, 2026
@yicyang

yicyang commented Nov 9, 2026 •

Copy link
Copy Markdown
Collaborator

hi @apinge could you clarify the source PR in comments, thanks

@apinge

apinge commented Nov 9, 2026

Copy link
Copy Markdown
Owner Author

hi @apinge could you clarify the source PR in comments, thanks

Thanks for the reminder. I've updated the comments.

@sammysun0711 sammysun0711 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@sammysun0711
sammysun0711 merged commit 483fea6 into qwen4_v0.5.21 Nov 9, 2026
14 of 23 checks passed
@apinge
apinge deleted the cherry-pick-qsa-decode branch November 19, 2026 02:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants