Fix Issue #7: Save checkpoint before evaluation to prevent training loss#112
Open
teee32 wants to merge 2 commits intokarpathy:masterfrom
Open
Fix Issue #7: Save checkpoint before evaluation to prevent training loss#112teee32 wants to merge 2 commits intokarpathy:masterfrom
teee32 wants to merge 2 commits intokarpathy:masterfrom
Conversation
Standardize train.py and prepare.py to fail with actionable CLI messages for unsupported CUDA environments and missing or corrupted setup artifacts, so common setup mistakes no longer surface as raw tracebacks or low-level file errors. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…aining loss - Save pre-evaluation checkpoint before each evaluation - Retry failed evaluations up to 3 times with exponential backoff - Use smaller batch size on retry to avoid OOM - Add GPU memory diagnostics for debugging - Clear GPU memory and reset stats between retry attempts - Clean up checkpoint file after successful evaluation This prevents 5 minutes of training from being lost when evaluation crashes (OOM, CUDA errors, etc.) during unattended overnight experiments. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
When running unattended overnight experiments, if evaluation crashes (OOM, CUDA errors, etc.) after the full 5-minute training budget, the entire training run is lost.
Solution
Changes
train.py: +217 lines (checkpoint utilities, retry logic, memory management)Test plan
🤖 Generated with Claude Code