feat(checkpoint): add durable turn-level rollout recovery - #3349
Draft
macandro96 wants to merge 43 commits into
Draft
feat(checkpoint): add durable turn-level rollout recovery#3349macandro96 wants to merge 43 commits into
macandro96 wants to merge 43 commits into
Conversation
Keep the logical rollout ID and attempt index independent from the attempt-qualified capture key so checkpoint participants can fence retries without depending on capture configuration. Expose the authoritative model call ID on captured responses for later boundary reconciliation. Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>
Expose versioned checkpoint capabilities on every Gym server and provide a shared phase fence for idempotent control operations. Reject stale non-final operations after resume so an old coordinator cannot mistake an accepting server for a prepared one. Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>
Close admission atomically in each server process and aggregate worker acknowledgements and in-flight counts through a service-level Unix socket coordinator. Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>
Keep a failed restore paused and observable so the coordinator can retry or abort it safely. Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>
Move the checkpoint implementation under nemo_gym._checkpoint until its contracts are ready for public support. Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>
Pause policy generation at a quiescent cut and checkpoint token-free capture custody while leaving framework-owned staged token arrays to TransferQueue. Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>
Namespace model artifacts, reject changing commit exclusions, and link the first restored call to its verified parent exactly once. Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>
Track one active run per rollout attempt, park it at typed turn boundaries, and commit or restore continuation records only through checkpoint control operations. Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>
Block publication on boundary-less parks or unacknowledged results, separate retirement from acknowledgement, and cancel retired execution tasks. Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>
Capture complete tool turns in the shared agent participant and reconstruct the next attempt from the last committed model call and conversation boundary. Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>
Retry checkpoint refusals without recording false tool failures and stop retired inner handlers from mutating successor state. Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>
Preserve accumulated episode state at completed environment steps so replacement attempts skip reset and continue with consistent reward, usage, and model history. Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>
Retry refused model and resource calls from the committed boundary without adding an extra turn at the step limit. Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>
Serialize per-attempt mutations, export all known sessions as one prepared cut, and require environments to atomically activate the complete restored state set. Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>
Bind state to execution identity, serialize mutations with snapshots, and reject unsafe restore or untracked stateful traffic. Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>
Restore Gymnasium, workplace, and counter sessions under replacement attempt identities while preserving resource revisions at agent boundaries. Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>
Require explicit checkpoint opt-in, bind state only after successful session creation, and retire adapter-owned state safely. Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>
Exercise prepare, commit, restore, explicit resume, lineage handoff, resource revisions, and straggler retirement across participants. Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>
Signed-off-by: Anish Mahishi <amahishi@nvidia.com>
Signed-off-by: Anish Mahishi <amahishi@nvidia.com>
Signed-off-by: Anish Mahishi <amahishi@nvidia.com>
Signed-off-by: Anish Mahishi <amahishi@nvidia.com>
Signed-off-by: Anish Mahishi <amahishi@nvidia.com>
Signed-off-by: Anish Mahishi <amahishi@nvidia.com>
Signed-off-by: Anish Mahishi <amahishi@nvidia.com>
Signed-off-by: Anish Mahishi <amahishi@nvidia.com>
Signed-off-by: Anish Mahishi <amahishi@nvidia.com>
Signed-off-by: Anish Mahishi <amahishi@nvidia.com>
Signed-off-by: Anish Mahishi <amahishi@nvidia.com>
Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>
Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>
Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>
Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>
Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>
Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>
Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>
Signed-off-by: Anish Mahishi <amahishi@nvidia.com>
Signed-off-by: Anish Mahishi <amahishi@nvidia.com>
Signed-off-by: Anish Mahishi <amahishi@nvidia.com>
Signed-off-by: Anish Mahishi <amahishi@nvidia.com>
Signed-off-by: Anish Mahishi <amahishi@nvidia.com>
Signed-off-by: Anish Mahishi <amahishi@nvidia.com>
macandro96
force-pushed
the
amahishi/gym-turn-level-recovery
branch
from
September 14, 2026 01:40
6473f49 to
6bba7b8
Compare
Signed-off-by: Anish Mahishi <amahishi@nvidia.com>
macandro96
marked this pull request as draft
September 14, 2026 03:47
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?
Summary
Adds durable turn-level rollout recovery to NeMo Gym on top of #2946.
This change allows an accepted multi-turn rollout to stop at a committed agent/environment boundary, persist coordinated Gym state, and continue under a replacement rollout attempt after process or job restart.
What this adds above #2946
#2946 introduces checkpoint adapters for the initial stateful environments.
This PR integrates those adapters into the complete Gym rollout lifecycle:
Recovery flow
Nremains fenced.N+1while admissionremains paused.
turn without replaying completed resource mutations.
Correctness guarantees
/runresults remain available until acknowledgedScalability
Checkpoint artifacts use:
This avoids scanning or materializing one loose checkpoint file per active
rollout during restore.
Testing
Scope
Included:
Not included:
Stack
Checklist
pre-commit run --all-files) (so CI lint/format/copyright pass).git commit -s) (so the DCO check passes).