Skip to content

fix(vllm_model): route a rollout's calls by rollout id - #4462

Merged
ananthsub merged 1 commit into
mainfrom
wprazuch/vllm-route-by-rollout
Oct 12, 2026
Merged

ananthsub merged 1 commit into
mainfrom
wprazuch/vllm-route-by-rollout

Conversation

@wprazuch

Copy link
Copy Markdown
Contributor

With several vLLM endpoints in base_url, vllm_model picks one by hashing the request's session id. Agents that don't keep cookies (verifiers_agent, and tau2 through NeMoGymAsyncOpenAI) get a fresh session on every model call, so each turn of a rollout lands on a random endpoint.

That turns into a pile-up under load. A turn on the busier endpoint runs slower and stays there longer, so rollouts gradually collect on one endpoint while the other idles. Measured on a two-endpoint AutomationBench run: about 585 requests running on one endpoint at about 2.4 tok/s each, 3 on the other; model calls hit the agent's client timeout. Tau3 showed the same pattern, with the busy endpoint changing between restarts.

Fix: _resolve_client keys the endpoint on current_rollout_id() when the call carries one, falling back to the session id. A rollout's turns stay on one endpoint (prefix-cache reuse), and rollouts spread across endpoints by hash. Failover (route_around_failing_endpoints) works unchanged on the new key.

Tests: calls of one rollout with different sessions pick one endpoint; 64 rollouts sharing one session spread over both endpoints; without a rollout the session still decides. The first two fail on main. ng_test +entrypoint=responses_api_models/vllm_model: 408 passed.

Agents that drop cookies (verifiers_agent, tau2's client) get a new session on
every model call, so each turn hashed to a random endpoint. Turns that landed
on the slower endpoint stayed there longest, so rollouts piled onto one
endpoint while the other idled. Key the endpoint on the rollout id when the call
carries one, falling back to the session id.

Signed-off-by: Wojciech Prazuch <[email protected]>
@nemo-automation-bot
nemo-automation-bot Bot requested a review from a team October 12, 2026 08:22
@yaoyu-33 yaoyu-33 added area:model Model servers, inference providers, and model adapters bug Something isn't working complexity:low Localized change in one scope with a small, straightforward review surface needs-review PR is ready for code review and waiting on a reviewer labels Oct 12, 2026
@ananthsub
ananthsub added this pull request to the merge queue Oct 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/38258745730

Merged via the queue into main with commit 75bb53e Oct 12, 2026
45 of 47 checks passed
@ananthsub
ananthsub deleted the wprazuch/vllm-route-by-rollout branch October 12, 2026 14:07
wprazuch added a commit that referenced this pull request Oct 21, 2026
…to gdpval-devel) (#4859)

fix(vllm_model): route a rollout's calls by rollout id (backport #4462)

(cherry picked from commit 75bb53e)

Signed-off-by: Wojciech Prazuch <[email protected]>

This branch was previously deployed

1 inactive deployment
public — fb2861fd Deployed Oct 12, 2026 by copy-pr-bot[bot] via release / finalize / notify #5017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:model Model servers, inference providers, and model adapters bug Something isn't working complexity:low Localized change in one scope with a small, straightforward review surface needs-review PR is ready for code review and waiting on a reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants