-
Notifications
You must be signed in to change notification settings - Fork 175
feat: Add checkpoint forking functionality #253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
+907
−98
Conversation
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
acef5c8
to
2d34eba
Compare
This PR adds the ability to fork checkpoints from existing models, which is useful when training goes off the rails and you want to restart from a previous checkpoint with different parameters. Key changes: - Added `_experimental_fork_checkpoint` method to fork from existing models - Changed S3 pulling API from `latest_only` to `only_step` parameter for cleaner interface - Changed `before_step` to `not_after_step` with <= comparison for more intuitive behavior - Updated to only support new checkpoint structure (checkpoints/ subdirectory) - Added debugging output to help diagnose S3 sync issues Example usage: ```python await backend._experimental_fork_checkpoint( model, from_model="email-agent-224", from_s3_bucket=os.environ["BACKUP_BUCKET"], not_after_step=1381, verbose=True, ) ``` 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Created new Features section in documentation - Added comprehensive checkpoint forking guide - Added model 230 that forks from model 206 at step 90 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Moved additional-histories.mdx from Fundamentals to Features section - Updated sidebar navigation to show both features 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Add forked-run.webp image showing run recovery example - Move experimental note below introduction for better flow - Update section title for clarity 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
@bradhilton I think this is ready for review! |
- Remove unused Literal import from project_types.py - Auto-formatted by ruff 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
bradhilton
approved these changes
Jul 17, 2025
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
This PR adds the ability to fork checkpoints from existing models, which is useful when training goes off the rails and you want to restart from a previous checkpoint with different parameters.
Changes
_experimental_fork_checkpoint
method to Backend and LocalBackend classeslatest_only
boolean toonly_step
parameter that accepts either an int or "latest"Example Usage
Key API Changes
only_step parameter on
only_step=None
- Pull all checkpoints (default)only_step="latest"
- Pull only the latest checkpointonly_step=1234
- Pull only checkpoint 1234