Repository navigation
Conversation
Signed-off-by: Masahiro Tanaka <[email protected]>
Signed-off-by: Masahiro Tanaka <[email protected]>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b95b545525
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| try: | ||
| last_submission = self.__dict__.pop("_submitted_checkpoint", None) | ||
| if last_submission is not None and self.checkpoint_engine.get_commit_info() is last_submission: | ||
| self._commit_decoupled_checkpoint(wait_for_all_ranks=True) |
There was a problem hiding this comment.
Synchronize destroy commit failures before barriers
If a data-parallel writer's checkpoint subprocess dies after an earlier checkpoint has initialized checkpoint_size, a later save_checkpoint() still returns successfully because DecoupledCheckpointEngine.save() silently returns for a dead worker. During this call, commit() then raises on that writer, while non-writer ranks complete commit() and block in _commit_decoupled_checkpoint()'s barriers; the failed rank runs cleanup in finally and never reaches them, so destroy() deadlocks instead of reporting or cleanly handling the failed save. Catch and collectively synchronize the local commit result before entering these barriers.
Useful? React with 👍 / 👎.
| """Release engine resources. All ranks must call this with a pending decoupled checkpoint.""" | ||
| try: | ||
| last_submission = self.__dict__.pop("_submitted_checkpoint", None) | ||
| if last_submission is not None and self.checkpoint_engine.get_commit_info() is last_submission: |
There was a problem hiding this comment.
Finalize DataStates checkpoints during destroy
With datastates_ckpt enabled, DataStatesCheckpointEngine.is_decoupled() is true and create() stores self.commit_info, but it does not override get_commit_info() (the base method always returns None). Consequently this identity check can never pass: cleanup() persists the final files, but rank 0 never executes _commit_decoupled_checkpoint() and never updates latest when save_latest=True, so a restart still loads an older checkpoint. Implement the pending-info accessor/finalization for this sibling asynchronous backend as well.
AGENTS.md reference: AGENTS.md:L19-L19
Useful? React with 👍 / 👎.
With
decoupled=True, DeepSpeed writes checkpoint files in the background. Suppose thelatestfile containsstep100and every rank ends training with these calls.The files for
lastare on disk when the job exits, butlateststill saysstep100. On the next run,engine.load_checkpoint(save_dir)readslatestand restoresstep100. Iflastwas the first checkpoint,latestis missing and the call finds nothing.With this PR,
engine.destroy()now waits for every rank to finish writing its checkpoint files. For a successful save withsave_latest=True(the default), rank 0 then writes the checkpoint name tolatestbefore any rank returns. In this example, the next run restoreslast. A failed save or a save withsave_latest=Falseleaveslatestas it was.