Skip to content

[cherrypick from #41235] [PD] Keep the sampling mask of a replayed rebootstrap token - #41271

Merged
yueming-yuan merged 3 commits into
sgl-project:sglang-milesfrom
nanjiangwill:cherrypick-41235-sglang-miles
Sep 26, 2026
Merged

yueming-yuan merged 3 commits into
sgl-project:sglang-milesfrom
nanjiangwill:cherrypick-41235-sglang-miles

Conversation

@nanjiangwill

@nanjiangwill nanjiangwill commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Port #41235 to the sglang-miles branch.

This is stacked on #41270 (the #40986 port), because the fix applies to the decode-side block that #40986 introduces. Only the last commit is this change.

After a decode-side retract, a PD rebootstrap replays the request's already-emitted boundary token, for example after pause_generation(mode="retract") around weight updates. The decode worker skipped re-committing that token's logprob, but it still appended the prefill worker's fresh sampling-mask row. Each such request then returned one more row than output tokens.

The fix skips the sampling mask on a replayed boundary, as the logprob path already does, so the token keeps its original row.

Port notes

Testing


CI States

Latest PR Test (Base): ❌ Run #36246207751
Latest PR Test (Extra): ❌ Run #36246207579
Latest PR Test (AMD ROCm 10): ❌ Run #36246207739

nanjiangwill and others added 2 commits September 25, 2026 19:33
…ect#41235)

After a decode-side retract, a PD rebootstrap replays the request's
already-emitted boundary token. The decode worker skipped re-committing that
token's logprob but still appended the prefill worker's fresh sampling-mask
row. Each such request then returned one more row than output tokens. Skip
the sampling mask the same way, so the token keeps its original row.
@yueming-yuan
yueming-yuan merged commit 571212b into sgl-project:sglang-miles Sep 26, 2026
78 of 87 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants