Fix: Crash on attempted checkpoint save when training loop is too fast #567#600
Open
kf-rahman wants to merge 3 commits intosdatkinson:mainfrom
Open
Fix: Crash on attempted checkpoint save when training loop is too fast #567#600kf-rahman wants to merge 3 commits intosdatkinson:mainfrom
kf-rahman wants to merge 3 commits intosdatkinson:mainfrom
Conversation
…from breaking when trying to save checkpoints
sdatkinson
previously approved these changes
Nov 27, 2025
Owner
sdatkinson
left a comment
There was a problem hiding this comment.
Thanks for this PR!
There are a few suggestions I'd love for you to address if possible.
Either way, it's a step forward so if you don't address them in, say, a week, then I'll merge as-is.
Author
|
Hey, addressed few of the changes. Sorry couldnt get to it earlier. Thanks for the review :) |
Author
|
Hey was there anything elses needed for this or is it good to go? @sdatkinson |
sdatkinson
reviewed
Apr 6, 2026
Owner
sdatkinson
left a comment
There was a problem hiding this comment.
A few nits. I can grab them.
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
Problem: back-to-back .ckpt then .nam writes could intermittently fail on fast loops.
Solution: bounded try, excepts around both writes.
Tests: added tight-loop save-every-step test; deterministic monkeypatch test to simulate flaky writes; both pass post-fix.
Scope: no behavior change except resilience; logs a warning on retries.
Changes
super()._save_checkpoint()and.export()Testing
pytest tests/test_save_checkpoint_fail.py→ 2 passed