Repository navigation
feat(infra): balance v1 rollout sessions across inference backends - #1847
Open
dingzhiqiang wants to merge 3 commits into
Open
dingzhiqiang wants to merge 3 commits into
dingzhiqiang wants to merge 3 commits into
Conversation
Signed-off-by: chucai.dzq <chucai.dzq@antgroup.com>
dingzhiqiang
requested review from
HwVanICI,
Le8r0nJames,
TaoZex,
daihaowz,
fishcrap,
garrett4wade,
geshi001,
guozhihao-224,
sitabulaixizawaluduo and
yulangz
as code owners
October 30, 2026 04:42
| weight_version=pool.version, | ||
| ) | ||
| lease = Lease(request.model_copy(), response) | ||
| pool.requests[request.request_id] = lease |
Collaborator
There was a problem hiding this comment.
There seems to be no deletion mechanism, which poses a risk of memory leaks.
| try: | ||
| response = self._session.request( | ||
| method, | ||
| f"{self.address}{path}", |
Collaborator
There was a problem hiding this comment.
If the tail of self.address has a "/", it will access the wrong address.
This branch has not been deployed
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.
Description
Add opt-in backend load balancing to the v1 SGLang rollout path. New sessions select the healthy backend with the lowest outstanding execution count normalized by capacity; subsequent requests keep the same backend for cache locality. DataProxy ownership is unchanged, and generation traffic goes directly to the selected backend.
Enable with
rollout.backend_routing.enabled: truein v1 single-controller mode. The controller owns the shared router lifecycle, including train/eval sender fencing, draining, and weight-version publication. Metadata retries are idempotent; ambiguous generation failures fail the pool instead of replaying an uncertain execution. Pauses do not consume the backend-health timeout budget, and stale health responses cannot override a resumed pool.Related Issue
No linked issue.
Type of Change
Validation
python -m pytest -q tests/v2/inference_service/test_backend_router.py tests/test_backend_routing_lifecycle.py tests/test_recover.py: 105 passed.python -m pytest -q tests/v2/inference_service/test_router.py tests/experimental/openai/test_proxy_rollout_server.py: 112 passed.pre-commit run --all-filespassed, including generated CLI documentation; normal commit hooks and Conventional Commit validation also passed../docs/build_all.sh; the existing offline environment lacks the pinned Megatron-Bridge wheel. Markdown formatting and CLI-document generation are checked by pre-commit.Performance observation
An asynchronous SWE multimodal comparison used 64 task IDs, 16 TP=4 inference replicas, fixed model weights (
lr=0), and nine updates per arm:Observed asynchronous rollout duration decreased by 6.1%. This is one sequential OFF/ON comparison, not a guaranteed speedup: asynchronous sample consumption, trajectories, uncached prompt work, and environment latency differ. The first eight updates improved by 2.3%; the ninth contributes most of the aggregate saving. Training-time reductions are excluded from this claim.
Synchronous rollout: no reliable numerical estimate is claimed. A synchronous batch waits for its slowest trajectory, so the asynchronous 6.1% is not a synchronous estimate or an upper bound. The earlier synchronous run was dominated by environment timeouts and cannot establish a comparable scheduling benefit.
Checklist
pre-commit run --all-files)./docs/build_all.sh(CLI docs updated; full build blocked as described above)main/review-prworkflow with an infra expert; no blocking findings/create-prAdditional Context
Routing is disabled by default. Supported scope is v1, SGLang, and single-controller operation. Router state is in-memory for the run; an uncertain execution or router failure requires restarting the experiment. Experimental scheduling policies, training-engine fixes, private launch recipes, and diagnostic instrumentation are excluded.