[sglang-miles] Cherry-pick #24462: fix /pause_generation for --tokenizer-worker-num > 1 - #24769
Merged
Merged
Conversation
…r-worker-num > 1 (#24462) Co-authored-by: lawrence-harmonic <185285563+lawrence-harmonic@users.noreply.github.com>
ByronHsu
requested review from
Ying1123,
hnyls2002,
merrymercy and
xiezhq-hermann
as code owners
May 9, 2026 05:35
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
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
Cherry-pick of #24462 onto
sglang-miles.Without this fix,
/pause_generationand/continue_generationonly mutate theis_pauseflag on the singleTokenizerWorkerwhose uvicorn process happens to receive the HTTP request, leaving the other tokenizer workers free to keep dispatching new generation requests during weight transfer. This silently breaks RL weight updates whenever--tokenizer-worker-num > 1.Modifications
Applies
7deed98e1cleanly on top ofsglang-miles:TokenizerWorkerRegistrationandPauseContinueBroadcastIPC messages inio_struct.py.MultiTokenizerRouterthat tracks every tokenizer worker's IPC name on startup.PauseContinueBroadcastto all registered workers (and still forwards the original request to the scheduler for non-abort modes).TokenizerWorker.pause_generation/continue_generationmethods that send the request to the router andawaitanasyncio.Futureresolved by the broadcast handler — so the HTTP response only returns after the pause state has propagated.Checklist
Co-authored-by: bingyuhsu <byronhsu1230@gmail.com>in the commit message after the PR is merged.