Skip to content

Add torch_checkpointing save config plumbing (#4058) - #4058

Open
ivy-zhou wants to merge 1 commit into
pytorch:mainfrom
ivy-zhou:export-D112860926
Open

Add torch_checkpointing save config plumbing (#4058)#4058
ivy-zhou wants to merge 1 commit into
pytorch:mainfrom
ivy-zhou:export-D112860926

Conversation

@ivy-zhou

@ivy-zhou ivy-zhou commented Aug 3, 2026

Copy link
Copy Markdown

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

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Aug 3, 2026
@meta-codesync

meta-codesync Bot commented Aug 3, 2026

Copy link
Copy Markdown

@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
@meta-codesync meta-codesync Bot changed the title Add torch_checkpointing save config plumbing Add torch_checkpointing save config plumbing (#4058) Aug 5, 2026
@ivy-zhou
ivy-zhou force-pushed the export-D112860926 branch from 8670204 to 2c4efb2 Compare August 5, 2026 17:26
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"`."""

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this compare with "having another CheckpointManager"?

I feel intertwining the logic would make it difficult to read / review / deprecate DCPv1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/8gpu CLA Signed This label is managed by the Meta Open Source bot. meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants