feat(nemo-gym): opt-in truncation of non-contiguous rollout episodes - #3063
Draft
Kh4L wants to merge 1 commit into
Draft
feat(nemo-gym): opt-in truncation of non-contiguous rollout episodes#3063Kh4L wants to merge 1 commit into
Kh4L wants to merge 1 commit into
Conversation
_postprocess_nemo_gym_to_nemo_rl_result hard-asserts that each assistant turn's accumulated token IDs form a prefix of the next turn's prompt. In long multi-turn agentic rollouts, rare tokenization/re-render edge cases can break this contiguity; the assert then kills the rollout task, and under async GRPO the step stalls indefinitely waiting for a trajectory that never arrives. Add an opt-in NemoGymConfig knob, truncate_noncontiguous_episodes (default false = current assert, unchanged). When enabled, a non-contiguous turn truncates the episode at the last contiguous turn with a warning: the corrupted tail is dropped and the valid prefix stays trainable, analogous to overlong filtering. Wired through GRPO and distillation setup identically to invalid_tool_call_patterns. Signed-off-by: Serge Panev <spanev@nvidia.com>
Author
|
/ok to test c0075c4 |
6 tasks
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.
Problem
_postprocess_nemo_gym_to_nemo_rl_resulthard-asserts that each assistantturn's accumulated token IDs form a prefix of the next turn's prompt. In long
multi-turn agentic rollouts (100+ turns), rare tokenization/re-render edge
cases can break this contiguity. The assert then kills the rollout task — and
under async GRPO, the step stalls indefinitely waiting for a trajectory that
will never arrive ("Need N trajectories, only N-1 ready"), until walltime
kills the job.
Change
New opt-in
NemoGymConfigknob,truncate_noncontiguous_episodes(default false = today's assert, unchanged). When enabled, a
non-contiguous turn truncates the episode at the last contiguous turn with a
warning: the corrupted tail is dropped, the valid prefix stays trainable —
same philosophy as overlong filtering. Wired through GRPO + distillation
setup identically to
invalid_tool_call_patterns.Evidence
Validated at scale on a 16-node Qwen3-30B (MoE) SWE-bench async-GRPO run with
an SGLang generation backend: 63 training steps across four clean
checkpoint+resume segments, ~200 graceful truncations, zero stalls, reward
converged (0.10 -> 0.22 plateau). Without the flag, single corrupted episodes
reproducibly stalled the step until walltime death.
Tests
Two unit tests in
tests/unit/environments/test_nemo_gym.py:Run against clean main:
2 passed.