pytorch-lightning
29abe6e4 - Expose `weights_only` for loading checkpoints with `Trainer`, `LightningModule`, `LightningDataModule` (#21072)

Commit
137 days ago
Expose `weights_only` for loading checkpoints with `Trainer`, `LightningModule`, `LightningDataModule` (#21072) * change weights_only default to True * add docs on weights_only arg * add weights_only arg to checkpoint save. weights_only during test set based on ckpt version * add weights_only arg to checkpoint_io * woops, reverting changes * permissions too * fix link * fix another link * datamodule weights_only args * wip: try safe_globals context manager for tests * add weights_only arg to _run_standard_hparams_test * weights_only=False when adding extra_args * switch to lightning_utilities.cli requirements set-oldest (#21077) * bump: try `deepspeed >=0.14.1,<=0.15.0` (#21076) * try `deepspeed >=0.14.1,<=0.15.0` * drop from oldest * pip uninstall -y deepspeed * error::DeprecationWarning * weights_only=True default for torch>=2.6 * changelog * ignore torch.load futurewarning * add .* * will this woork * weights_only according pl version * set env var TORCH_FORCE_NO_WEIGHTS_ONLY_LOAD=1 for pl < 1.5.0 * weights_only=False for omegaconf hparams test * default to weights_only=true for loading from state_dict from url * weights_only=False for hydra * Update src/lightning/fabric/utilities/cloud_io.py Co-authored-by: Jirka Borovec <6035284+Borda@users.noreply.github.com> * defaults for weights_only in torch.hub.load_state_dict_from_url * default to weights_only=False for torch.hub.load_state_dict_from_url * add weights_only to trainer.fit, validate, test, predict * fix tests * add weights_only arg * specify weights_only kwarg * weights_only for fsdp load * Apply suggestions from code review * Apply suggestions from code review * default is none * add weights_only args to strategies * trainer default to weights_only=None * wip: fix typing dump_checkpoint * Apply suggestions from code review * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * weights_only as last arg * asset called with none * weights_only=False for torch>=2.6 in tests * fix changelog description * Empty-Commit * Empty-Commit * trigger ci * skip ddp_fork on macos --------- Co-authored-by: Nicki Skafte Detlefsen <skaftenicki@gmail.com> Co-authored-by: Jirka Borovec <6035284+Borda@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: thomas chaton <thomas@grid.ai> Co-authored-by: Jirka B <j.borovec+github@gmail.com> Co-authored-by: jirka <jirka.borovec@seznam.cz> Co-authored-by: Deependu <deependujha21@gmail.com>
Author
Parents
Loading