Skip to content

feat(rollout): add periodic partial-rollout recovery snapshots - #3508

Draft
macandro96 wants to merge 4 commits into
amahishi/partial-rollout-recoveryfrom
amahishi/partial-rollout-ledger
Draft

feat(rollout): add periodic partial-rollout recovery snapshots#3508
macandro96 wants to merge 4 commits into
amahishi/partial-rollout-recoveryfrom
amahishi/partial-rollout-ledger

Conversation

@macandro96

@macandro96 macandro96 commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds frequent partial-rollout snapshots and makes streamed optimizer steps recoverable from their last durable trainer anchor.

  • Adds rollout_checkpointing.interval_s, keep_latest_k, and restore_mode.
  • Captures native TQ state, replay metadata, rollout lineage, and the dataloader cursor as one checkpoint-barrier cut.
  • Supports bootstrap snapshots before step 1 and anchors later snapshots to the latest durable trainer checkpoint.
  • Publishes through a temporary directory, validation, COMMITTED, atomic rename, and an atomically updated LATEST pointer.
  • Retains the previous committed snapshot when a periodic save fails.
  • Allows periodic snapshots while a streamed optimizer step is active.
  • Keeps training-claimed rows durable in TQ until the optimizer step finishes.
  • Persists claimed groups as replayable FINALIZED ownership, so restart discards uncheckpointed gradients and replays the complete step from its durable trainer anchor.
  • Preserves restored target-step dispatch and validates sampler capacity to avoid rollout-pump deadlocks.
  • Includes crash/restart functional coverage for sibling reuse and streamed-step snapshots.

Stack

Configuration

checkpointing:
  enabled: true
  metric_name: null

data_plane:
  checkpointing_enabled: true

token_capture:
  enabled: true

rollout_checkpointing:
  interval_s: 60
  keep_latest_k: 2
  restore_mode: latest

interval_s: null disables periodic rollout snapshots.

Bootstrap snapshots live under bootstrap/rollout_snapshots/; later snapshots live under the matching durable step_N/rollout_snapshots/ anchor.

Streamed-step recovery

If a snapshot is taken after 2 of 8 prompt groups have contributed uncommitted gradients, the snapshot retains those rows as replayable finalized ownership. Restart loads the durable trainer anchor, discards the uncheckpointed 2/8 gradients, and trains all eight groups exactly once.

Validation

  • Unit coverage includes periodic scheduling, checkpoint cuts, atomic publication, retention, failure fallback, active streamed steps, restored dispatch state, and bootstrap recovery.
  • Functional scripts cover partial sibling reuse and active streamed-step rollback/replay.
  • The PR remains draft while the refreshed functionals and full CI are rerun.

@copy-pr-bot

copy-pr-bot Bot commented Aug 5, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@macandro96 macandro96 changed the title amahishi/partial rollout ledger feat(rollout): add periodic partial-rollout recovery snapshots Aug 5, 2026
@macandro96
macandro96 force-pushed the amahishi/partial-rollout-ledger branch from 1f5b0be to ff78ebe Compare August 5, 2026 23:37
@macandro96
macandro96 force-pushed the amahishi/partial-rollout-ledger branch from b2a048c to c1fdb07 Compare August 10, 2026 19:39
@macandro96
macandro96 force-pushed the amahishi/partial-rollout-ledger branch from c1fdb07 to 18d67cd Compare August 10, 2026 22:57
@github-actions

Copy link
Copy Markdown

✅ Submodule Fast-Forward Check Results

Check based on commit: 18d67cd (PR #3508 from amahishi/partial-rollout-ledger)

✅ Submodules that are properly updated:

Gym: ✅ PR branch is ahead of amahishi/sc-tq-token-capture-recovery branch (fast-forward)

All submodule changes look good! ✨

Add periodic TQ, replay, lineage, and dataloader snapshots anchored to durable trainer state. Roll back groups claimed by an unfinished optimizer step into replayable state during persistence, restore them on restart, and cover partial-sibling plus 2/8 and 6/8 streamed recovery paths.

(cherry picked from commit 98c196f)
Set checkpointing.metric_name=null in every SC recovery harness that enables checkpointing, since SC has no validation loop. Include phase-one log tails when crash-driven recovery tests exit before producing their target snapshot.

(cherry picked from commit a5e9a16)
@macandro96
macandro96 force-pushed the amahishi/partial-rollout-ledger branch from f1d8ad0 to 9355cc5 Compare August 24, 2026 21:03
@macandro96

Copy link
Copy Markdown
Contributor Author

Will be superseded by #3924

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant