Skip to content

feat(grpc): expose follower metadata and node-local KV sources - #39659

Merged
ishandhanani merged 21 commits into
sgl-project:mainfrom
jain-ria:codex/sglang-local-kv-sidecars
Oct 6, 2026
Merged

ishandhanani merged 21 commits into
sgl-project:mainfrom
jain-ria:codex/sglang-local-kv-sidecars

Conversation

@jain-ria

@jain-ria jain-ria commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Expose node-local engine metadata to externally managed sidecars. With native --grpc-port configured, follower nodes start a lightweight server implementing the existing SglangService/GetServerInfo RPC. They do not initialize a tokenizer, inference bridge, or request-serving frontend; other RPCs return UNIMPLEMENTED.

Leader and follower gRPC servers share the same metadata builder. No protobuf or RPC-path changes are required.

Metadata

  • Existing server-info fields supply node/DP topology, disaggregation configuration, and the shared dist_init_addr for engine-group correlation.
  • New kv_event_sources lists only this node's actual publishers: global DP rank, exact subscription endpoint, topic, logical block size (including DCP), and optional replay endpoint.
  • Sources come from publisher sockets and scheduler-ready messages, aggregated across local schedulers. A node with no subscribable publisher reports [].
  • Wildcard TCP binds advertise loopback addresses for a colocated consumer; bound IPC endpoints are supported. Connect-style/inproc publishers retain their behavior but are not advertised as local subscription sources.
  • The existing global kv_events descriptor remains unchanged for compatibility. Consumers of node-local discovery use kv_event_sources instead of inferring ownership from global DP size.

Scope

This supersedes the earlier managed-sidecar proposal in this PR. Removed --sidecar-scope, SGLANG_SIDECAR_CONTEXT, follower sidecar launching, and sidecar watchdog changes. Existing SGLang-managed sidecar launch behavior is unchanged.

Only metadata discovery and its server lifecycle are included. KV events still use ZMQ. Dynamo integration, SGLang-managed follower sidecars, metrics/FPM, and live/elastic source membership are follow-ups. Follower metadata is a startup snapshot after scheduler readiness.

Validation

Base: 406c9c71d833570aa89bc26ccb2e9d1518cd4564. The results below were recorded at SGLang c6c49ac1d2721b93becdfc2be7cab46ddf58c0e8.

  • Focused Python suites: 315 passed, 100 subtests passed (metadata/lifecycle, gRPC bridge, server-info compatibility, arguments, KV publishers, DP controller).
  • Native Rust tests: 14 passed, including real gRPC metadata roundtrip, rejection of inference/control RPCs, and shutdown.
  • Python/native integration smoke: fetch metadata over gRPC, subscribe to its actual ZMQ source, receive a KV event, verify duplicate-port failure and clean/idempotent shutdown.
  • Rust Clippy all-targets with -D warnings, Rust formatting, and scoped Python formatting/lint passed.
  • Physical two-node Dynamo integration (2026-09-16): one H100 per node, Qwen/Qwen3-0.6B, NNODES=2, TP_SIZE=2, attention DP_SIZE=2, aggregated serving. Verified generation on both ranks, follower metadata discovery, actual KV Stored events from global DP ranks 0 and 1, one serving registration with two event sources, and an unpinned repeated prompt routed to the follower with 256 cached tokens.
    • Tested with Dynamo 0d41b47c28b0a092671f73e3db5bd5d4908ee8f5 from ai-dynamo/dynamo#14908. Both native extensions were rebuilt from the tested sources, using lmsysorg/sglang:v0.5.19-cu130-runtime and a runtime-only sglang-kernel==0.4.7 upgrade.
    • The original Dynamo launcher failed to discover a local source. The passing run used an explicit wildcard publisher override, --kv-events-config '{"publisher":"zmq","endpoint":"tcp://*:5557","topic":""}'. Follower Dynamo health still reported 503 despite working event delivery; downstream launcher/readiness fixes were made afterward. This was not an entirely healthy deployment run.

The two-node GPU run has not been repeated after the later loopback-publisher fix in SGLang c50b251da8e455dfbb594f8c3b7ccae6eca72129. It does not cover prefill/decode disaggregation, NIXL transfers, multimodal inference, independent restart/replay, elastic membership, or performance.


CI States

Latest PR Test (Base): ✅ Run #37489727878
Latest PR Test (Extra): ✅ Run #37489727323
Latest PR Test (AMD ROCm 10): ⏳ Run #37489727895

