lightning 2.3.3__tar.gz → 2.4.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {lightning-2.3.3 → lightning-2.4.0}/.actions/assistant.py +13 -20
- {lightning-2.3.3/src/lightning.egg-info → lightning-2.4.0}/PKG-INFO +25 -21
- {lightning-2.3.3 → lightning-2.4.0}/README.md +12 -6
- {lightning-2.3.3 → lightning-2.4.0}/pyproject.toml +1 -0
- {lightning-2.3.3 → lightning-2.4.0}/requirements/base.txt +1 -2
- {lightning-2.3.3 → lightning-2.4.0}/requirements/fabric/base.txt +1 -2
- {lightning-2.3.3 → lightning-2.4.0}/requirements/fabric/examples.txt +1 -1
- {lightning-2.3.3 → lightning-2.4.0}/requirements/fabric/test.txt +1 -0
- {lightning-2.3.3 → lightning-2.4.0}/requirements/pytorch/base.txt +1 -2
- {lightning-2.3.3 → lightning-2.4.0}/requirements/pytorch/examples.txt +1 -1
- {lightning-2.3.3 → lightning-2.4.0}/requirements/pytorch/test.txt +3 -2
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/__setup__.py +5 -5
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/CHANGELOG.md +24 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/__init__.py +1 -4
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/fabric.py +4 -6
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/loggers/csv_logs.py +0 -1
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/loggers/tensorboard.py +1 -6
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/plugins/collectives/torch_collective.py +2 -2
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/plugins/precision/amp.py +3 -2
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/strategies/deepspeed.py +6 -2
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/strategies/fsdp.py +18 -31
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/strategies/model_parallel.py +12 -18
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/utilities/apply_func.py +11 -4
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/utilities/cloud_io.py +12 -2
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/utilities/distributed.py +16 -1
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/utilities/imports.py +5 -6
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/utilities/init.py +0 -3
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/utilities/load.py +1 -1
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/utilities/logger.py +9 -6
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/utilities/optimizer.py +11 -3
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/utilities/registry.py +5 -11
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/utilities/seed.py +43 -19
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/utilities/testing/_runif.py +6 -8
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/utilities/throughput.py +0 -3
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/CHANGELOG.md +33 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/__init__.py +0 -2
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/callbacks/model_checkpoint.py +3 -1
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/callbacks/model_summary.py +11 -1
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/callbacks/progress/progress_bar.py +1 -1
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/callbacks/progress/rich_progress.py +19 -22
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/callbacks/progress/tqdm_progress.py +9 -4
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/callbacks/pruning.py +4 -4
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/callbacks/rich_model_summary.py +4 -1
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/callbacks/stochastic_weight_avg.py +5 -5
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/cli.py +19 -5
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/core/datamodule.py +2 -2
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/core/module.py +6 -28
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/demos/__init__.py +1 -0
- lightning-2.4.0/src/lightning/pytorch/demos/lstm.py +98 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/demos/transformer.py +2 -3
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/loggers/csv_logs.py +0 -3
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/loggers/tensorboard.py +0 -4
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/loops/utilities.py +0 -4
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/plugins/precision/amp.py +3 -2
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/plugins/precision/deepspeed.py +2 -2
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/plugins/precision/precision.py +1 -1
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/profilers/advanced.py +25 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/profilers/pytorch.py +24 -7
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/strategies/fsdp.py +9 -16
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/strategies/launchers/multiprocessing.py +12 -10
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/strategies/launchers/subprocess_script.py +1 -1
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/strategies/model_parallel.py +6 -6
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/strategies/strategy.py +1 -1
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/trainer/call.py +14 -6
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/trainer/connectors/logger_connector/result.py +6 -14
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/trainer/connectors/signal_connector.py +8 -27
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/trainer/trainer.py +1 -6
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/tuner/lr_finder.py +7 -4
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/utilities/_pytree.py +1 -1
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/utilities/compile.py +0 -5
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/utilities/model_helpers.py +6 -3
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/utilities/model_summary/model_summary.py +24 -8
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/utilities/model_summary/model_summary_deepspeed.py +5 -5
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/utilities/types.py +1 -1
- lightning-2.4.0/src/lightning/version.info +1 -0
- {lightning-2.3.3 → lightning-2.4.0/src/lightning.egg-info}/PKG-INFO +25 -21
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning.egg-info/SOURCES.txt +2 -2
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning.egg-info/requires.txt +24 -30
- lightning-2.4.0/src/version.info +1 -0
- lightning-2.3.3/src/lightning/app/__init__.py +0 -26
- lightning-2.3.3/src/lightning/version.info +0 -1
- lightning-2.3.3/src/version.info +0 -1
- {lightning-2.3.3 → lightning-2.4.0}/CITATION.cff +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/LICENSE +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/requirements/fabric/docs.txt +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/requirements/fabric/strategies.txt +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/requirements/pytorch/docs.txt +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/requirements/pytorch/extra.txt +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/requirements/pytorch/strategies.txt +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/setup.cfg +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/setup.py +0 -0
- /lightning-2.3.3/src/lightning/af9f07bb212d5f502afa93ec4c33977c308c6110fb2e6081 → /lightning-2.4.0/src/lightning/4a69c3efc087c81945f6226f6e1f7722e053a23ecfc6fe93 +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/__about__.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/__init__.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/__version__.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/data/__init__.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/_graveyard/__init__.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/_graveyard/tpu.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/accelerators/__init__.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/accelerators/accelerator.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/accelerators/cpu.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/accelerators/cuda.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/accelerators/mps.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/accelerators/registry.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/accelerators/xla.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/cli.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/connector.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/loggers/__init__.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/loggers/logger.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/plugins/__init__.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/plugins/collectives/__init__.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/plugins/collectives/collective.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/plugins/collectives/single_device.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/plugins/environments/__init__.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/plugins/environments/cluster_environment.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/plugins/environments/kubeflow.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/plugins/environments/lightning.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/plugins/environments/lsf.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/plugins/environments/mpi.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/plugins/environments/slurm.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/plugins/environments/torchelastic.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/plugins/environments/xla.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/plugins/io/__init__.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/plugins/io/checkpoint_io.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/plugins/io/torch_io.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/plugins/io/xla.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/plugins/precision/__init__.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/plugins/precision/bitsandbytes.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/plugins/precision/deepspeed.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/plugins/precision/double.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/plugins/precision/fsdp.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/plugins/precision/half.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/plugins/precision/precision.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/plugins/precision/transformer_engine.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/plugins/precision/utils.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/plugins/precision/xla.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/strategies/__init__.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/strategies/ddp.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/strategies/dp.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/strategies/launchers/__init__.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/strategies/launchers/launcher.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/strategies/launchers/multiprocessing.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/strategies/launchers/subprocess_script.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/strategies/launchers/xla.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/strategies/parallel.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/strategies/registry.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/strategies/single_device.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/strategies/single_xla.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/strategies/strategy.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/strategies/xla.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/strategies/xla_fsdp.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/utilities/__init__.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/utilities/consolidate_checkpoint.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/utilities/data.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/utilities/device_dtype_mixin.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/utilities/device_parser.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/utilities/enums.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/utilities/exceptions.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/utilities/rank_zero.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/utilities/spike.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/utilities/testing/__init__.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/utilities/types.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/utilities/warnings.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/wrappers.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/py.typed +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/_graveyard/__init__.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/_graveyard/_torchmetrics.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/_graveyard/hpu.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/_graveyard/precision.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/_graveyard/tpu.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/accelerators/__init__.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/accelerators/accelerator.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/accelerators/cpu.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/accelerators/cuda.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/accelerators/mps.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/accelerators/xla.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/callbacks/__init__.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/callbacks/batch_size_finder.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/callbacks/callback.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/callbacks/checkpoint.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/callbacks/device_stats_monitor.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/callbacks/early_stopping.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/callbacks/finetuning.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/callbacks/gradient_accumulation_scheduler.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/callbacks/lambda_function.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/callbacks/lr_finder.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/callbacks/lr_monitor.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/callbacks/on_exception_checkpoint.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/callbacks/prediction_writer.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/callbacks/progress/__init__.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/callbacks/spike.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/callbacks/throughput_monitor.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/callbacks/timer.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/core/__init__.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/core/hooks.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/core/mixins/__init__.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/core/mixins/hparams_mixin.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/core/optimizer.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/core/saving.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/demos/boring_classes.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/demos/mnist_datamodule.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/loggers/__init__.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/loggers/comet.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/loggers/logger.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/loggers/mlflow.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/loggers/neptune.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/loggers/utilities.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/loggers/wandb.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/loops/__init__.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/loops/evaluation_loop.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/loops/fetchers.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/loops/fit_loop.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/loops/loop.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/loops/optimization/__init__.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/loops/optimization/automatic.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/loops/optimization/closure.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/loops/optimization/manual.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/loops/prediction_loop.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/loops/progress.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/loops/training_epoch_loop.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/overrides/__init__.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/overrides/distributed.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/plugins/__init__.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/plugins/environments/__init__.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/plugins/io/__init__.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/plugins/io/async_plugin.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/plugins/io/checkpoint_plugin.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/plugins/io/torch_plugin.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/plugins/io/wrapper.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/plugins/io/xla_plugin.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/plugins/layer_sync.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/plugins/precision/__init__.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/plugins/precision/bitsandbytes.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/plugins/precision/double.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/plugins/precision/fsdp.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/plugins/precision/half.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/plugins/precision/transformer_engine.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/plugins/precision/xla.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/profilers/__init__.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/profilers/base.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/profilers/profiler.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/profilers/simple.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/profilers/xla.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/serve/__init__.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/serve/servable_module.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/serve/servable_module_validator.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/strategies/__init__.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/strategies/ddp.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/strategies/deepspeed.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/strategies/launchers/__init__.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/strategies/launchers/launcher.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/strategies/launchers/xla.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/strategies/parallel.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/strategies/single_device.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/strategies/single_xla.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/strategies/xla.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/trainer/__init__.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/trainer/configuration_validator.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/trainer/connectors/__init__.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/trainer/connectors/accelerator_connector.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/trainer/connectors/callback_connector.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/trainer/connectors/checkpoint_connector.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/trainer/connectors/data_connector.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/trainer/connectors/logger_connector/__init__.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/trainer/connectors/logger_connector/fx_validator.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/trainer/connectors/logger_connector/logger_connector.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/trainer/setup.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/trainer/states.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/tuner/__init__.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/tuner/batch_size_scaling.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/tuner/tuning.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/utilities/__init__.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/utilities/argparse.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/utilities/combined_loader.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/utilities/consolidate_checkpoint.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/utilities/data.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/utilities/deepspeed.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/utilities/enums.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/utilities/exceptions.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/utilities/grads.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/utilities/imports.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/utilities/memory.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/utilities/migration/__init__.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/utilities/migration/migration.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/utilities/migration/utils.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/utilities/model_summary/__init__.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/utilities/parameter_tying.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/utilities/parsing.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/utilities/rank_zero.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/utilities/seed.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/utilities/signature_utils.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/utilities/testing/__init__.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/utilities/testing/_runif.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/utilities/upgrade_checkpoint.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning/pytorch/utilities/warnings.py +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning.egg-info/dependency_links.txt +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning.egg-info/entry_points.txt +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning.egg-info/not-zip-safe +0 -0
- {lightning-2.3.3 → lightning-2.4.0}/src/lightning.egg-info/top_level.txt +0 -0
|
@@ -18,13 +18,13 @@ import re
|
|
|
18
18
|
import shutil
|
|
19
19
|
import tempfile
|
|
20
20
|
import urllib.request
|
|
21
|
-
from distutils.version import LooseVersion
|
|
22
21
|
from itertools import chain
|
|
23
22
|
from os.path import dirname, isfile
|
|
24
23
|
from pathlib import Path
|
|
25
|
-
from typing import Any, Dict, Iterable, Iterator, List, Optional, Sequence, Tuple
|
|
24
|
+
from typing import Any, Dict, Iterable, Iterator, List, Optional, Sequence, Tuple
|
|
26
25
|
|
|
27
|
-
from
|
|
26
|
+
from packaging.requirements import Requirement
|
|
27
|
+
from packaging.version import Version
|
|
28
28
|
|
|
29
29
|
REQUIREMENT_FILES = {
|
|
30
30
|
"pytorch": (
|
|
@@ -80,14 +80,15 @@ class _RequirementWithComment(Requirement):
|
|
|
80
80
|
out = str(self)
|
|
81
81
|
if self.strict:
|
|
82
82
|
return f"{out} {self.strict_string}"
|
|
83
|
+
specs = [(spec.operator, spec.version) for spec in self.specifier]
|
|
83
84
|
if unfreeze == "major":
|
|
84
|
-
for operator, version in
|
|
85
|
+
for operator, version in specs:
|
|
85
86
|
if operator in ("<", "<="):
|
|
86
|
-
major =
|
|
87
|
+
major = Version(version).major
|
|
87
88
|
# replace upper bound with major version increased by one
|
|
88
89
|
return out.replace(f"{operator}{version}", f"<{major + 1}.0")
|
|
89
90
|
elif unfreeze == "all":
|
|
90
|
-
for operator, version in
|
|
91
|
+
for operator, version in specs:
|
|
91
92
|
if operator in ("<", "<="):
|
|
92
93
|
# drop upper bound
|
|
93
94
|
return out.replace(f"{operator}{version},", "")
|
|
@@ -96,33 +97,25 @@ class _RequirementWithComment(Requirement):
|
|
|
96
97
|
return out
|
|
97
98
|
|
|
98
99
|
|
|
99
|
-
def _parse_requirements(
|
|
100
|
+
def _parse_requirements(lines: Iterable[str]) -> Iterator[_RequirementWithComment]:
|
|
100
101
|
"""Adapted from `pkg_resources.parse_requirements` to include comments.
|
|
101
102
|
|
|
102
103
|
>>> txt = ['# ignored', '', 'this # is an', '--piparg', 'example', 'foo # strict', 'thing', '-r different/file.txt']
|
|
103
104
|
>>> [r.adjust('none') for r in _parse_requirements(txt)]
|
|
104
105
|
['this', 'example', 'foo # strict', 'thing']
|
|
105
|
-
>>> txt = '\\n'.join(txt)
|
|
106
|
-
>>> [r.adjust('none') for r in _parse_requirements(txt)]
|
|
107
|
-
['this', 'example', 'foo # strict', 'thing']
|
|
108
106
|
|
|
109
107
|
"""
|
|
110
|
-
lines = yield_lines(strs)
|
|
111
108
|
pip_argument = None
|
|
112
109
|
for line in lines:
|
|
110
|
+
line = line.strip()
|
|
111
|
+
if not line or line.startswith("#"):
|
|
112
|
+
continue
|
|
113
113
|
# Drop comments -- a hash without a space may be in a URL.
|
|
114
114
|
if " #" in line:
|
|
115
115
|
comment_pos = line.find(" #")
|
|
116
116
|
line, comment = line[:comment_pos], line[comment_pos:]
|
|
117
117
|
else:
|
|
118
118
|
comment = ""
|
|
119
|
-
# If there is a line continuation, drop it, and append the next line.
|
|
120
|
-
if line.endswith("\\"):
|
|
121
|
-
line = line[:-2].strip()
|
|
122
|
-
try:
|
|
123
|
-
line += next(lines)
|
|
124
|
-
except StopIteration:
|
|
125
|
-
return
|
|
126
119
|
# If there's a pip argument, save it
|
|
127
120
|
if line.startswith("--"):
|
|
128
121
|
pip_argument = line
|
|
@@ -148,7 +141,7 @@ def load_requirements(path_dir: str, file_name: str = "base.txt", unfreeze: str
|
|
|
148
141
|
logging.warning(f"Folder {path_dir} does not have any base requirements.")
|
|
149
142
|
return []
|
|
150
143
|
assert path.exists(), (path_dir, file_name, path)
|
|
151
|
-
text = path.read_text()
|
|
144
|
+
text = path.read_text().splitlines()
|
|
152
145
|
return [req.adjust(unfreeze) for req in _parse_requirements(text)]
|
|
153
146
|
|
|
154
147
|
|
|
@@ -368,7 +361,7 @@ class AssistantCLI:
|
|
|
368
361
|
if not ln_ or ln_.startswith("#"):
|
|
369
362
|
final.append(line)
|
|
370
363
|
continue
|
|
371
|
-
req = list(
|
|
364
|
+
req = list(_parse_requirements([ln_]))[0]
|
|
372
365
|
if req.name not in packages:
|
|
373
366
|
final.append(line)
|
|
374
367
|
print(final)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: lightning
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.4.0
|
|
4
4
|
Summary: The Deep Learning framework to train, deploy, and ship AI products Lightning fast.
|
|
5
5
|
Home-page: https://github.com/Lightning-AI/lightning
|
|
6
6
|
Author: Lightning AI et al.
|
|
@@ -21,37 +21,35 @@ Classifier: Topic :: Scientific/Engineering :: Information Analysis
|
|
|
21
21
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
22
22
|
Classifier: Operating System :: OS Independent
|
|
23
23
|
Classifier: Programming Language :: Python :: 3
|
|
24
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
25
24
|
Classifier: Programming Language :: Python :: 3.9
|
|
26
25
|
Classifier: Programming Language :: Python :: 3.10
|
|
27
26
|
Classifier: Programming Language :: Python :: 3.11
|
|
28
|
-
|
|
27
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
28
|
+
Requires-Python: >=3.9
|
|
29
29
|
Description-Content-Type: text/markdown
|
|
30
|
-
Provides-Extra: store-test
|
|
31
|
-
Provides-Extra: fabric-strategies
|
|
32
|
-
Provides-Extra: fabric-examples
|
|
33
|
-
Provides-Extra: fabric-test
|
|
34
|
-
Provides-Extra: pytorch-strategies
|
|
35
30
|
Provides-Extra: pytorch-examples
|
|
36
|
-
Provides-Extra: pytorch-test
|
|
37
31
|
Provides-Extra: pytorch-extra
|
|
32
|
+
Provides-Extra: pytorch-test
|
|
33
|
+
Provides-Extra: pytorch-strategies
|
|
34
|
+
Provides-Extra: fabric-examples
|
|
35
|
+
Provides-Extra: fabric-test
|
|
36
|
+
Provides-Extra: fabric-strategies
|
|
38
37
|
Provides-Extra: fabric-all
|
|
39
38
|
Provides-Extra: fabric-dev
|
|
40
39
|
Provides-Extra: pytorch-all
|
|
41
40
|
Provides-Extra: pytorch-dev
|
|
42
|
-
Provides-Extra: app
|
|
43
|
-
Provides-Extra: test
|
|
44
|
-
Provides-Extra: data
|
|
45
|
-
Provides-Extra: strategies
|
|
46
41
|
Provides-Extra: examples
|
|
47
42
|
Provides-Extra: extra
|
|
43
|
+
Provides-Extra: test
|
|
44
|
+
Provides-Extra: strategies
|
|
45
|
+
Provides-Extra: data
|
|
48
46
|
Provides-Extra: all
|
|
49
47
|
Provides-Extra: dev
|
|
50
48
|
License-File: LICENSE
|
|
51
49
|
|
|
52
50
|
<div align="center">
|
|
53
51
|
|
|
54
|
-
<img alt="Lightning" src="https://pl-
|
|
52
|
+
<img alt="Lightning" src="https://pl-bolts-doc-images.s3.us-east-2.amazonaws.com/app-2/ptl_banner.png" width="800px" style="max-width: 100%;">
|
|
55
53
|
|
|
56
54
|
<br/>
|
|
57
55
|
<br/>
|
|
@@ -67,7 +65,7 @@ ______________________________________________________________________
|
|
|
67
65
|
<a href="#examples">Examples</a> •
|
|
68
66
|
<a href="#pytorch-lightning-train-and-deploy-pytorch-at-scale">PyTorch Lightning</a> •
|
|
69
67
|
<a href="#lightning-fabric-expert-control">Fabric</a> •
|
|
70
|
-
<a href="https://pytorch-lightning.readthedocs.io/en/2.
|
|
68
|
+
<a href="https://pytorch-lightning.readthedocs.io/en/2.4.0">Docs</a> •
|
|
71
69
|
<a href="#community">Community</a> •
|
|
72
70
|
<a href="https://lightning.ai/docs/pytorch/stable/generated/CONTRIBUTING.html">Contribute</a> •
|
|
73
71
|
</p>
|
|
@@ -143,11 +141,17 @@ ______________________________________________________________________
|
|
|
143
141
|
### Examples
|
|
144
142
|
Explore various types of training possible with PyTorch Lightning. Pretrain and finetune ANY kind of model to perform ANY task like classification, segmentation, summarization and more:
|
|
145
143
|
|
|
146
|
-
| Task
|
|
147
|
-
|
|
148
|
-
| [Hello world](#hello-simple-model)
|
|
149
|
-
| [Image
|
|
150
|
-
| [
|
|
144
|
+
| Task | Description | Run |
|
|
145
|
+
|-------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------|---|
|
|
146
|
+
| [Hello world](#hello-simple-model) | Pretrain - Hello world example | <a target="_blank" href="https://lightning.ai/lightning-ai/studios/pytorch-lightning-hello-world"><img src="https://pl-bolts-doc-images.s3.us-east-2.amazonaws.com/app-2/studio-badge.svg" alt="Open In Studio"/></a> |
|
|
147
|
+
| [Image classification](https://lightning.ai/lightning-ai/studios/image-classification-with-pytorch-lightning) | Finetune - ResNet-34 model to classify images of cars | <a target="_blank" href="https://lightning.ai/lightning-ai/studios/image-classification-with-pytorch-lightning"><img src="https://pl-bolts-doc-images.s3.us-east-2.amazonaws.com/app-2/studio-badge.svg" alt="Open In Studio"/></a> |
|
|
148
|
+
| [Image segmentation](https://lightning.ai/lightning-ai/studios/image-segmentation-with-pytorch-lightning) | Finetune - ResNet-50 model to segment images | <a target="_blank" href="https://lightning.ai/lightning-ai/studios/image-segmentation-with-pytorch-lightning"><img src="https://pl-bolts-doc-images.s3.us-east-2.amazonaws.com/app-2/studio-badge.svg" alt="Open In Studio"/></a> |
|
|
149
|
+
| [Object detection](https://lightning.ai/lightning-ai/studios/object-detection-with-pytorch-lightning) | Finetune - Faster R-CNN model to detect objects | <a target="_blank" href="https://lightning.ai/lightning-ai/studios/object-detection-with-pytorch-lightning"><img src="https://pl-bolts-doc-images.s3.us-east-2.amazonaws.com/app-2/studio-badge.svg" alt="Open In Studio"/></a> |
|
|
150
|
+
| [Text classification](https://lightning.ai/lightning-ai/studios/text-classification-with-pytorch-lightning) | Finetune - text classifier (BERT model) | <a target="_blank" href="https://lightning.ai/lightning-ai/studios/text-classification-with-pytorch-lightning"><img src="https://pl-bolts-doc-images.s3.us-east-2.amazonaws.com/app-2/studio-badge.svg" alt="Open In Studio"/></a> |
|
|
151
|
+
| [Text summarization](https://lightning.ai/lightning-ai/studios/text-summarization-with-pytorch-lightning) | Finetune - text summarization (Hugging Face transformer model) | <a target="_blank" href="https://lightning.ai/lightning-ai/studios/text-summarization-with-pytorch-lightning"><img src="https://pl-bolts-doc-images.s3.us-east-2.amazonaws.com/app-2/studio-badge.svg" alt="Open In Studio"/></a> |
|
|
152
|
+
| [Audio generation](https://lightning.ai/lightning-ai/studios/finetune-a-personal-ai-music-generator) | Finetune - audio generator (transformer model) | <a target="_blank" href="https://lightning.ai/lightning-ai/studios/finetune-a-personal-ai-music-generator"><img src="https://pl-bolts-doc-images.s3.us-east-2.amazonaws.com/app-2/studio-badge.svg" alt="Open In Studio"/></a> |
|
|
153
|
+
| [LLM finetuning](https://lightning.ai/lightning-ai/studios/finetune-an-llm-with-pytorch-lightning) | Finetune - LLM (Meta Llama 3.1 8B) | <a target="_blank" href="https://lightning.ai/lightning-ai/studios/finetune-an-llm-with-pytorch-lightning"><img src="https://pl-bolts-doc-images.s3.us-east-2.amazonaws.com/app-2/studio-badge.svg" alt="Open In Studio"/></a> |
|
|
154
|
+
| [Image generation](https://lightning.ai/lightning-ai/studios/train-a-diffusion-model-with-pytorch-lightning) | Pretrain - Image generator (diffusion model) | <a target="_blank" href="https://lightning.ai/lightning-ai/studios/train-a-diffusion-model-with-pytorch-lightning"><img src="https://pl-bolts-doc-images.s3.us-east-2.amazonaws.com/app-2/studio-badge.svg" alt="Open In Studio"/></a> |
|
|
151
155
|
|
|
152
156
|
### Hello simple model
|
|
153
157
|
|
|
@@ -583,7 +587,7 @@ Lightning is rigorously tested across multiple CPUs, GPUs and TPUs and against m
|
|
|
583
587
|
|
|
584
588
|
| System / PyTorch ver. | 1.13 | 2.0 | 2.1 |
|
|
585
589
|
| :--------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
|
|
586
|
-
| Linux py3.9 \[GPUs\] | | | [](https://dev.azure.com/Lightning-AI/lightning/_build/latest?definitionId=24&branchName=master) |
|
|
587
591
|
| Linux py3.9 \[TPUs\] | | [](https://github.com/Lightning-AI/lightning/actions/workflows/tpu-tests.yml) | |
|
|
588
592
|
| Linux (multiple Python versions) | [](https://github.com/Lightning-AI/lightning/actions/workflows/ci-tests-pytorch.yml) | [](https://github.com/Lightning-AI/lightning/actions/workflows/ci-tests-pytorch.yml) | [](https://github.com/Lightning-AI/lightning/actions/workflows/ci-tests-pytorch.yml) |
|
|
589
593
|
| OSX (multiple Python versions) | [](https://github.com/Lightning-AI/lightning/actions/workflows/ci-tests-pytorch.yml) | [](https://github.com/Lightning-AI/lightning/actions/workflows/ci-tests-pytorch.yml) | [](https://github.com/Lightning-AI/lightning/actions/workflows/ci-tests-pytorch.yml) |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
|
|
3
|
-
<img alt="Lightning" src="https://pl-
|
|
3
|
+
<img alt="Lightning" src="https://pl-bolts-doc-images.s3.us-east-2.amazonaws.com/app-2/ptl_banner.png" width="800px" style="max-width: 100%;">
|
|
4
4
|
|
|
5
5
|
<br/>
|
|
6
6
|
<br/>
|
|
@@ -133,11 +133,17 @@ ______________________________________________________________________
|
|
|
133
133
|
### Examples
|
|
134
134
|
Explore various types of training possible with PyTorch Lightning. Pretrain and finetune ANY kind of model to perform ANY task like classification, segmentation, summarization and more:
|
|
135
135
|
|
|
136
|
-
| Task
|
|
137
|
-
|
|
138
|
-
| [Hello world](#hello-simple-model)
|
|
139
|
-
| [Image
|
|
140
|
-
| [
|
|
136
|
+
| Task | Description | Run |
|
|
137
|
+
|-------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------|---|
|
|
138
|
+
| [Hello world](#hello-simple-model) | Pretrain - Hello world example | <a target="_blank" href="https://lightning.ai/lightning-ai/studios/pytorch-lightning-hello-world"><img src="https://pl-bolts-doc-images.s3.us-east-2.amazonaws.com/app-2/studio-badge.svg" alt="Open In Studio"/></a> |
|
|
139
|
+
| [Image classification](https://lightning.ai/lightning-ai/studios/image-classification-with-pytorch-lightning) | Finetune - ResNet-34 model to classify images of cars | <a target="_blank" href="https://lightning.ai/lightning-ai/studios/image-classification-with-pytorch-lightning"><img src="https://pl-bolts-doc-images.s3.us-east-2.amazonaws.com/app-2/studio-badge.svg" alt="Open In Studio"/></a> |
|
|
140
|
+
| [Image segmentation](https://lightning.ai/lightning-ai/studios/image-segmentation-with-pytorch-lightning) | Finetune - ResNet-50 model to segment images | <a target="_blank" href="https://lightning.ai/lightning-ai/studios/image-segmentation-with-pytorch-lightning"><img src="https://pl-bolts-doc-images.s3.us-east-2.amazonaws.com/app-2/studio-badge.svg" alt="Open In Studio"/></a> |
|
|
141
|
+
| [Object detection](https://lightning.ai/lightning-ai/studios/object-detection-with-pytorch-lightning) | Finetune - Faster R-CNN model to detect objects | <a target="_blank" href="https://lightning.ai/lightning-ai/studios/object-detection-with-pytorch-lightning"><img src="https://pl-bolts-doc-images.s3.us-east-2.amazonaws.com/app-2/studio-badge.svg" alt="Open In Studio"/></a> |
|
|
142
|
+
| [Text classification](https://lightning.ai/lightning-ai/studios/text-classification-with-pytorch-lightning) | Finetune - text classifier (BERT model) | <a target="_blank" href="https://lightning.ai/lightning-ai/studios/text-classification-with-pytorch-lightning"><img src="https://pl-bolts-doc-images.s3.us-east-2.amazonaws.com/app-2/studio-badge.svg" alt="Open In Studio"/></a> |
|
|
143
|
+
| [Text summarization](https://lightning.ai/lightning-ai/studios/text-summarization-with-pytorch-lightning) | Finetune - text summarization (Hugging Face transformer model) | <a target="_blank" href="https://lightning.ai/lightning-ai/studios/text-summarization-with-pytorch-lightning"><img src="https://pl-bolts-doc-images.s3.us-east-2.amazonaws.com/app-2/studio-badge.svg" alt="Open In Studio"/></a> |
|
|
144
|
+
| [Audio generation](https://lightning.ai/lightning-ai/studios/finetune-a-personal-ai-music-generator) | Finetune - audio generator (transformer model) | <a target="_blank" href="https://lightning.ai/lightning-ai/studios/finetune-a-personal-ai-music-generator"><img src="https://pl-bolts-doc-images.s3.us-east-2.amazonaws.com/app-2/studio-badge.svg" alt="Open In Studio"/></a> |
|
|
145
|
+
| [LLM finetuning](https://lightning.ai/lightning-ai/studios/finetune-an-llm-with-pytorch-lightning) | Finetune - LLM (Meta Llama 3.1 8B) | <a target="_blank" href="https://lightning.ai/lightning-ai/studios/finetune-an-llm-with-pytorch-lightning"><img src="https://pl-bolts-doc-images.s3.us-east-2.amazonaws.com/app-2/studio-badge.svg" alt="Open In Studio"/></a> |
|
|
146
|
+
| [Image generation](https://lightning.ai/lightning-ai/studios/train-a-diffusion-model-with-pytorch-lightning) | Pretrain - Image generator (diffusion model) | <a target="_blank" href="https://lightning.ai/lightning-ai/studios/train-a-diffusion-model-with-pytorch-lightning"><img src="https://pl-bolts-doc-images.s3.us-east-2.amazonaws.com/app-2/studio-badge.svg" alt="Open In Studio"/></a> |
|
|
141
147
|
|
|
142
148
|
### Hello simple model
|
|
143
149
|
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
# NOTE: the upper bound for the package version is only set for CI stability, and it is dropped while installing this package
|
|
2
2
|
# in case you want to preserve/enforce restrictions on the latest compatible version, add "strict" as an in-line comment
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
torch >=2.0.0, <2.4.0
|
|
4
|
+
torch >=2.1.0, <2.5.0
|
|
6
5
|
fsspec[http] >=2022.5.0, <2024.4.0
|
|
7
6
|
packaging >=20.0, <=23.1
|
|
8
7
|
typing-extensions >=4.4.0, <4.10.0
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# NOTE: the upper bound for the package version is only set for CI stability, and it is dropped while installing this package
|
|
2
2
|
# in case you want to preserve/enforce restrictions on the latest compatible version, add "strict" as an in-line comment
|
|
3
3
|
|
|
4
|
-
torchvision >=0.
|
|
4
|
+
torchvision >=0.16.0, <0.20.0
|
|
5
5
|
torchmetrics >=0.10.0, <1.3.0
|
|
6
6
|
lightning-utilities >=0.8.0, <0.12.0
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
# NOTE: the upper bound for the package version is only set for CI stability, and it is dropped while installing this package
|
|
2
2
|
# in case you want to preserve/enforce restrictions on the latest compatible version, add "strict" as an in-line comment
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
torch >=2.0.0, <2.4.0
|
|
4
|
+
torch >=2.1.0, <2.5.0
|
|
6
5
|
tqdm >=4.57.0, <4.67.0
|
|
7
6
|
PyYAML >=5.4, <6.1.0
|
|
8
7
|
fsspec[http] >=2022.5.0, <2024.4.0
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# in case you want to preserve/enforce restrictions on the latest compatible version, add "strict" as an in-line comment
|
|
3
3
|
|
|
4
4
|
requests <2.32.0
|
|
5
|
-
torchvision >=0.
|
|
5
|
+
torchvision >=0.16.0, <0.20.0
|
|
6
6
|
ipython[all] <8.15.0
|
|
7
7
|
torchmetrics >=0.10.0, <1.3.0
|
|
8
8
|
lightning-utilities >=0.8.0, <0.12.0
|
|
@@ -8,8 +8,9 @@ pytest-random-order ==1.1.0
|
|
|
8
8
|
# needed in tests
|
|
9
9
|
cloudpickle >=1.3, <2.3.0
|
|
10
10
|
scikit-learn >0.22.1, <1.4.0
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
numpy >=1.17.2, <1.27.0
|
|
12
|
+
onnx >=1.12.0, <1.17.0
|
|
13
|
+
onnxruntime >=1.12.0, <1.19.0
|
|
13
14
|
psutil <5.9.6 # for `DeviceStatsMonitor`
|
|
14
15
|
pandas >1.0, <2.2.0 # needed in benchmarks
|
|
15
16
|
fastapi # for `ServableModuleValidator` # not setting version as re-defined in App
|
|
@@ -5,7 +5,7 @@ from pathlib import Path
|
|
|
5
5
|
from types import ModuleType
|
|
6
6
|
from typing import Any, Dict
|
|
7
7
|
|
|
8
|
-
from setuptools import
|
|
8
|
+
from setuptools import find_namespace_packages
|
|
9
9
|
|
|
10
10
|
_PROJECT_ROOT = "."
|
|
11
11
|
_SOURCE_ROOT = os.path.join(_PROJECT_ROOT, "src")
|
|
@@ -87,14 +87,14 @@ def _setup_args() -> Dict[str, Any]:
|
|
|
87
87
|
"url": about.__homepage__,
|
|
88
88
|
"download_url": "https://github.com/Lightning-AI/lightning",
|
|
89
89
|
"license": about.__license__,
|
|
90
|
-
"packages":
|
|
90
|
+
"packages": find_namespace_packages(where="src", include=["lightning", "lightning.*"]),
|
|
91
91
|
"package_dir": {"": "src"},
|
|
92
92
|
"long_description": long_description,
|
|
93
93
|
"long_description_content_type": "text/markdown",
|
|
94
94
|
"include_package_data": True,
|
|
95
95
|
"zip_safe": False,
|
|
96
|
-
"keywords": ["deep learning", "pytorch", "AI"],
|
|
97
|
-
"python_requires": ">=3.
|
|
96
|
+
"keywords": ["deep learning", "pytorch", "AI"],
|
|
97
|
+
"python_requires": ">=3.9",
|
|
98
98
|
"entry_points": {
|
|
99
99
|
"console_scripts": [
|
|
100
100
|
"fabric = lightning.fabric.cli:_main",
|
|
@@ -124,9 +124,9 @@ def _setup_args() -> Dict[str, Any]:
|
|
|
124
124
|
"Operating System :: OS Independent",
|
|
125
125
|
# Specify the Python versions you support here.
|
|
126
126
|
"Programming Language :: Python :: 3",
|
|
127
|
-
"Programming Language :: Python :: 3.8",
|
|
128
127
|
"Programming Language :: Python :: 3.9",
|
|
129
128
|
"Programming Language :: Python :: 3.10",
|
|
130
129
|
"Programming Language :: Python :: 3.11",
|
|
130
|
+
"Programming Language :: Python :: 3.12",
|
|
131
131
|
], # todo: consider aggregation/union of tags from particular packages
|
|
132
132
|
}
|
|
@@ -5,6 +5,30 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
|
|
6
6
|
|
|
7
7
|
|
|
8
|
+
## [2.4.0] - 2024-08-06
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- Made saving non-distributed checkpoints fully atomic ([#20011](https://github.com/Lightning-AI/pytorch-lightning/pull/20011))
|
|
13
|
+
- Added a flag `verbose` to the `seed_everything()` function ([#20108](https://github.com/Lightning-AI/pytorch-lightning/pull/20108))
|
|
14
|
+
- Added support for PyTorch 2.4 ([#20028](https://github.com/Lightning-AI/pytorch-lightning/pull/20028))
|
|
15
|
+
- Added support for Python 3.12 ([20078](https://github.com/Lightning-AI/pytorch-lightning/pull/20078))
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
|
|
19
|
+
- Changed the implementation of how seeds are chosen for dataloader workers when using `seed_everything(..., workers=True)` ([#20055](https://github.com/Lightning-AI/pytorch-lightning/pull/20055))
|
|
20
|
+
- NumPy is no longer a required dependency ([#20090](https://github.com/Lightning-AI/pytorch-lightning/issues/20090))
|
|
21
|
+
|
|
22
|
+
### Removed
|
|
23
|
+
|
|
24
|
+
- Removed support for PyTorch 2.1 ([#20009](https://github.com/Lightning-AI/lightning/pull/20009))
|
|
25
|
+
- Removed support for Python 3.8 ([#20071](https://github.com/Lightning-AI/lightning/pull/20071))
|
|
26
|
+
|
|
27
|
+
### Fixed
|
|
28
|
+
|
|
29
|
+
- Fixed an attribute error when loading a checkpoint into a quantized model using the `_lazy_load()` function ([#20121](https://github.com/Lightning-AI/lightning/pull/20121))
|
|
30
|
+
- Fixed `_optimizer_to_device` logic for special 'step' key in optimizer state causing performance regression ([#20019](https://github.com/Lightning-AI/lightning/pull/20019))
|
|
31
|
+
|
|
8
32
|
|
|
9
33
|
## [2.3.0] - 2024-06-13
|
|
10
34
|
|
|
@@ -21,7 +21,7 @@ if not _root_logger.hasHandlers():
|
|
|
21
21
|
_logger.propagate = False
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
#
|
|
24
|
+
# Setting this variable will force `torch.cuda.is_available()` and `torch.cuda.device_count()`
|
|
25
25
|
# to use an NVML-based implementation that doesn't poison forks.
|
|
26
26
|
# https://github.com/pytorch/pytorch/issues/83973
|
|
27
27
|
os.environ["PYTORCH_NVML_BASED_CUDA_CHECK"] = "1"
|
|
@@ -37,9 +37,6 @@ import lightning.fabric._graveyard # noqa: E402, F401 # isort: skip
|
|
|
37
37
|
|
|
38
38
|
__all__ = ["Fabric", "seed_everything", "is_wrapped"]
|
|
39
39
|
|
|
40
|
-
# for compatibility with namespace packages
|
|
41
|
-
__import__("pkg_resources").declare_namespace(__name__)
|
|
42
|
-
|
|
43
40
|
|
|
44
41
|
if os.environ.get("POSSIBLE_USER_WARNINGS", "").lower() in ("0", "off"):
|
|
45
42
|
disable_possible_user_warnings()
|
|
@@ -225,8 +225,7 @@ class Fabric:
|
|
|
225
225
|
_reapply_compile: If ``True`` (default), and the model was ``torch.compile``d before, the
|
|
226
226
|
corresponding :class:`~torch._dynamo.OptimizedModule` wrapper will be removed and reapplied with the
|
|
227
227
|
same settings after the model was set up by the strategy (e.g., after the model was wrapped by DDP,
|
|
228
|
-
FSDP etc.).
|
|
229
|
-
issues.
|
|
228
|
+
FSDP etc.). Set it to ``False`` if compiling DDP/FSDP is causing issues.
|
|
230
229
|
|
|
231
230
|
Returns:
|
|
232
231
|
The tuple containing wrapped module and the optimizers, in the same order they were passed in.
|
|
@@ -292,8 +291,7 @@ class Fabric:
|
|
|
292
291
|
_reapply_compile: If ``True`` (default), and the model was ``torch.compile``d before, the
|
|
293
292
|
corresponding :class:`~torch._dynamo.OptimizedModule` wrapper will be removed and reapplied with the
|
|
294
293
|
same settings after the model was set up by the strategy (e.g., after the model was wrapped by DDP,
|
|
295
|
-
FSDP etc.).
|
|
296
|
-
issues.
|
|
294
|
+
FSDP etc.). Set it to ``False`` if compiling DDP/FSDP is causing issues.
|
|
297
295
|
Returns:
|
|
298
296
|
The wrapped model.
|
|
299
297
|
|
|
@@ -911,7 +909,7 @@ class Fabric:
|
|
|
911
909
|
logger.log_metrics(metrics=metrics, step=step)
|
|
912
910
|
|
|
913
911
|
@staticmethod
|
|
914
|
-
def seed_everything(seed: Optional[int] = None, workers: Optional[bool] = None) -> int:
|
|
912
|
+
def seed_everything(seed: Optional[int] = None, workers: Optional[bool] = None, verbose: bool = True) -> int:
|
|
915
913
|
r"""Helper function to seed everything without explicitly importing Lightning.
|
|
916
914
|
|
|
917
915
|
See :func:`~lightning.fabric.utilities.seed.seed_everything` for more details.
|
|
@@ -921,7 +919,7 @@ class Fabric:
|
|
|
921
919
|
# Lightning sets `workers=False` by default to avoid breaking reproducibility, but since this is a new
|
|
922
920
|
# release, we can afford to do it.
|
|
923
921
|
workers = True
|
|
924
|
-
return seed_everything(seed=seed, workers=workers)
|
|
922
|
+
return seed_everything(seed=seed, workers=workers, verbose=verbose)
|
|
925
923
|
|
|
926
924
|
def _wrap_and_launch(self, to_run: Callable, *args: Any, **kwargs: Any) -> Any:
|
|
927
925
|
self._launched = True
|
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
|
|
15
|
-
import logging
|
|
16
15
|
import os
|
|
17
16
|
from argparse import Namespace
|
|
18
17
|
from typing import TYPE_CHECKING, Any, Dict, Mapping, Optional, Union
|
|
@@ -30,8 +29,6 @@ from lightning.fabric.utilities.rank_zero import rank_zero_only, rank_zero_warn
|
|
|
30
29
|
from lightning.fabric.utilities.types import _PATH
|
|
31
30
|
from lightning.fabric.wrappers import _unwrap_objects
|
|
32
31
|
|
|
33
|
-
log = logging.getLogger(__name__)
|
|
34
|
-
|
|
35
32
|
_TENSORBOARD_AVAILABLE = RequirementCache("tensorboard")
|
|
36
33
|
_TENSORBOARDX_AVAILABLE = RequirementCache("tensorboardX")
|
|
37
34
|
if TYPE_CHECKING:
|
|
@@ -107,7 +104,7 @@ class TensorBoardLogger(Logger):
|
|
|
107
104
|
self._prefix = prefix
|
|
108
105
|
self._fs = get_filesystem(root_dir)
|
|
109
106
|
|
|
110
|
-
self._experiment: Optional[
|
|
107
|
+
self._experiment: Optional[SummaryWriter] = None
|
|
111
108
|
self._kwargs = kwargs
|
|
112
109
|
|
|
113
110
|
@property
|
|
@@ -305,8 +302,6 @@ class TensorBoardLogger(Logger):
|
|
|
305
302
|
try:
|
|
306
303
|
listdir_info = self._fs.listdir(save_dir)
|
|
307
304
|
except OSError:
|
|
308
|
-
# TODO(fabric): This message can be confusing (did user do something wrong?). Improve it or remove it.
|
|
309
|
-
log.warning("Missing logger folder: %s", save_dir)
|
|
310
305
|
return 0
|
|
311
306
|
|
|
312
307
|
existing_versions = []
|
{lightning-2.3.3 → lightning-2.4.0}/src/lightning/fabric/plugins/collectives/torch_collective.py
RENAMED
|
@@ -95,11 +95,11 @@ class TorchCollective(Collective):
|
|
|
95
95
|
|
|
96
96
|
@override
|
|
97
97
|
def send(self, tensor: Tensor, dst: int, tag: int = 0) -> None:
|
|
98
|
-
dist.send(tensor, dst, tag=tag, group=self.group)
|
|
98
|
+
dist.send(tensor, dst, tag=tag, group=self.group) # type: ignore[arg-type]
|
|
99
99
|
|
|
100
100
|
@override
|
|
101
101
|
def recv(self, tensor: Tensor, src: Optional[int] = None, tag: int = 0) -> Tensor:
|
|
102
|
-
dist.recv(tensor, src, tag=tag, group=self.group)
|
|
102
|
+
dist.recv(tensor, src, tag=tag, group=self.group) # type: ignore[arg-type]
|
|
103
103
|
return tensor
|
|
104
104
|
|
|
105
105
|
def all_gather_object(self, object_list: List[Any], obj: Any) -> List[Any]:
|
|
@@ -22,6 +22,7 @@ from typing_extensions import override
|
|
|
22
22
|
|
|
23
23
|
from lightning.fabric.plugins.precision.precision import Precision
|
|
24
24
|
from lightning.fabric.plugins.precision.utils import _convert_fp_tensor
|
|
25
|
+
from lightning.fabric.utilities.imports import _TORCH_GREATER_EQUAL_2_4
|
|
25
26
|
from lightning.fabric.utilities.types import Optimizable
|
|
26
27
|
|
|
27
28
|
|
|
@@ -39,7 +40,7 @@ class MixedPrecision(Precision):
|
|
|
39
40
|
self,
|
|
40
41
|
precision: Literal["16-mixed", "bf16-mixed"],
|
|
41
42
|
device: str,
|
|
42
|
-
scaler: Optional[torch.
|
|
43
|
+
scaler: Optional["torch.amp.GradScaler"] = None,
|
|
43
44
|
) -> None:
|
|
44
45
|
if precision not in ("16-mixed", "bf16-mixed"):
|
|
45
46
|
raise ValueError(
|
|
@@ -49,7 +50,7 @@ class MixedPrecision(Precision):
|
|
|
49
50
|
|
|
50
51
|
self.precision = precision
|
|
51
52
|
if scaler is None and self.precision == "16-mixed":
|
|
52
|
-
scaler = torch.cuda.amp.GradScaler()
|
|
53
|
+
scaler = torch.amp.GradScaler(device=device) if _TORCH_GREATER_EQUAL_2_4 else torch.cuda.amp.GradScaler()
|
|
53
54
|
if scaler is not None and self.precision == "bf16-mixed":
|
|
54
55
|
raise ValueError(f"`precision='bf16-mixed'` does not use a scaler, found {scaler}.")
|
|
55
56
|
self.device = device
|
|
@@ -43,6 +43,7 @@ if TYPE_CHECKING:
|
|
|
43
43
|
from deepspeed import DeepSpeedEngine
|
|
44
44
|
|
|
45
45
|
_DEEPSPEED_AVAILABLE = RequirementCache("deepspeed")
|
|
46
|
+
_DEEPSPEED_GREATER_EQUAL_0_14_1 = RequirementCache("deepspeed>=0.14.1")
|
|
46
47
|
|
|
47
48
|
|
|
48
49
|
# TODO(fabric): Links in the docstrings to PL-specific deepspeed user docs need to be replaced.
|
|
@@ -291,7 +292,7 @@ class DeepSpeedStrategy(DDPStrategy, _Sharded):
|
|
|
291
292
|
self.hysteresis = hysteresis
|
|
292
293
|
self.min_loss_scale = min_loss_scale
|
|
293
294
|
|
|
294
|
-
self._deepspeed_engine: Optional[
|
|
295
|
+
self._deepspeed_engine: Optional[DeepSpeedEngine] = None
|
|
295
296
|
|
|
296
297
|
@property
|
|
297
298
|
def zero_stage_3(self) -> bool:
|
|
@@ -498,7 +499,10 @@ class DeepSpeedStrategy(DDPStrategy, _Sharded):
|
|
|
498
499
|
)
|
|
499
500
|
engine = engines[0]
|
|
500
501
|
|
|
501
|
-
|
|
502
|
+
if _DEEPSPEED_GREATER_EQUAL_0_14_1:
|
|
503
|
+
from deepspeed.runtime.base_optimizer import DeepSpeedOptimizer
|
|
504
|
+
else:
|
|
505
|
+
from deepspeed.runtime import DeepSpeedOptimizer
|
|
502
506
|
|
|
503
507
|
optimzer_state_requested = any(isinstance(item, (Optimizer, DeepSpeedOptimizer)) for item in state.values())
|
|
504
508
|
|