Skip to content

[sglang-miles] Cherry-pick #24462: fix /pause_generation for --tokenizer-worker-num > 1 - #24769

Merged
ByronHsu merged 1 commit into
sglang-milesfrom
byron/cp-24462-to-sglang-miles
May 9, 2026
Merged

ByronHsu merged 1 commit into
sglang-milesfrom
byron/cp-24462-to-sglang-miles

Conversation

@ByronHsu

@ByronHsu ByronHsu commented May 9, 2026

Copy link
Copy Markdown
Collaborator

Motivation

Cherry-pick of #24462 onto sglang-miles.

Without this fix, /pause_generation and /continue_generation only mutate the is_pause flag on the single TokenizerWorker whose 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 7deed98e1 cleanly on top of sglang-miles:

  • TokenizerWorkerRegistration and PauseContinueBroadcast IPC messages in io_struct.py.
  • Worker-registration step in MultiTokenizerRouter that tracks every tokenizer worker's IPC name on startup.
  • Pause/continue handling in the router that broadcasts PauseContinueBroadcast to all registered workers (and still forwards the original request to the scheduler for non-abort modes).
  • New TokenizerWorker.pause_generation / continue_generation methods that send the request to the router and await an asyncio.Future resolved by the broadcast handler — so the HTTP response only returns after the pause state has propagated.

Checklist

  • Format your code according to the Code Formatting with Pre-Commit.
  • For reviewers: if you intend to acknowledge my contribution, please do so by including Co-authored-by: bingyuhsu <byronhsu1230@gmail.com> in the commit message after the PR is merged.

…r-worker-num > 1 (#24462)

Co-authored-by: lawrence-harmonic <185285563+lawrence-harmonic@users.noreply.github.com>
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@ByronHsu
ByronHsu merged commit e4d81e1 into sglang-miles May 9, 2026
2 checks passed
@ByronHsu
ByronHsu deleted the byron/cp-24462-to-sglang-miles branch May 9, 2026 05:45
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