Add torch_checkpointing save config plumbing (#4058) - #4058
Open
ivy-zhou wants to merge 1 commit into
Open
Conversation
ivy-zhou
requested review from
fegin,
tianyu-l,
wconstab and
wwwjn
as code owners
August 3, 2026 23:08
|
@ivy-zhou has exported this pull request. If you are a Meta employee, you can view the originating Diff in D112860926. |
Summary: Adds TorchTitan-facing configuration for selecting the `torch_checkpointing` save backend and configuring backend-specific behavior. The default remains DCP, the `torch_checkpointing` options are scoped under their own dataclass, and validation rejects unsupported backend values and HF final-save mode for the new backend. Differential Revision: D112860926
ivy-zhou
force-pushed
the
export-D112860926
branch
from
August 5, 2026 17:26
8670204 to
2c4efb2
Compare
tianyu-l
reviewed
Aug 5, 2026
Comment on lines
+405
to
+411
| save_backend: Literal["dcp", "torch_checkpointing"] = "dcp" | ||
| """Checkpoint save backend. `dcp` keeps current behavior.""" | ||
|
|
||
| torch_checkpointing: TorchCheckpointingConfig = field( | ||
| default_factory=TorchCheckpointingConfig | ||
| ) | ||
| """Options that only apply when `save_backend="torch_checkpointing"`.""" |
Contributor
There was a problem hiding this comment.
How does this compare with "having another CheckpointManager"?
I feel intertwining the logic would make it difficult to read / review / deprecate DCPv1.
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:
Adds TorchTitan-facing configuration for selecting the
torch_checkpointingsave backend and configuring backend-specific behavior. The default remains DCP, thetorch_checkpointingoptions are scoped under their own dataclass, and validation rejects unsupported backend values and HF final-save mode for the new backend.Differential Revision: D112860926