-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Closed
Labels
checkpointingRelated to checkpointingRelated to checkpointingfeatureIs an improvement or enhancementIs an improvement or enhancement
Milestone
Description
Description & Motivation
PyTorch will default the torch.load(weights_only=) option to True in the future, and started emitting FutureWarning in 2.4. Since Lightning allows storing all kinds of data into the checkpoint (mainly through save_hyperparameters() and the on_save_checkpoint hooks), so far we have to explicitly set weights_only=False internally to be able to load checkpoints. But we could also expose this argument as a flag for the user to choose how strict they want to be when loading checkpoints.
Pitch
In Fabric.load, expose weights_only.
In PyTorch Lightning, either add fit(..., load_weights_only=...) or add an attribute to the LightningModule (similar to how we handle strict_loading).
Alternatives
No response
Additional context
No response
cc @Borda @awaelchli
ORippler, PhilJahn, fionnwhelan and jykr
Metadata
Metadata
Assignees
Labels
checkpointingRelated to checkpointingRelated to checkpointingfeatureIs an improvement or enhancementIs an improvement or enhancement