[AMD] Fix DeepSeek V4 MTP accuracy issue - #30333
Merged
Merged
Conversation
At1a8
requested review from
Ying1123,
alphabetc1,
hanming-lu,
hnyls2002,
hzh0425,
ispobock,
merrymercy,
xiezhq-hermann and
yizhang2077
as code owners
July 7, 2026 03:58
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
Contributor
Author
|
/rerun-failed-ci |
HaiShaw
approved these changes
Jul 7, 2026
5 tasks
This was referenced Jul 11, 2026
Chronostasys
pushed a commit
to MindLab-Research/sglang
that referenced
this pull request
Aug 24, 2026
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
After PR #28612, C128 state became request-scoped instead of SWA-slot-scoped. On cold server startup, only the sentinel row was initialized, while normal request-scoped C128 rows could still contain
torch.empty()garbage. MTP target-verify writes draft-token C128 states based on the committed request state, so an uninitialized committed row can corrupt draft verification and cause first-run GSM8K accuracy drops which metioned in #30238 (comment).Modifications
kv_score_bufferto the empty-state sentinel during pool creation. Keep the existing last-row-only initialization for C4 to avoid unnecessary behavior changes.is_hipguard so the change only applies on AMD/ROCm platforms and remains a no-op on other platforms.Accuracy Tests
root@smci355-ccs-aus-n12-13:/sgl-workspace/sglang# python3 /sgl-workspace/sglang/benchmark/gsm8k/bench_sglang.py --port 8000 --num-questions 1319
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1319/1319 [01:09<00:00, 19.07it/s]
Accuracy: 0.952
Invalid: 0.000
Latency: 69.184 s
Output throughput: 1712.156 token/s
Speed Tests and Profiling
This PR has almost no impact on performance.
Server cmd
Client cmd
Checklist
Review and Merge Process
/tag-and-rerun-ci,/tag-run-ci-label,/rerun-failed-ciCI States
Latest PR Test (Base): ⏳ Run #28840802173
Latest PR Test (Extra): ❌ Run #28840802089