Add checkpointing support for Tinker SkyRL backend #990
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
Implements checkpointing for the Tinker SkyRL backend, enabling
sl_loop.pyto run unchanged with full checkpoint save/load/resume functionality.Builds on PR #986 (Tinker API server integration)
Changes
1. Checkpoint Implementation (
skyrl_train/tinker/backends/skyrl_train.py)Implemented 3 checkpoint methods (~70 lines):
save_checkpoint(output_path, model_id)WorkerDispatch.save_checkpoint()which handles FSDP distributed checkpointingmodel_world_size_4_rank_*.pt)load_checkpoint(checkpoint_path, model_id)save_sampler_checkpoint(output_path, model_id)WorkerDispatch.save_hf_model()for clean model export2. Performance Optimization
Uncompressed tar instead of gzip (commit 181518b):
3. Bug Fixes
Parent directory creation (commit 29dd0ad):
os.makedirs(os.path.dirname(output_path), exist_ok=True)Architecture
Expected Usage
With this PR,
sl_loop.pycan run unchanged with checkpointing:Checkpointing behavior:
save_every)checkpoints.jsonlTesting Status
What's verified:
What needs testing (once Ray issues resolved):
Files Changed
skyrl_train/tinker/backends/skyrl_train.py- Implemented 3 checkpoint methods (~80 lines)Next Steps
sl_loop.pyPerformance Notes
Checkpoint save time (estimated):
Future optimization: Move checkpoint saving to background thread to avoid blocking training loop.
🤖 Generated with Claude Code