Skip to content

fix(grpc): drop stale WatchLoadUpdateReq piggyback, bump sglang floor to 0.5.13 - #1850

Merged
slin1237 merged 2 commits into
smg-project:mainfrom
StarDuster:fix/grpc-sglang-watch-load-update
Jun 28, 2026
Merged

slin1237 merged 2 commits into
smg-project:mainfrom
StarDuster:fix/grpc-sglang-watch-load-update

Conversation

@junliu-mde

@junliu-mde junliu-mde commented Jun 27, 2026 •

Copy link
Copy Markdown
Contributor

Description

Problem

sglang PR sgl-project/sglang#28408 (released in v0.5.14) removed WatchLoadUpdateReq from sglang.srt.managers.io_struct and the .load piggyback field from BatchTokenIDOutput / BatchStrOutput.

smg-grpc-servicer's gRPC request manager still imported WatchLoadUpdateReq and forwarded batch_out.load to the scheduler on the output streaming hot path. As a result, importing smg_grpc_servicer.sglang against sglang ≥ 0.5.14 fails at import time:

ImportError: cannot import name 'WatchLoadUpdateReq' from 'sglang.srt.managers.io_struct'

This makes gRPC mode entirely unusable on sglang 0.5.14+ — reported in sgl-project/sglang#28408 (comment); @ShangmingCai confirmed the interface is deprecated and the fix belongs in smg (comment).

Solution

Drop the stale piggyback path and align the supported sglang range with the shared-memory load-snapshot era.

The piggyback was the DP load feed only on the pre-shmem releases; on every release smg will support after this PR it is dead code:

sglang release piggyback present shmem load snapshots (#26348) DP load source
0.5.10 – 0.5.12 yes no piggyback (only feed)
0.5.13 / .post1 yes yes shmem (piggyback has no consumer)
0.5.14+ removed yes shmem

DP load balancing is unaffected on supported releases: both ends of the shmem link live inside sglang, which smg launches unchanged — the writer is scheduler.py (load_snapshot_writer), the reader is data_parallel_controller.py (load_snapshot_reader.read_all()). smg's request_manager only replaces TokenizerManager and was never on the load path once shmem landed. /v1/loads (smg's get_loads) keeps working on 0.5.13+ via the GetLoadsReqInput request/response path the scheduler still serves (scheduler.py handle_get_loads_req), which I verified remains present in v0.5.14.

Changes

  • request_manager.py: remove the WatchLoadUpdateReq import and the dead load-forwarding block in _handle_batch_output.
  • pyproject.toml: bump sglang floor 0.5.10 → 0.5.13.

Test Plan

  • ruff check + ruff format --check on changed file — pass.
  • python -m pytest grpc_servicer/tests — 20 passed, 6 skipped.
  • Against sglang 0.5.14: import smg_grpc_servicer.sglang.request_manager now imports cleanly (was ImportError).
  • Against sglang 0.5.13 with dp_size>1, load-balance-method: total_tokens: DP balancing still distributes across ranks (shmem, no regression).
Checklist
  • ruff check / ruff format --check pass on changed Python (no Rust changes in this PR)
  • python -m pytest grpc_servicer/tests passes (20 passed, 6 skipped)
  • Conventional commit + DCO sign-off, no AI attribution
  • (Optional) Documentation updated — N/A (dependency-floor + dead-code removal)

Refs: sgl-project/sglang#28408

@github-actions github-actions Bot added dependencies Dependency updates grpc gRPC client and router changes labels Jun 27, 2026
@coderabbitai

coderabbitai Bot commented Jun 27, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@junliu-mde, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 48 minutes and 6 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 5621a2a7-9d77-4f58-9570-ef76f37c0e56

📥 Commits

Reviewing files that changed from the base of the PR and between 64230cf and 5a26d32.

📒 Files selected for processing (1)
  • grpc_servicer/pyproject.toml
📝 Walkthrough

Walkthrough

The sglang extra minimum version was raised to 0.5.13, and the gRPC request manager no longer forwards per-batch DataParallel load updates to the scheduler.

Changes

Sglang dependency and load path

Layer / File(s) Summary
Dependency floor update
grpc_servicer/pyproject.toml
The sglang optional dependency now requires sglang>=0.5.13, and the surrounding comments were updated to describe the shared-memory snapshot behavior.
Batch output load forwarding removed
grpc_servicer/smg_grpc_servicer/sglang/request_manager.py
WatchLoadUpdateReq is removed from imports, and _handle_batch_output no longer sends DP load updates before queueing outputs.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • lightseekorg/smg#1064: Also updates grpc_servicer/pyproject.toml by raising the minimum sglang version in the sglang optional dependency.

Suggested reviewers

  • CatherineSue
  • slin1237
  • gongwei-130
  • XinyueZhang369

Poem

A bunny hopped through the gRPC glen,
With load notes tucked away again.
sglang rose bright,
The queues danced light,
And hush went the scheduler pen. 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely matches the main change: removing the stale WatchLoadUpdateReq path and raising the sglang minimum version.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates the minimum required version of sglang to 0.5.13 in pyproject.toml and removes the deprecated WatchLoadUpdateReq import and load-forwarding logic from request_manager.py. This change aligns with newer sglang releases that utilize shared-memory load snapshots for data-parallel balancing. I have no feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

… to 0.5.13

sglang #28408 (released in v0.5.14) removed WatchLoadUpdateReq and the
BatchTokenIDOutput.load / BatchStrOutput.load piggyback fields. smg's
gRPC request manager still imported WatchLoadUpdateReq and forwarded
batch_out.load on the output streaming hot path, so importing
smg_grpc_servicer.sglang against sglang>=0.5.14 fails with
ImportError: cannot import name 'WatchLoadUpdateReq' from
'sglang.srt.managers.io_struct' -- making gRPC mode unusable.

The piggyback path is dead code on every release smg still supports:
  - 0.5.13+ : DataParallelController reads load from shared-memory
    snapshots (#26348) and no longer registers a WatchLoadUpdateReq
    handler, so the forwarded message has no consumer.
  - 0.5.10-0.5.12 : piggyback was the only DPBudget feed, but those
    releases predate shmem and smg no longer supports them (see below).

DP load balancing is unaffected on supported releases: both the shmem
writer (scheduler.py) and reader (data_parallel_controller.py) live in
sglang, which smg launches unchanged; the request_manager only replaces
TokenizerManager and was never on the load path once shmem landed.

Bump the optional sglang dependency floor 0.5.10 -> 0.5.13 so the
supported range matches the shmem era and the removed piggyback path is
not silently missed. /v1/loads (smg's get_loads) keeps working on 0.5.13+
via the GetLoadsReqInput request/response path that scheduler still
serves.

Refs: sgl-project/sglang#28408
Signed-off-by: Jun Liu <jun.c.liu@rakuten.com>
@junliu-mde
junliu-mde force-pushed the fix/grpc-sglang-watch-load-update branch from 0e39075 to 64230cf Compare June 27, 2026 06:09

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5a26d323c0

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

sglang = ["sglang>=0.5.10"]
# 0.5.13 is the first release with the shmem load snapshots that replaced
# the WatchLoadUpdateReq piggyback path (removed upstream in v0.5.14).
sglang = ["sglang>=0.5.13"]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Enforce the SGLang floor outside extras

This dependency floor only applies when users install smg-grpc-servicer[sglang]; the repo's source install paths still install grpc_servicer/ without that extra after SGLang is already present (for example scripts/ci_install_sglang.sh pins sglang[all]==0.5.12.post1, and scripts/installation/install-smg.sh force-reinstalls the servicer source into engine images). In those environments, dp_size>1 with total_tokens/total_requests still needs the WatchLoadUpdateReq feed that was removed, because pre-0.5.13 SGLang's data-parallel controller consumes only that request rather than shmem snapshots, so the new code silently runs with stale DP load state instead of enforcing the unsupported version.

Useful? React with 👍 / 👎.

@junliu-mde junliu-mde Jun 27, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Looks it's better to bump sglang version in CI?

@ShangmingCai ShangmingCai left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thank you for the fix. The change looks good to me.

@slin1237
slin1237 merged commit 7019d7e into smg-project:main Jun 28, 2026
40 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request Jul 27, 2026
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Dependency updates grpc gRPC client and router changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants