Skip to content

fix(sglang): relay multinode DP sidecar KV events - #473

Merged
alec-flowers merged 9 commits into
NVIDIA:mainfrom
jain-ria:fix/sglang-multinode-dp-sidecar
Oct 7, 2026
Merged

alec-flowers merged 9 commits into
NVIDIA:mainfrom
jain-ria:fix/sglang-multinode-dp-sidecar

Conversation

@jain-ria

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

Copy link
Copy Markdown
Contributor

Multinode SGLang attention-DP deployments previously launched a Dynamo sidecar only on the leader, leaving follower KV events unavailable to the router. Launch native gRPC and a coupled sidecar on each follower that owns a KV publisher, while retaining one serving registration per logical worker. Dynamo selects serving or telemetry mode from engine metadata; srtctl no longer passes --telemetry-only. Followers without publishers remain engine-only.

Reserve the full global-DP publisher-port range to prevent collisions between colocated workers, keep prefill bootstrap addresses leader-only, and omit an explicit NCCL port for ordinary-DP sidecar engines so SGLang can allocate separate ports for its independent TP groups. Includes agg/disagg examples, docs, launch snapshots and regression coverage. No frontend-readiness changes.

Requires compatible Dynamo PR14908 and SGLang PR39659, including their native libraries. Python-only source overlays are insufficient.

Validation after merging main

Merge commit c285a29 incorporates upstream main 848f72d. Ruff, formatting, type checks and generated schema checks pass; focused sidecar/port/design checks: 95 passed. Full suite: 4,146 passed, 2 skipped, 6 deselected, 3 failed. Two failures pass isolated reruns (console wrapping and status-server timeout); the remaining MLPerf snapshot mount-order difference also fails on untouched upstream main under a non-default temporary directory. No patch-specific CPU test failure remains.

Fresh GPU runs use actual srtctl apply, Qwen/Qwen3-0.6B BF16, A16 GPUs, Dynamo 4da4ccbe938d and SGLang 047eb45dfb3b, with native libraries freshly rebuilt and hashes verified. Runtime dependencies were aligned to Torch 2.14.1+cu130, Transformers 5.17.0 and FlashInfer 0.7.0.post1, including matching cubins/JIT cache. SA-Bench: ISL 128, OSL 64, concurrency 4; custom post-evaluation checks cover rank routing, cache reuse, KV events and disaggregated transfers.

Deployment Fresh result
Ordinary DP aggregate: two TP1/DP2 engines on two nodes PASS: 40/40 benchmark requests; 36/36 targeted requests, including 28 unpinned cache checks and KV Stored events from all four worker/rank targets.
Attention DP aggregate: one TP2/attention-DP2 engine across two nodes FAIL: follower sidecar rejects KV source rank 1 is outside dp_size 1. Current SGLang reports dp_size=1, attn_dp_size=2; Dynamo still validates/registers against dp_size.
Ordinary DP disaggregate: two prefill and two decode TP1/DP2 engines across four nodes FAIL: 16/40 benchmark requests succeeded; 24 failed. Targeted checks passed two DP0 requests, then failed the first prefill-DP1 request with HTTP500. SGLang checks its attention rank0 against the ordinary-DP bootstrap rank1.
Attention DP disaggregate: TP2/attention-DP2 prefill and decode across four nodes FAIL before serving: prefill follower independently reproduces KV source rank 1 is outside dp_size 1, with attn_dp_size=2.

Validation is not fully green with the current dependency heads. SGLang needs to use the system-DP rank for ordinary-DP bootstrap registration/checks; Dynamo needs to interpret SGLang's separate system-DP and attention-DP widths consistently during metadata validation and worker registration. These failures remain in the dependency PRs; no SRT readiness gate or workaround was added.

Native dev builds use RUST_MIN_STACK=33554432 (32 MiB). This is functional smoke validation, not release-performance or default-stack qualification. No dependency source patches were applied for these fresh runs.

Earlier attention-DP agg/disagg runs passed 40/40 benchmark and 27/27 or 31/31 targeted requests using Dynamo 9ab50011f8bf, SGLang 8eaffcf88dac and srt-slurm 978b35b. Those results do not establish compatibility of the current dependency heads.

Signed-off-by: jain-ria <riajain@NVIDIA.com>
Signed-off-by: jain-ria <riajain@NVIDIA.com>
Signed-off-by: jain-ria <riajain@NVIDIA.com>
Preserve SGLang KV publisher port ranges inside the per-engine allocation loop added for vLLM shadow engines. Keep both allocator options and their existing defaults.

Signed-off-by: jain-ria <riajain@NVIDIA.com>
Comment thread examples/README.md Outdated
Let native SGLang allocate per-replica NCCL ports for sidecar regular DP instead of reusing a fixed port across independent TP groups. Preserve fixed ports for TP and attention DP, and cover aggregate, prefill, and decode launch commands.

Signed-off-by: jain-ria <riajain@NVIDIA.com>
Signed-off-by: jain-ria <riajain@NVIDIA.com>
Move the PR's SGLang multinode sidecar documentation into the new native sidecars guide and fix its example links for the published docs.

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

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown

src/srtctl diff: +81 -9

Comment thread tests/snapshots/launch/features__sglang-sidecar-multinode-dp.txt
@alec-flowers
alec-flowers merged commit c5b33ea into NVIDIA:main Oct 7, 2026
3 checks passed
trevor-m added a commit to trevor-m/srt-slurm that referenced this pull request Oct 13, 2026
SGLang binds each KV-event publisher at the configured port plus its DP
rank (the attention-DP rank, or the replica rank without attention DP).
Two DP workers on one node got consecutive base ports, so worker 0's rank 1
bound worker 1's base and failed with "Address already in use".

NVIDIA#473 reserved a dp-size block, but only in Dynamo sidecar mode with KV
events, and it read only dp-size. Reserve the block for every SGLang
process, as the vLLM backend does for its local DP ranks, and size it with
SGLangBackend.num_dp_ranks (dp-size x attn-dp-size). sgl-project/sglang#41818
added --attn-dp-size and left dp-size counting replicas; the deprecated
dp-size + enable-dp-attention spelling resolves to the same layout. The
sidecar follower-publisher check, the replica NCCL-port rule and the AIPerf
follower scrape now read the same resolver, so --attn-dp-size works there
too.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
weireweire pushed a commit that referenced this pull request Oct 16, 2026
SGLang binds each KV-event publisher at the configured port plus its DP
rank (the attention-DP rank, or the replica rank without attention DP).
Two DP workers on one node got consecutive base ports, so worker 0's rank 1
bound worker 1's base and failed with "Address already in use".

#473 reserved a dp-size block, but only in Dynamo sidecar mode with KV
events, and it read only dp-size. Reserve the block for every SGLang
process, as the vLLM backend does for its local DP ranks, and size it with
SGLangBackend.num_dp_ranks (dp-size x attn-dp-size). sgl-project/sglang#41818
added --attn-dp-size and left dp-size counting replicas; the deprecated
dp-size + enable-dp-attention spelling resolves to the same layout. The
sidecar follower-publisher check, the replica NCCL-port rule and the AIPerf
follower scrape now read the same resolver, so --attn-dp-size works there
too.

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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