NVIDIA-NeMo/RL#5098 Β· RL half of NVIDIA-NeMo/Gym#5711 Β· links pinned to RL cceb2eb and Gym 9e2e5d0
The flag is one row key, _ng_skip_token_capture, copied from Gym's SKIP_TOKEN_CAPTURE_KEY_NAME, with a test that fails if the two differ. RL sets it in _prepare_nemo_gym_rows when a validate function passes skip_token_capture=True, and removes it otherwise. Gym reads it from the top of the row in skips_token_capture. RL's Gym actor checks it in finish_capture. The figure follows one row of each kind, using the PR's own test values (reward 0.5, rollout id "val-1").
The two rows split at step β and join again at step β£: both results have the same keys, with empty message logs, because under capture the tokens live in TransferQueue, not in the reply. Only receipt differs. Training rows can never keep the mark. _prepare_nemo_gym_rows removes it, and so does the single controller's _build_inputs. That matters because Gym's dataset prep keeps a dataset row's mark. With capture off, Gym ignores the mark and RL never calls finish_capture.
RL driver, after
# driver process: validate() β run_nemo_gym_rollout_sync β run_async_nemo_gym_rollout def prepare_rows(rows, β¦, *, skip_token_capture=False): for row in rows: stamp sampling, group id, rollout index # unchanged if skip_token_capture: row[SKIP_KEY] = True # validation else: row.pop(SKIP_KEY, None) # training: never skip
Real code: _prepare_nemo_gym_rows, rollout_to_tq (grpo_sync)
RL's Gym actor, after
# Gym actor event loop: one task per finished rollout, run side by side async def finish_capture(task): row, result = await task if result is an error: return row, result if row.get(SKIP_KEY) is True: # Gym stored nothing for this row return row, {logs: [], full_result: result, receipt: None} return row, await receipt_mode(row, result) # reads the manifest, builds a receipt
Real code: finish_capture, _skipped_capture_result
Nothing reaches it yet, and no setting changes that. Step β runs today: every GRPO, distillation and grpo_sync validation call marks its rows. But those runs build their Gym actor without capture (grpo.py, distillation.py), so Gym ignores the mark and steps β‘ββ’ take the old path. Only the single controller passes token_capture to the Gym actor. It has no validation loop yet, and it removes the mark from every row. So the new skip branch in step β’ can't run until the single controller gets a validation loop.
input_message_log[0], so it can't use any result from step β£, captured or skipped. Whoever turns on validation with capture must read the reward from full_result instead. The review asks for a shorter docstring on _skipped_capture_result that points to the single controller's tracking issue, #5044. This PR and #5044 now link each other: the PR description names #5044, and a comment on #5044 tells whoever builds that validation loop to set the mark and read full_result.