feat: add push-based engine load reporting and Router load monitor - #32510
Closed
Bakerjc-bgner wants to merge 7 commits into
Closed
Bakerjc-bgner wants to merge 7 commits into
Bakerjc-bgner wants to merge 7 commits into
Conversation
- Introduced load monitoring flags in the router configuration, allowing for binding to specific host and port. - Updated the Kubernetes manifests to include environment variables for pod IP. - Enhanced the integration tests to validate the load monitoring functionality, ensuring fresh workers are reported correctly. - Refactored the load reporter to remove admin API key requirements for internal control endpoints. - Updated protobuf definitions and generated code to reflect the new routing structure for load monitoring. - Adjusted various test cases to accommodate the new load monitoring features and ensure proper functionality across different scenarios.
Contributor
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
Bakerjc-bgner
marked this pull request as ready for review
July 27, 2026 09:19
Bakerjc-bgner
requested review from
CatherineSue,
Fridge003,
HaiShaw,
JustinTong0323,
Kangyan-Zhou,
Ying1123,
bingxche,
hnyls2002,
ishandhanani,
ispobock,
merrymercy,
slin1237,
sogalin,
xiezhq-hermann and
yctseng0211
as code owners
July 27, 2026 09:19
Contributor
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
Bakerjc-bgner
marked this pull request as draft
July 27, 2026 09:25
Bakerjc-bgner
marked this pull request as ready for review
July 27, 2026 09:29
Contributor
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
Author
|
Hi @hzh0425 and @whybeyoung , would you mind taking a look at this PR? Thank you! |
Author
|
Superseded by #32523, which contains the Engine Load Reporter only and is split into reviewable incremental commits. The Router Load Monitor and Prefill throughput extension will be submitted separately. |
5 tasks
yangbodong22011
added a commit
to yangbodong22011/sglang
that referenced
this pull request
Aug 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Load-aware routing needs fresh, engine-authoritative data. Polling coarse worker-level endpoints cannot reliably expose short-lived queue changes or load imbalance hidden across data-parallel ranks, and independently refreshed values can give one routing decision a torn view of the cluster.
This PR introduces an end-to-end, push-based load-control plane between SGLang engines and
experimental/sgl-router. Engines continuously stream per-DP-rank load over long-lived gRPC connections, while the Router validates, aggregates, and publishes immutable snapshots for diagnostics and load-aware policies.The design provides fine-grained visibility without putting polling fan-out on the request path. It is efficient, topology-aware, resilient to stale or out-of-order data, and opt-in for backward compatibility.
Modifications
Architecture
flowchart LR subgraph Engine["SGLang Engine"] Scheduler["Scheduler<br/>per-DP-rank load metrics"] Snapshot["SHM / ZMQ load snapshot"] Reporter["LoadReporterRuntime<br/>single owner"] Workers["Tokenizer workers<br/>coalesced IPC control + refresh"] Scheduler --> Snapshot --> Reporter Workers -. "multi-tokenizer mode" .-> Reporter end subgraph Router["experimental/sgl-router"] Discovery["Worker discovery"] Registration["Registration + lease renewal"] Ingest["LoadMonitorService.Report<br/>client-streaming gRPC"] Validation["Identity, sequence,<br/>and freshness validation"] Aggregate["Per-DP-rank aggregation"] View["Immutable, versioned snapshot"] Diagnostic["GET /v1/load_monitor/snapshot"] Policy["PolicyCandidate<br/>load-aware routing"] Discovery --> Registration Ingest --> Validation --> Aggregate --> View View --> Diagnostic View --> Policy end Registration -->|"POST /v1/start_reporting<br/>target + interval + lease"| Reporter Reporter -->|"long-lived stream<br/>ms-resolution report cadence"| IngestEngine-side load reporter
Router-side load monitor
POST /v1/start_reportingand renews the reporting lease.GET /v1/load_monitor/snapshotdiagnostic endpoint and attach fresh aggregate load to policy candidates, including the existing load-based policy path.Why this design
Accuracy Tests
N/A for model accuracy. This PR does not change model forward code, kernels, sampling, or generated outputs.
Functional and correctness validation:
cargo test --lib load_monitor: 19 passed, 0 failed.cargo test --lib policies::: 175 passed, 0 failed.Speed Tests and Profiling
N/A for inference throughput benchmarking. The feature is an opt-in control-plane path and does not modify model execution or the inference hot path.
The transport is intentionally lightweight: it reuses long-lived gRPC streams, samples already-published engine snapshots, and coalesces multi-tokenizer refresh notifications. No inference-speed improvement is claimed by this PR.
Additional local checks:
cargo fmt --all -- --check: passed.cargo check --all-targets: passed.git diff --check: passed.Checklist
Review and Merge Process
/tag-and-rerun-ci,/tag-run-ci-label,/rerun-failed-ciCI States
Latest PR Test (Base): ⏳ Run #30255759319
Latest PR Test (Extra): ⏳ Run #30255759497