-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Expose weights_only for loading checkpoints with Trainer, LightningModule, LightningDataModule
#21072
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose weights_only for loading checkpoints with Trainer, LightningModule, LightningDataModule
#21072
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #21072 +/- ##
=======================================
Coverage 87% 87%
=======================================
Files 269 269
Lines 23732 23744 +12
=======================================
+ Hits 20557 20569 +12
Misses 3175 3175 |
… based on ckpt version
d7cb702 to
601e300
Compare
weights_only=True by defaultweights_only=True by default for loading weights
|
@Borda I wanted to get your opinion on something before moving forward. I've added My issue right now is with resuming training from a checkpoint with
I'm leaning towards option 1, but it involves changing up |
The cleanest way would probably be 1), but it brings so many new arguments for a marginal use... so personally I would go with 2) |
|
Seems like an actual issue than a flaky test behavior |
…rs to torch's default (`True`) See PR on this change: Lightning-AI/pytorch-lightning#21072
Set `weights_only=False` when loading ckpts, since Lightning now defers to torch's default (`True`) * See PR on this change: Lightning-AI/pytorch-lightning#21072 --------- Co-authored-by: Nathan Painchaud <[email protected]>
## Description [this](Lightning-AI/pytorch-lightning#21072) change in ptl 2.6.0 means we have to explicitly specify "weight_only=False" when calling `BaseGraphModule.load_from_checkpoint` (nice spot Ana!) ***As a contributor to the Anemoi framework, please ensure that your changes include unit tests, updates to any affected dependencies and documentation, and have been tested in a parallel setting (i.e., with multiple GPUs). As a reviewer, you are also responsible for verifying these aspects and requesting changes if they are not adequately addressed. For guidelines about those please refer to https://anemoi.readthedocs.io/en/latest/*** By opening this pull request, I affirm that all authors agree to the [Contributor License Agreement.](https://github.com/ecmwf/codex/blob/main/Legal/contributor_license_agreement.md)
What does this PR do?
Fixes #20450 #20058 #20643
Before submitting
PR review
Anyone in the community is welcome to review the PR.
Before you start reviewing, make sure you have read the review guidelines. In short, see the following bullet-list:
Reviewer checklist
📚 Documentation preview 📚: https://pytorch-lightning--21072.org.readthedocs.build/en/21072/