Repository navigation
Conversation
Pass DefaultSavePlanner(enable_plan_caching=True) to both DCP saves, so every save after the first in a process reuses the previous global plan instead of rank 0 gathering and validating every rank's plan again. A rank whose tensors' names, shapes or shards change sends a new plan and rank 0 replans.
MarioSieg
marked this pull request as ready for review
December 3, 2026 19:44
This branch has not been deployed
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
DefaultSavePlanner(enable_plan_caching=True)to both DCP saves inCheckpointManager(the synchronous save and the async writer thread).docs/training.md.Test plan
uvx ruff check/uvx ruff format --checkonckpt.pypytest tests/unit/train/test_ckpt.py tests/unit/train/test_checkpoint_writer.py tests/unit/train/test_checkpoint_model_files.py(CPU): 17 passedCheckpointWriter(smallmax_file_bytes, so ranks split into several files) with plan caching on, including a shape change at the fourth save; each checkpoint loads back bitwise equalNote
Low Risk
Checkpoint write path only; plan caching is a PyTorch DCP optimization with replan on layout changes, and saves still read fresh tensor values.
Overview
Trainer checkpoints now pass
DefaultSavePlanner(enable_plan_caching=True)to PyTorch DCP on both the synchronous save path and the async background writer, so after the first save in a process the distributed save plan is reused instead of rank 0 re-gathering and validating every rank's plan on each step.Planning once is documented under asynchronous checkpoints: the first save still plans globally; later saves keep the cached plan while tensor names, shapes, and shards are unchanged, and replan only when a rank's layout changes. Checkpoint contents and behavior are unchanged—this is always-on with no new config knob.
Reviewed by Cursor Bugbot for commit 419cfe6. Bugbot is set up for automated code reviews on this repo. Configure here.