Conversation
shuangwu
marked this pull request as ready for review
September 18, 2026 14:05
shuangwu
marked this pull request as draft
September 18, 2026 17:41
shuangwu
marked this pull request as ready for review
September 18, 2026 18:14
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.
Summary
Support consistent resumption of application-owned checkpoints through an instance-owned controller adapter. This is recovery, not exact replay: unfinished work may be regenerated and some previously consumed prompts may repeat; an advanced fetched cursor must not silently skip uncommitted work.
set_epoch, before constructing/consuming its iterator. Explicit missing/corrupt checkpoints fail; automatic discovery misses bootstrap; step zero is valid.SamplingReplayLedgeradvances a safe sampling boundary only across a contiguous settled prefix. Out-of-order updates preserve an earlier replay boundary and its remaining-work budget. Snapshots contain sampling state, not rollout payloads.CheckpointManifestpublishes local-file checkpoints only after the required artifacts are durable. Atomic no-replace publication, artifact hashes, expected shard sets and compatibility checks reject incomplete, mixed or incompatible saves.Ownership and scope
Cosmos owns restore ordering, initialization of controller progress and old-attempt rollout rejection. Applications retain trainer serialization, checkpoint discovery, sampler/shard semantics, and the connection between issued work, completed updates and saved state. The replay ledger and POSIX manifest are reusable opt-in helpers, not automatic conversion of native checkpoints or a new mandatory checkpoint format.
Applications publish only after all required trainer shards have saved the same completed-update boundary. Their trainer validates the same checkpoint and restores model, optimizer, scheduler, RNG and any additional algorithm state before reporting agreement. The adapter restores the corresponding safe sampling state. Configured hard training-step limits still apply to replayed work.
No persisted rollout queues, partial-generation restoration, mandatory rollout drain, deterministic async scheduling, or identical future numerical trajectory is required. Resume starts fresh worker/transport processes; this is not live recovery of an existing worker cohort.
Validation conclusions
Reproduction and limits
The portable save/restart fixture is included as
tests/controller_resume_replay_canary.py, with CPU/GPU launch instructions. Negative/failure-injection cases are intests/test_checkpoint_replay.pyandtests/test_resume_execution_fence.py. The earlier exact-parity fixture remains available astests/controller_resume_gpu_canary.py; its parity is not a general replay guarantee.The distributed fixture directly exercises the public adapter and helpers with application-owned trainer serialization/shard cursors. It is not a full application-launcher or large-model sharded-checkpoint validation. Custom formats/stores must implement the documented artifact validation and publication obligations. See
docs/controller_resume_adapter.md.Independence
Based directly on upstream main. Does not include the watchdog, W&B, requested-stop, or metadata fail-fast PRs. No downstream runtime/wheel patch is added.