Skip to content

chore(deps): bump SGLang to 0.5.16 - #1970

Merged
slin1237 merged 1 commit into
mainfrom
chore/bump-sglang-0-5-16
Jul 28, 2026
Merged

slin1237 merged 1 commit into
mainfrom
chore/bump-sglang-0-5-16

Conversation

@slin1237

@slin1237 slin1237 commented Jul 27, 2026 •

Copy link
Copy Markdown
Member

Description

Problem

CI and release images pin SGLang 0.5.12.post1; upstream is at 0.5.16. Two of our installer workarounds were explicitly waiting on a release that has now shipped — and 0.5.16 makes two breaking changes the gRPC servicer was built on: it removes the legacy get_loads IPC (sglang#30525), which the first e2e run surfaced as every gRPC worker dying at import, and it rewrites the scheduler IPC structs as kw-only msgspec Structs, which the second e2e run surfaced as warmup requests failing construction (Missing required argument 'input_embeds').

Solution

  • scripts/ci_install_sglang.sh: sglang[all]==0.5.16. Dropped two now-obsolete workarounds, both confirmed against the 0.5.16 wheel metadata: the forced nvidia-cutlass-dsl-libs-cu13==4.5.2 reinstall (0.5.16 pins nvidia-cutlass-dsl[cu13]==4.6.0, which carries the cutlass#3259 fix the comment was waiting for) and the kernels>=0.14.1,<0.15 band pin (0.5.16 pins kernels<0.15,>=0.14.1 itself). Torch stays 2.11.0/CUDA-13, so the nvcc-13 setup is unchanged.
  • Mooncake bumped to mooncake-transfer-engine-cuda13==0.3.11.post1, tracking upstream v0.5.16 CI (scripts/ci/cuda/ci_install_dependency.sh); tracking links updated.
  • release-sglang-docker.yml: base image matrix/defaults/examples → lmsysorg/sglang:v0.5.16 (tag verified on Docker Hub).
  • gRPC servicer ported to LoadSnapshot: schedulers now publish per-dp-rank snapshots (SHM, zmq for multi-node DP) unconditionally, so the request manager creates a create_load_snapshot_reader(..., caller="TokenizerManager") and get_loads reads published snapshots instead of round-tripping GetLoadsReqInput/Output through a communicator. LoadSnapshot carries the identical fields the proto conversion already reads, so GetLoads RPC wire behavior is unchanged; include-section filtering (previously scheduler-side) now happens in the manager with the same validation error. The get_loads_communicator is removed (including from the public communicator set — the 0.5.16 HTTP sidecar's /v1/loads uses snapshot readers too). Reader is closed on shutdown.
  • gRPC servicer ported to the msgspec IPC structs: TokenizedGenerateReqInput construction now passes the newly required input_embeds/token_type_ids; TokenizedEmbeddingReqInput's image_inputs is renamed mm_inputs; the scheduler consumes mm_inputs via MultimodalInputs.from_processor_output(...), so _parse_mm_inputs returns a MultimodalProcessorOutput instead of a pre-built MultimodalInputs; slotted structs reject undeclared attributes, so the EPD encode hook sets the real need_wait_for_mm_inputs field (need_wait_for_image was never declared — the old assignment was a silent no-op that msgspec turns into an AttributeError); and Req now concatenates origin_input_ids with array("q") output ids, making the array token-id contract mandatory — to_token_id_array always emits array("q") and its legacy-list env toggle (SGLANG_GRPC_TOKEN_ID_ARRAY) is removed. Additionally, 0.5.16's SamplingParams.normalize rejects string stop sequences when called without a tokenizer. The scheduler matches stop strings with its own tokenizer (skip_tokenizer_init is never set in this deployment), so the servicer now loads the model tokenizer exactly as sglang's TokenizerManager does and passes it to normalize — engine-side early stopping and finish_reason="stop" semantics are preserved (and stop_str_max_len is now computed in real tokens rather than the tokenizer-less character approximation); and ProfileReq.type is renamed req_type. Wire format is unaffected: 0.5.16 defaults to pickle IPC (SGLANG_USE_PICKLE_IPC=True), matching the manager's existing send_pyobj.
  • grpc_servicer's sglang extra floor rises to >=0.5.16 (the old IPC no longer exists, and the previous >=0.5.13 floor was above what CI installed anyway).

Breaking change

smg-grpc-servicer now requires SGLang >= 0.5.16 and no longer runs against older engines; upgrade SGLang and the servicer together (pip enforces the floor). Suggested release-note entry:

⚠️ Breaking change: smg-grpc-servicer now requires SGLang >= 0.5.16. SGLang 0.5.16 removed the legacy get_loads IPC and rewrote scheduler IPC structs as msgspec Structs; the servicer now reads scheduler-published LoadSnapshots and speaks the new struct contract. Older servicer releases will not start on SGLang 0.5.16+, and this servicer will not install against SGLang < 0.5.16 — upgrade both together.

Test Plan

  • Real validation is the e2e matrix on this PR: sglang legs across 1-GPU chat/completions/embeddings/responses and 2-GPU PD (incl. mooncake KV transfer).
  • Locally: bash -n clean; 0.5.16 wheel metadata verified for the dropped workarounds; v0.5.16 image tag verified; grpc_servicer python suite green after the port (77 passed, 3 skipped); every TokenizedGenerateReqInput/TokenizedEmbeddingReqInput construction site statically checked against the 0.5.16 wheel's struct definitions (no missing required fields, no unknown kwargs).
Checklist
  • cargo +nightly fmt passes
  • cargo clippy --all-targets --all-features -- -D warnings passes
  • (Optional) Documentation updated
  • (Optional) Please join us on Slack #sig-smg to discuss, review, and merge PRs

Summary by CodeRabbit

  • Enhancements
    • Upgraded SGLang-based builds and CI installs to SGLang 0.5.16.
    • Updated the related Mooncake CUDA 13 transfer engine package versions.
    • Refreshed published Docker image tag examples to match the new baseline.
  • Bug Fixes / Improvements
    • Updated load-metrics reporting to rely on scheduler-published snapshots, improving consistency with the /v1/loads behavior.
    • Updated the GetLoads endpoint documentation and response mapping accordingly.

@github-actions github-actions Bot added the ci CI/CD configuration changes label Jul 27, 2026
@coderabbitai

coderabbitai Bot commented Jul 27, 2026 •

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The PR upgrades SGLang Docker and CI versions to 0.5.16, updates Mooncake, migrates gRPC load retrieval to scheduler-published LoadSnapshot data, and aligns request, profiling, sampling, multimodal, and token ID representations.

Changes

SGLang version update

Layer / File(s) Summary
Docker release defaults and installation pins
.github/workflows/release-sglang-docker.yml, grpc_servicer/pyproject.toml, scripts/ci_install_sglang.sh
Updates SGLang references to 0.5.16, retargets Mooncake, and removes older installation workarounds while preserving manual image overrides.

LoadSnapshot migration

Layer / File(s) Summary
Snapshot reader lifecycle and API
grpc_servicer/smg_grpc_servicer/sglang/request_manager.py
Replaces load communicator handling with snapshot reader initialization, filtering, section selection, and shutdown cleanup.
LoadSnapshot protobuf conversion
grpc_servicer/smg_grpc_servicer/sglang/servicer.py
Converts LoadSnapshot values and documents scheduler-published load data for GetLoads.

gRPC request compatibility

Layer / File(s) Summary
Multimodal request shapes
grpc_servicer/smg_grpc_servicer/sglang/servicer.py
Updates health-check, generation, embedding, and disaggregation request fields and changes multimodal parsing to MultimodalProcessorOutput.
Protocol field alignment
grpc_servicer/smg_grpc_servicer/sglang/servicer.py
Updates profiling request construction and removes scheduler-rejected stop-string conversion.
Token ID array contract
grpc_servicer/smg_grpc_servicer/sglang/utils.py, grpc_servicer/tests/test_token_id_array.py
Always converts token IDs to array("q"), removes the environment-controlled legacy path, and updates concatenation tests.

Estimated code review effort: 3 (Moderate) | ~30 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant GetLoads
  participant GrpcRequestManager
  participant LoadSnapshotReader
  Client->>GetLoads: request load sections and optional dp_rank
  GetLoads->>GrpcRequestManager: get_loads(include, dp_rank)
  GrpcRequestManager->>LoadSnapshotReader: read_all()
  LoadSnapshotReader-->>GrpcRequestManager: LoadSnapshot list
  GrpcRequestManager-->>GetLoads: filtered snapshots
  GetLoads-->>Client: protobuf load response
Loading

Possibly related PRs

Suggested labels: docker

Suggested reviewers: catherinesue, key4ng

Poem

A rabbit hops where snapshots glow,
New SGLang pins now neatly flow.
Old workarounds leave the tray,
Mooncake sails a newer way.
“Binky!” says CI, “all green today.”

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 81.82% which is sufficient. The required threshold is 80.00%.
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.
Title check ✅ Passed The title clearly summarizes the main change: bumping SGLang to version 0.5.16.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/bump-sglang-0-5-16

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

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@claude claude 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.

Clean dependency bump — version strings are consistent, removed workarounds are confirmed fixed upstream in 0.5.16, and mooncake tracks the upstream CI pin. No issues found.

Note: the PR description is missing the ## Changes header per the template (see comment).

@slin1237
slin1237 force-pushed the chore/bump-sglang-0-5-16 branch from 029c09d to 5af047b Compare July 27, 2026 21:33
@github-actions github-actions Bot added dependencies Dependency updates grpc gRPC client and router changes labels Jul 27, 2026
Comment on lines 34 to +36
# 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"]
sglang = ["sglang>=0.5.16"]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Nit: The comment still explains the old >=0.5.13 floor (shmem load snapshots replacing WatchLoadUpdateReq), but the floor is now >=0.5.16 because the GetLoadsReqInput/Output IPC was removed upstream. Consider updating the comment to reflect the current reason.

Suggested change
# 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"]
sglang = ["sglang>=0.5.16"]
# 0.5.16 removed the GetLoadsReqInput/Output IPC the servicer previously
# used; the port to LoadSnapshot snapshot readers requires this floor.
sglang = ["sglang>=0.5.16"]

@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: 5af047bfa1

ℹ️ 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".


def _convert_loads_to_protobuf(
result: GetLoadsReqOutput,
result: LoadSnapshot,

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 Use the new disaggregation snapshot field

Now that result is a LoadSnapshot, the disaggregation branch below still reads result.disaggregation.prefill_prealloc_queue_reqs. In SGLang 0.5.16 the snapshot's DisaggregationMetrics exposes prefill_bootstrap_queue_reqs instead, so any GetLoads request that includes disaggregation metrics (the default all does) will raise AttributeError and return an INTERNAL error instead of load data whenever PD/disaggregation metrics are present.

Useful? React with 👍 / 👎.

@slin1237
slin1237 force-pushed the chore/bump-sglang-0-5-16 branch from 5af047b to c99cbf4 Compare July 27, 2026 21:40
@claude

claude Bot commented Jul 27, 2026

Copy link
Copy Markdown

👋 The PR description doesn't fully follow
PULL_REQUEST_TEMPLATE.md:

  • Missing header: ## Changes

Please update the PR description so reviewers have the context they need.

@slin1237
slin1237 force-pushed the chore/bump-sglang-0-5-16 branch from c99cbf4 to b06f4bc Compare July 27, 2026 22:11
@github-actions github-actions Bot added the tests Test changes label Jul 27, 2026
@slin1237
slin1237 force-pushed the chore/bump-sglang-0-5-16 branch 2 times, most recently from c28ce8c to 2a8afcf Compare July 27, 2026 22:11

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@grpc_servicer/smg_grpc_servicer/sglang/servicer.py`:
- Around line 100-101: Update the LoadSnapshot-to-SchedulerLoad mapping in the
surrounding servicer method to read the disaggregation requests from
result.prefill_bootstrap_queue_reqs instead of
result.prefill_prealloc_queue_reqs. Preserve the existing response construction
and other field mappings.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 1b6f08e6-98bf-4ba3-a1c0-fadb7676f392

📥 Commits

Reviewing files that changed from the base of the PR and between 5af047b and 2a8afcf.

📒 Files selected for processing (7)
  • .github/workflows/release-sglang-docker.yml
  • grpc_servicer/pyproject.toml
  • grpc_servicer/smg_grpc_servicer/sglang/request_manager.py
  • grpc_servicer/smg_grpc_servicer/sglang/servicer.py
  • grpc_servicer/smg_grpc_servicer/sglang/utils.py
  • grpc_servicer/tests/test_token_id_array.py
  • scripts/ci_install_sglang.sh

Comment on lines +100 to 101
result: LoadSnapshot,
) -> sglang_scheduler_pb2.SchedulerLoad:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

rg -n "prefill_(prealloc|bootstrap)_queue_reqs" \
  grpc_servicer/smg_grpc_servicer/sglang/servicer.py

curl -fsSL \
  https://raw.githubusercontent.com/sgl-project/sglang/v0.5.16/python/sglang/srt/managers/load_snapshot.py |
  rg -n "prefill_(prealloc|bootstrap)_queue_reqs"

Repository: lightseekorg/smg

Length of output: 299


🏁 Script executed:

sed -n '140,160p' grpc_servicer/smg_grpc_servicer/sglang/servicer.py

Repository: lightseekorg/smg

Length of output: 1231


Use prefill_bootstrap_queue_reqs here — result.disaggregation is mapped with prefill_prealloc_queue_reqs, but SGLang v0.5.16 exposes prefill_bootstrap_queue_reqs on LoadSnapshot. Disaggregation responses will fail with AttributeError until this field name is updated.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@grpc_servicer/smg_grpc_servicer/sglang/servicer.py` around lines 100 - 101,
Update the LoadSnapshot-to-SchedulerLoad mapping in the surrounding servicer
method to read the disaggregation requests from
result.prefill_bootstrap_queue_reqs instead of
result.prefill_prealloc_queue_reqs. Preserve the existing response construction
and other field mappings.

@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: 2a8afcfc39

ℹ️ 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".

Comment on lines +930 to 931
tokenized_req.need_wait_for_mm_inputs = bool(encode_req.need_wait_for_mm_inputs)
tokenized_req.num_items_assigned = encode_req.num_items_assigned

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 Preserve encoder URL snapshots for EPD gRPC requests

When encoder disaggregation uses the gRPC servicer with dynamic encoder URLs, SGLang 0.5.16 freezes the selected encoder list on encode_req.encoder_urls, and the scheduler later indexes num_items_assigned against tokenized_req.encoder_urls (falling back to the current list only for legacy callers). This copy only forwards the wait flag and assignment counts, so if an encoder registers or unregisters between dispatch and scheduler processing, the counts can be applied to a different URL ordering, sending image shards to the wrong or missing encoders and causing the request to fail or wait until timeout. Copy encode_req.encoder_urls onto tokenized_req here as well.

Useful? React with 👍 / 👎.

@slin1237
slin1237 force-pushed the chore/bump-sglang-0-5-16 branch 3 times, most recently from c1487d4 to 74a2c53 Compare July 27, 2026 23:40
0.5.16 pins kernels<0.15 and nvidia-cutlass-dsl 4.6.0 itself, so the CI
kernels band pin and the cutlass#3259 forced reinstall are dropped.
Mooncake follows upstream 0.5.16 CI to 0.3.11.post1; release-docker base
images move to lmsysorg/sglang:v0.5.16.

0.5.16 also drops the legacy get_loads IPC (sglang#30525), so the gRPC
servicer's load bridge is ported to the published LoadSnapshot reader:
the request manager reads per-dp-rank snapshots (TokenizerManager role)
instead of round-tripping GetLoadsReq through a communicator, include-
section filtering moves gateway-side, and the sglang extra floor rises
to >=0.5.16.

0.5.16 further rewrites the IPC structs as kw-only msgspec Structs:
input_embeds and token_type_ids become required on
TokenizedGenerateReqInput, TokenizedEmbeddingReqInput renames
image_inputs to mm_inputs, the scheduler consumes mm_inputs via
MultimodalInputs.from_processor_output (so the servicer now hands it a
MultimodalProcessorOutput), slotted structs reject undeclared attributes
(need_wait_for_image was never a real field; the EPD hook now sets
need_wait_for_mm_inputs), and Req concatenates origin_input_ids with
array("q") output_ids, making the array token-id contract mandatory —
to_token_id_array always emits array("q") and its legacy-list env toggle
is removed. 0.5.16's SamplingParams.normalize also rejects string
stop sequences when called without a tokenizer; the scheduler matches
them with its own tokenizer (skip_tokenizer_init is never set here), so
the servicer now loads the model tokenizer exactly as TokenizerManager
does and passes it to normalize instead of tokenizer=None. ProfileReq's type field is renamed
req_type.

Signed-off-by: Simo Lin <25425177+slin1237@users.noreply.github.com>
@slin1237
slin1237 force-pushed the chore/bump-sglang-0-5-16 branch from 74a2c53 to 05c0cfd Compare July 27, 2026 23:40

def _convert_loads_to_protobuf(
result: GetLoadsReqOutput,
result: LoadSnapshot,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔴 Important: The type changed from GetLoadsReqOutput → LoadSnapshot, but the disaggregation mapping below (line 152) still reads result.disaggregation.prefill_prealloc_queue_reqs. SGLang 0.5.16 renamed this field to prefill_bootstrap_queue_reqs on DisaggregationMetrics. Any GetLoads request that includes disaggregation metrics will raise AttributeError.

Fix on line 152:

prefill_prealloc_queue_reqs=result.disaggregation.prefill_bootstrap_queue_reqs,

@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: 05c0cfdacc

ℹ️ 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".

fail-fast: false
matrix:
base_image: ${{ github.event_name == 'push' && fromJSON('["lmsysorg/sglang:v0.5.12.post1"]') || fromJSON(format('["{0}"]', inputs.base_image_ref || 'lmsysorg/sglang:v0.5.12.post1')) }}
base_image: ${{ github.event_name == 'push' && fromJSON('["lmsysorg/sglang:v0.5.16"]') || fromJSON(format('["{0}"]', inputs.base_image_ref || 'lmsysorg/sglang:v0.5.16')) }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Use a published SGLang base-image tag

For push and default manual runs this matrix value is passed as BASE_IMAGE_REF to _build-engine-image.yml, but the current lmsysorg/sglang tag list publishes v0.5.16 as suffixed CUDA/ROCm runtime tags such as v0.5.16-cu129-runtime/v0.5.16-cu130-runtime, not the bare v0.5.16 tag. These release runs will fail when Docker tries to pull the base image, so the default should point at a published runtime tag.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci CI/CD configuration changes dependencies Dependency updates grpc gRPC client and router changes tests Test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant