feat(inference): unify single-/multi-node deployments behind one global router#3067
Open
mikasenghaas wants to merge 4 commits into
Open
feat(inference): unify single-/multi-node deployments behind one global router#3067mikasenghaas wants to merge 4 commits into
mikasenghaas wants to merge 4 commits into
Conversation
…global router Non-disaggregated multi-node RL deployments previously started one router per replica: a deployment of N single-node replicas (num_infer_nodes=1, num_infer_replicas=N) exposed N router URLs and relied on the orchestrator's client-side least-loaded balancing, which is blind to prefix-cache locality across replicas — consecutive turns of the same rollout could land on different replicas and re-prefill the shared prefix. Now a single global router on the first inference node fronts every per-rank backend across all replicas. Replicas keep their meaning for vLLM DP/EP grouping only; the client-facing interface is always exactly one router URL, so single-node-replica and multi-node deployments have the same defaults and behave the same. With the default consistent_hash policy (keyed on X-Session-ID = trajectory_id), each rollout's turns pin to one backend, giving pool-wide prefix-cache affinity plus skew rebalancing. The disaggregated (P/D) path keeps its per-replica router structure. For llm-d, endpoint discovery now spans all inference nodes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Member
Author
Benchmark resultsNemotron-3 Super 120B SWE RL (
Takeaways
Benchmarked runs: 🤖 Generated with Claude Code |
mikasenghaas
marked this pull request as ready for review
July 17, 2026 22:03
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit ad58793. Configure here.
…gs at dp=1) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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
A deployment of N single-node replicas (
num_infer_nodes=1, num_infer_replicas=N— our default RL shape) starts N per-replica routers and load-balances client-side in the orchestrator (least in-flight). That balancing is blind to prefix-cache locality across replicas: consecutive turns of the same rollout can land on different replicas and re-prefill the shared prefix — expensive for agentic/SWE workloads with 100k+ shared-prefix contexts.Change
consistent_hashpolicy (keyed onX-Session-ID = trajectory_id), a rollout's turns pin to one backend → pool-wide prefix-cache affinity + skew rebalancing.Benchmark (in progress)
3-way comparison on Nemotron-3 Super 120B SWE RL (131k ctx, 4 train + 2 infer H200 nodes, 5 steps, no evals, 256 inflight; inference stats averaged over steps 2–5):
enable_expert_parallel(ep=16)Results will be posted here.
🤖 Generated with Claude Code
Note
Medium Risk
Changes core SLURM launch and routing for the default RL multi-replica path (single router SPOF on node 0, different URL shape for orchestrator); P/D and admin URLs are unchanged but inference grouping logic was adjusted for EP edge cases.
Overview
Non-disaggregated multi-replica RL inference now uses one global router on the first inference node instead of one router per replica. The orchestrator gets a single
INFER_URL; worker URLs for routing are collected from every inference node and DP rank into oneALL_ROUTER_ARGSlist (no more per-replica|segments or multiple client URLs).Disaggregated (P/D) behavior is unchanged: still one router per replica and per-replica
INFER_URLS.For llm-d on the regular (non-P/D) path, endpoint discovery now spans
num_infer_nodes(all inference nodes), not just nodes per replica.Wide-EP / external-LB launch only wires vLLM into a multi-rank DP group when expert parallel is on and
INFER_GROUP_DP > 1; otherwise ranks start as independent engines (avoids invalid external-LB DP args whendata_parallel_size == 1while still allowing EP within a single TP group).Docs in
inference.mdare updated to describe the global router for multi-replica and multi-node RL, and to contrast with P/D’s per-replica routers.Reviewed by Cursor Bugbot for commit 80e6f66. Bugbot is set up for automated code reviews on this repo. Configure here.