feat(vllm): forward session IDs to upstream routers - #2347
Draft
NolenLiang wants to merge 3 commits into
Draft
Conversation
NolenLiang
force-pushed
the
nliang/vllm-router-session-affinity
branch
from
August 6, 2026 07:51
7b914c3 to
a4e16ce
Compare
NolenLiang
force-pushed
the
nliang/vllm-router-session-affinity
branch
from
August 7, 2026 12:47
a4e16ce to
550912f
Compare
4 tasks
NolenLiang
force-pushed
the
nliang/vllm-router-session-affinity
branch
from
August 13, 2026 09:07
550912f to
30cc3d2
Compare
Signed-off-by: NolenLiang <nliang@nvidia.com>
Signed-off-by: NolenLiang <nliang@nvidia.com>
NolenLiang
force-pushed
the
nliang/vllm-router-session-affinity
branch
from
August 13, 2026 13:08
30cc3d2 to
9826532
Compare
Forward stable session IDs in request bodies and attach model-call capture to rollout results for auditable router metrics. Signed-off-by: Nolen Liang <nliang@nvidia.com>
NolenLiang
force-pushed
the
nliang/vllm-router-session-affinity
branch
from
August 19, 2026 10:55
f075ce8 to
4d6b55a
Compare
waple0820
added a commit
to waple0820/Gym
that referenced
this pull request
Sep 2, 2026
…rify NVIDIA-NeMo#2114 landed the rollout correlation contract, but it is one-directional. The training side learns nothing about the handle the environment actually allocated — the container, the browser context, the provider session that consumed quota — so a rollout record and a provider-side log can only be joined on a timestamp. `env_session_id` is optional on both `BaseSeedSessionResponse` and `BaseVerifyResponse`, opaque to Gym, and absent unless an environment reports one, so nothing changes for an environment that does not. This originally also added a `rollout_correlation_enabled` key so the rollout prefix could reach resources servers without turning on model-call capture. NVIDIA-NeMo#2783 removes that need by making correlation independent of the observability gate rather than adding a second flag, which is the better shape, so that half is dropped here. No training framework needs a transport change: verl and NeMo-RL already carry the whole verify response as `full_result`. Terminology: this is the environment session created by `/seed_session`, not the vLLM router KV-cache affinity of NVIDIA-NeMo#2570 / NVIDIA-NeMo#2347 / NVIDIA-NeMo#2369. Signed-off-by: waple0820 <232305951+waple0820@users.noreply.github.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.
Summary
session_params.session_idfor cache-aware routers that consume request-body identitysession_paramsfields, and session-to-client reuse/tokenizefallbacksattach_trajectory_recordas the public integration point for callers that userun_examplesdirectlyMotivation
When NeMo Gym sends requests through one upstream Router endpoint, its in-process session-to-client mapping does not by itself expose a stable session identity to that Router. Header forwarding supports consistent-hash routing, while the optional request-body field supports vLLM Router 0.1.15 cache-aware routing.
NeMo RL also uses Gym's low-level
run_examplespath. Exporting the existing trajectory attachment helper lets that caller fold captured model-call timing, token usage, response metadata, and observation gaps into the standardng_trajectoryresult without duplicating Gym logic or relying on out-of-band state.Compatibility
Session-affinity forwarding is opt-in, so existing configurations retain their previous request shape. Existing
session_paramsfields are preserved. Invalid non-mapping values are rejected instead of being silently overwritten.External audit provenance
The two incremental commits originally published as
9ad35b3andf075ce8were consolidated only to correct the Git author identity. The current commit4d6b55ahas:Nolen Liang <nliang@nvidia.com>Nolen Liang <nliang@nvidia.com>e0807bfc5c40cf282c07b33aa8178c124dda4e9f, exactly identical to the formerf075ce8treeThe parent NeMo RL Phase 2 matrix observed complete model-call timing for all six accepted formal runs using this source tree.
Testing