Signed-off-by: jain-ria <riajain@NVIDIA.com>
Signed-off-by: jain-ria <riajain@NVIDIA.com>
Signed-off-by: jain-ria <riajain@NVIDIA.com>
Signed-off-by: jain-ria <riajain@NVIDIA.com>
Signed-off-by: jain-ria <riajain@NVIDIA.com>
@jain-ria jain-ria changed the title feat(sidecar): launch headless sidecars for local KV publishers feat(grpc): expose follower metadata and node-local KV sources Sep 16, 2026
Signed-off-by: jain-ria <riajain@NVIDIA.com>
Signed-off-by: jain-ria <riajain@NVIDIA.com>

@ishandhanani ishandhanani left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed at 8eaffcf88daca77eef9046fd878bcfe414752e09 against merge base 406c9c71d833570aa89bc26ccb2e9d1518cd4564. One reproduced P2 finding below.

Validation passed: 314 Python tests plus 93 subtests, 14 Rust gRPC tests, Clippy/formatting, and 50 native lifecycle probes. Two node processes on two H100 GPUs on one physical host completed 64/64 concurrent generation requests, delivered per-rank live/replay KV events, and rejected all 24 non-metadata follower RPCs. Physical multi-host networking, GPU DCP/PP, disaggregated serving, and performance A/B were not tested.

Comment thread python/sglang/srt/disaggregation/kv_events.py
Signed-off-by: jain-ria <riajain@NVIDIA.com>
Comment thread python/sglang/srt/entrypoints/grpc_metadata.py Outdated
Comment thread python/sglang/srt/entrypoints/grpc_metadata.py Outdated
Comment thread test/registered/unit/entrypoints/test_grpc_metadata.py Outdated
Signed-off-by: jain-ria <riajain@NVIDIA.com>
Signed-off-by: jain-ria <riajain@NVIDIA.com>
@ishandhanani ishandhanani added the run-ci-extra CI: also run the extra suite (requires run-ci) label Sep 29, 2026
@jain-ria
jain-ria force-pushed the codex/sglang-local-kv-sidecars branch from e1155ad to 71d0644 Compare September 29, 2026 22:29
Signed-off-by: jain-ria <riajain@NVIDIA.com>
@jain-ria
jain-ria force-pushed the codex/sglang-local-kv-sidecars branch from 71d0644 to 39859ba Compare September 29, 2026 22:38

@ishandhanani ishandhanani left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nit comment

Comment thread python/sglang/srt/utils/common.py Outdated
Signed-off-by: jain-ria <riajain@NVIDIA.com>
Signed-off-by: jain-ria <riajain@NVIDIA.com>
@jain-ria

Copy link
Copy Markdown
Contributor Author

/run-extra-ci

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Re-running PR Test Extra.

Signed-off-by: jain-ria <riajain@NVIDIA.com>
@jain-ria

jain-ria commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

/rerun-failed-ci

Signed-off-by: jain-ria <riajain@NVIDIA.com>
@jain-ria

jain-ria commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

/rerun-failed-ci

@jain-ria

jain-ria commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

/rerun-failed-ci

@jain-ria

jain-ria commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

/rerun-failed-ci

@ishandhanani

Copy link
Copy Markdown
Collaborator

base and extra ci passed

@ishandhanani
ishandhanani merged commit fd62ee8 into sgl-project:main Oct 6, 2026
264 of 296 checks passed
jain-ria added a commit to jain-ria/sglang that referenced this pull request Oct 6, 2026
Adopt the concrete streaming return types generated after sgl-project#39659 enabled default gRPC stubs. Preserve the parity chat/completion implementations and text-generation tokenizer guard.

Validation: Rust workspace tests passed (including 351 server tests); workspace all-target Clippy with warnings denied, cargo fmt, focused pre-commit checks, and git diff --check passed.
Signed-off-by: jain-ria <riajain@NVIDIA.com>
cursor Bot pushed a commit to cipheraxat/sglang that referenced this pull request Oct 9, 2026
…roject#39659)

Signed-off-by: jain-ria <riajain@NVIDIA.com>
Co-authored-by: ishandhanani <82981111+ishandhanani@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-ci CI: run the baseline test suite on this PR run-ci-extra CI: also run the extra suite (requires run-ci)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants