Repository navigation
feat(gym): support Environment Server tasksets - #4429
Conversation
zyzhou5
left a comment
There was a problem hiding this comment.
Generated by Codex using NeMo-RL’s review-pr-team skill
No issues found in the reviewed changes, including checks for redundant mechanisms, trackers, and test coverage.
Full regression tests and end-to-end GPU training were not rerun for this review.
|
/ok to test b73e7f9 |
b73e7f9 to
93bae51
Compare
|
/ok to test 93bae51 |
93bae51 to
7e1139e
Compare
|
/ok to test 7e1139e |
7e1139e to
99341ff
Compare
|
/ok to test 99341ff |
|
/ok to test 61ce964 |
|
/ok to test 28d7daf |
f7c41b1 to
1f299a8
Compare
|
/ok to test 2fca130 |
|
/ok to test a8bb38f |
2fca130 to
a8bb38f
Compare
yaoyu-33
left a comment
There was a problem hiding this comment.
Reviewed a8bb38f. Approving with one non-blocking follow-up: the async collector still retries terminal Gym episode failures. Add the existing is_terminal_gym_episode_failure(last_error) check alongside the actor-death guard in _collect_rollout_batch, with a regression test.
Validation: 98 focused CPU tests passed with the Ray/GPU fixtures excluded. A source-function probe reproduced four dispatch attempts for terminal failures and confirmed that the proposed guard stops after one. Full GPU training was not rerun locally.
CI remains outstanding: L0_Unit_Tests_Other failed when one process in the unchanged two-rank leader-broadcast test did not exit within 30 seconds; the aggregate quality check also failed. Patch coverage is 78.23% against the 80% target.
|
/ok to test e93eb41 |
a8bb38f to
e93eb41
Compare
Read materialized task inputs, route Environment Server requests, and adapt episode results for training while preserving flat-row support. Include the initial scope simplifications and regression coverage. Signed-off-by: Zeyu Zhou <[email protected]>
Address the first review round: clarify task-row and episode terminology, preserve compatibility routing, and validate recovery overrides. Signed-off-by: Zeyu Zhou <[email protected]>
Address startup validation and compatibility-failure feedback, including terminal-failure handling and regression coverage. Signed-off-by: Zeyu Zhou <[email protected]>
Address taskset attribution feedback across rollout grouping, metrics, and recovery. Include the corresponding updates to existing test expectations. Signed-off-by: Zeyu Zhou <[email protected]>
Address the replay-compatibility follow-up and document taskset training. Add the validated OpenMathReasoning recipe with AIME24 evaluation. Signed-off-by: Zeyu Zhou <[email protected]>
Preserve taskset episode handling through the updated capture and recovery contracts, with integration coverage for capture modes and retries. Signed-off-by: Zeyu Zhou <[email protected]>
e93eb41 to
e082209
Compare
|
/ok to test e082209 |
Signed-off-by: Zeyu Zhou <[email protected]>
|
/ok to test e91d968 |
…warning Since #4429 a materialized task row carries no agent_ref, so the warning, which read row["agent_ref"]["name"], raised KeyError for a group of such rows whose first prompts differ. It now reads the attribution key that _postprocess_single_nemo_gym_group stamps on every result (the agent of a flat row, the taskset of a materialized task), reports once per key, and says "attribution key(s)" in the message. The test covers a group of materialized task rows. Two tests that main added (#4500, #5206) run _run_rollouts on results that carry tokens with no tokenizer. The diagnostic pads the first prompts with the tokenizer's pad id, so both tests get the tokenizer stand-in that the other tests of this path use. Signed-off-by: alexandery <[email protected]> Co-Authored-By: Claude Fable 5.2 <[email protected]>
What does this PR do ?
Support Environment Server tasksets in NeMo-RL while preserving existing recipes that use the
legacy_agentwrapper. Handle nested task inputs, taskset-based routing to Gym actors, and episode results in both token-capture and inline rollouts. Preserve agent attribution and reward-shaping metadata, and honor terminal episode failures within the existing retry policy.Also documents taskset training in the NeMo Gym integration guide and adds an OpenMathReasoning GRPO recipe with AIME24 validation, using Simple Agent through
single_agent_turn.Validation
Math recipe E2E passed: AGA job
1507776used Nemotron Nano 9B v2 on one node with four GB300 GPUs, a 16K sequence limit, and three GRPO steps with eight prompts × four generations. All 96 training samples were valid, losses were finite, gradients were nonzero, and the step-3 checkpoint was saved; the job exited0.Two mixed-path training runs passed on PR revision
99341ff53ebewith its Gym pinda9f671490c3. Both used Nemotron-3-Nano-30B-A3B-BF16 on one AGA node with four GB300 GPUs: two for Megatron training (TP=2, EP=2) and two for vLLM inference (TP=2), with token capture and R3 enabled. Each ran three GRPO steps with two generations per prompt and a 1,024-token limit per model call.legacy_agentwrapper1270863)1279027)python-markdown__markdown-1529with OpenHands throughswe_agentsThe coding test used temporary compatibility fixes outside this PR; see Gym #4656.
The runs loaded their Gym definitions through
env.nemo_gym.config_paths. The relevant definitions are shown inline underenv.nemo_gymbelow; unrelated settings are omitted.Weather + Gymnasium configuration
Hermes + OpenHands configuration
Dataset rows select the route: materialized task rows use
task_id.tasksetandenvironment_server_routes; flat rows useagent_ref.nameto select the wrapped agent.