Repository navigation
feat: forward rollout session IDs to Dynamo - #3856
Open
jthomson04 wants to merge 7 commits into
Open
jthomson04 wants to merge 7 commits into
jthomson04 wants to merge 7 commits into
Conversation
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
jthomson04
force-pushed
the
jthomson04/dynamo-session-id-forwarding
branch
from
August 26, 2026 23:52
6ef3f99 to
2af6e1b
Compare
Contributor
Author
|
/ok to test 2af6e1b |
jthomson04
marked this pull request as ready for review
August 27, 2026 23:23
|
Auto-sync is disabled for ready for review pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
jthomson04
force-pushed
the
jthomson04/dynamo-session-id-forwarding
branch
from
September 8, 2026 17:07
2af6e1b to
1760154
Compare
Contributor
Author
|
/ok to test 1760154 |
Signed-off-by: jthomson04 <[email protected]>
Signed-off-by: jthomson04 <[email protected]>
Replace the unmerged Gym session_id_header fork with Gym main's forward_session_id_as_conversation_id (NVIDIA-NeMo/Gym#3582). - Pin Gym to 75bb53e6d494437d616019040f22a9df7dcacd26 and relock. - For the Dynamo backend, setup_nemo_gym_config enables forward_session_id_as_conversation_id on policy_model's vllm_model. - The Dynamo token wrapper reads conversation_params.conversation_id, sends it as X-Dynamo-Session-ID, and strips conversation_params from the forwarded body, which Dynamo's frontend rejects as unsupported. - Malformed conversation_params return 400. The incoming X-Dynamo-Session-ID header is no longer read. - Build the wrapper's FastAPI app in _build_app so the handler can be tested without binding a port. Signed-off-by: jthomson04 <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
jthomson04
force-pushed
the
jthomson04/dynamo-session-id-forwarding
branch
from
October 12, 2026 17:07
1760154 to
fa45749
Compare
Contributor
Author
|
/ok to test fa45749 |
The setdefault chain raised AttributeError on a null policy_model, and in a sharded job without a top-level policy_model it created an overlay no shard claimed, which parse_shard_plan rejects. Route the overlay through _gym_policy_model_overlay, which treats null levels as empty and uses common_overrides when a sharded job has no top-level policy_model. Signed-off-by: jthomson04 <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sibling PRs add other keys to the same vllm_model overlay and change the wrapper's response metadata. Assert only forward_session_id_as_conversation_id and the keys each test seeds, so those changes do not break these tests. Signed-off-by: jthomson04 <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Describe how Gym and direct rollouts reach Dynamo with a session ID, and how to opt into router session affinity through the frontend's extra_cli_args. Signed-off-by: jthomson04 <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
Author
|
/ok to test d244da0 |
jthomson04
added a commit
to jthomson04/RL
that referenced
this pull request
Oct 12, 2026
Move the shard-aware lookup of the Gym policy model's vllm_model overlay into _gym_policy_model_overlay, byte-identical to the copy that NVIDIA-NeMo#3856 and NVIDIA-NeMo#3763 add, so the three PRs merge onto one helper. _enable_gym_prefix_derivation now only decides the flag. The helper treats a null overlay level as empty and rejects a non-mapping one with a ValueError. Before, an unsharded policy_model: null (or a null nested level) failed with an AttributeError. Signed-off-by: jthomson04 <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
jthomson04
added a commit
to jthomson04/RL
that referenced
this pull request
Oct 12, 2026
The dynamo case asserted that setup_nemo_gym_config leaves env.nemo_gym untouched. The Dynamo setup in NVIDIA-NeMo#3856 and NVIDIA-NeMo#3763 writes its own policy model overlay there, and NVIDIA-NeMo#3763 sets derive_prefix_token_ids_from_messages for Dynamo too, so neither that assertion nor a narrower one on the flag would survive those PRs. Pin only megatron, whose Gym overlay nothing touches. Signed-off-by: jthomson04 <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
test_run_single_rollout_preserves_native_media_across_turns builds AsyncRolloutImpl without __init__, so it had no _policy_generation for the Dynamo session-ID lookup, and its generate_response stub rejected the new session_id keyword. Set a non-Dynamo generation and accept session_id, as the sibling rollout test already does. Signed-off-by: jthomson04 <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
Author
|
/ok to test 0d4c7ae |
jthomson04
added a commit
to jthomson04/RL
that referenced
this pull request
Oct 13, 2026
Move the shard-aware lookup of the Gym policy model's vllm_model overlay into _gym_policy_model_overlay, byte-identical to the copy that NVIDIA-NeMo#3856 and NVIDIA-NeMo#3763 add, so the three PRs merge onto one helper. _enable_gym_prefix_derivation now only decides the flag. The helper treats a null overlay level as empty and rejects a non-mapping one with a ValueError. Before, an unsharded policy_model: null (or a null nested level) failed with an AttributeError. Signed-off-by: jthomson04 <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
jthomson04
added a commit
to jthomson04/RL
that referenced
this pull request
Oct 13, 2026
The dynamo case asserted that setup_nemo_gym_config leaves env.nemo_gym untouched. The Dynamo setup in NVIDIA-NeMo#3856 and NVIDIA-NeMo#3763 writes its own policy model overlay there, and NVIDIA-NeMo#3763 sets derive_prefix_token_ids_from_messages for Dynamo too, so neither that assertion nor a narrower one on the flag would survive those PRs. Pin only megatron, whose Gym overlay nothing touches. Signed-off-by: jthomson04 <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
What does this PR do ?
Forward stable rollout session IDs to Dynamo for NeMo-Gym and direct NeMo-RL rollouts.
setup_nemo_gym_configenables Gym'sforward_session_id_as_conversation_id(feat(vllm-model): forward gym session id as backend conversation id Gym#3582) onpolicy_model'svllm_model.conversation_params.conversation_id.conversation_paramsfrom the request body, because Dynamo's frontend rejects it as an unsupported field, and sends the ID asX-Dynamo-Session-ID.X-Dynamo-Session-ID. Other backends and Dynamo routing policy are unchanged.NVIDIA-NeMo/Gym@75bb53e6d494437d616019040f22a9df7dcacd26(Gym main, includes feat(sc): add ready-first staleness sampler #3582), anduv.lockis relocked.This PR is transport-only. Session affinity stays opt-in through the existing
frontend_args.extra_cli_argsescape hatch. It does not add an affinity default, tracing controls, or a new routing policy.Gym's session ID follows the model server's session cookie:
simple_agent) send one ID per rollout.verifiers_agent,tau2) get a new ID on every model call, so session affinity doesn't apply to them.Issues
None.
Usage
No user configuration is required for session forwarding. Dynamo-backed Gym and direct rollouts send the session header automatically. Users who want session affinity can configure the existing Dynamo frontend CLI escape hatch.
Before your PR is "Ready for review"
Pre checks:
conversation_paramsbecomes the header and is stripped from the forwarded body; malformed values return 400);Additional Information
Validation:
uv lock --checkanduv sync --locked --group testpass. The Gym bump raises aiohttp to 3.14.5 (Gym requires >=3.14.4; the sglang fork keeps 3.14.3) and PyJWT to 2.15.1.