Check for checkpoints#84
Merged
Merged
Conversation
michaelmckinsey1
force-pushed
the
better-checkpointing
branch
from
July 9, 2026 19:57
5808ac3 to
9db02a0
Compare
michaelmckinsey1
marked this pull request as ready for review
July 9, 2026 19:58
PatrickRMiles
requested changes
Jul 16, 2026
| self.optimizer.zero_grad(set_to_none=True) | ||
|
|
||
| def load_from_checkpoint(self) -> int: | ||
| def load_from_checkpoint(self, require_checkpoint: bool = False) -> int: |
Collaborator
There was a problem hiding this comment.
Since we only call load_from_checkpoint on restart, will there ever be a case where we would want require_checkpoint to be False? If not, maybe we can remove this arg altogether and just require finding a valid existing checkpoint in the following logic.
Collaborator
Author
There was a problem hiding this comment.
No I think you are right. I have removed the extra arg and we just assume the checkpoint is required now
PatrickRMiles
approved these changes
Jul 23, 2026
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.
I have been using checkpoints via
and I noticed if an incorrect path is specified, e.g. if scaffold can't find a checkpoint, it will start from scratch. This led to me accidentally restarting the same jobs. I think we should check for the checkpoint file first and exit if the user made a mistake, instead of starting from the beginning and wasting compute cycles.