lightning 2.4.0.dev20240721__tar.gz → 2.4.0.dev20240804__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.4.0.dev20240721/src/lightning.egg-info → lightning-2.4.0.dev20240804}/PKG-INFO +20 -17
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/README.md +9 -6
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/CHANGELOG.md +2 -1
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/plugins/collectives/torch_collective.py +2 -2
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/plugins/precision/amp.py +1 -1
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/strategies/fsdp.py +2 -2
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/strategies/model_parallel.py +4 -4
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/utilities/load.py +1 -1
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/utilities/logger.py +1 -1
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/CHANGELOG.md +3 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/callbacks/progress/rich_progress.py +12 -15
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/callbacks/pruning.py +3 -3
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/callbacks/stochastic_weight_avg.py +4 -4
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/core/datamodule.py +1 -1
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/core/module.py +1 -1
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/demos/__init__.py +1 -0
- lightning-2.4.0.dev20240804/src/lightning/pytorch/demos/lstm.py +98 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/plugins/precision/amp.py +1 -1
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/plugins/precision/precision.py +1 -1
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/trainer/connectors/logger_connector/result.py +4 -11
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/tuner/lr_finder.py +7 -4
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/utilities/model_helpers.py +6 -3
- lightning-2.4.0.dev20240804/src/lightning/version.info +1 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804/src/lightning.egg-info}/PKG-INFO +20 -17
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning.egg-info/SOURCES.txt +2 -1
- lightning-2.4.0.dev20240804/src/version.info +1 -0
- lightning-2.4.0.dev20240721/src/lightning/version.info +0 -1
- lightning-2.4.0.dev20240721/src/version.info +0 -1
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/.actions/assistant.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/CITATION.cff +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/LICENSE +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/pyproject.toml +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/requirements/base.txt +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/requirements/fabric/base.txt +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/requirements/fabric/docs.txt +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/requirements/fabric/examples.txt +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/requirements/fabric/strategies.txt +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/requirements/fabric/test.txt +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/requirements/pytorch/base.txt +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/requirements/pytorch/docs.txt +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/requirements/pytorch/examples.txt +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/requirements/pytorch/extra.txt +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/requirements/pytorch/strategies.txt +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/requirements/pytorch/test.txt +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/setup.cfg +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/setup.py +0 -0
- /lightning-2.4.0.dev20240721/src/lightning/84b2c93ee7d857f2c8d59ed5c71ea79e33f7829f5c593862 → /lightning-2.4.0.dev20240804/src/lightning/5e45b94236af6835d3802753f35d16cfb2512f03fab1c882 +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/__about__.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/__init__.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/__setup__.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/__version__.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/data/__init__.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/__init__.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/_graveyard/__init__.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/_graveyard/tpu.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/accelerators/__init__.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/accelerators/accelerator.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/accelerators/cpu.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/accelerators/cuda.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/accelerators/mps.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/accelerators/registry.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/accelerators/xla.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/cli.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/connector.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/fabric.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/loggers/__init__.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/loggers/csv_logs.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/loggers/logger.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/loggers/tensorboard.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/plugins/__init__.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/plugins/collectives/__init__.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/plugins/collectives/collective.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/plugins/collectives/single_device.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/plugins/environments/__init__.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/plugins/environments/cluster_environment.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/plugins/environments/kubeflow.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/plugins/environments/lightning.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/plugins/environments/lsf.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/plugins/environments/mpi.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/plugins/environments/slurm.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/plugins/environments/torchelastic.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/plugins/environments/xla.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/plugins/io/__init__.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/plugins/io/checkpoint_io.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/plugins/io/torch_io.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/plugins/io/xla.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/plugins/precision/__init__.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/plugins/precision/bitsandbytes.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/plugins/precision/deepspeed.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/plugins/precision/double.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/plugins/precision/fsdp.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/plugins/precision/half.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/plugins/precision/precision.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/plugins/precision/transformer_engine.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/plugins/precision/utils.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/plugins/precision/xla.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/strategies/__init__.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/strategies/ddp.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/strategies/deepspeed.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/strategies/dp.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/strategies/launchers/__init__.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/strategies/launchers/launcher.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/strategies/launchers/multiprocessing.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/strategies/launchers/subprocess_script.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/strategies/launchers/xla.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/strategies/parallel.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/strategies/registry.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/strategies/single_device.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/strategies/single_xla.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/strategies/strategy.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/strategies/xla.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/strategies/xla_fsdp.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/utilities/__init__.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/utilities/apply_func.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/utilities/cloud_io.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/utilities/consolidate_checkpoint.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/utilities/data.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/utilities/device_dtype_mixin.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/utilities/device_parser.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/utilities/distributed.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/utilities/enums.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/utilities/exceptions.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/utilities/imports.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/utilities/init.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/utilities/optimizer.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/utilities/rank_zero.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/utilities/registry.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/utilities/seed.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/utilities/spike.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/utilities/testing/__init__.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/utilities/testing/_runif.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/utilities/throughput.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/utilities/types.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/utilities/warnings.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/wrappers.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/py.typed +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/__init__.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/_graveyard/__init__.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/_graveyard/_torchmetrics.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/_graveyard/hpu.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/_graveyard/precision.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/_graveyard/tpu.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/accelerators/__init__.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/accelerators/accelerator.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/accelerators/cpu.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/accelerators/cuda.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/accelerators/mps.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/accelerators/xla.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/callbacks/__init__.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/callbacks/batch_size_finder.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/callbacks/callback.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/callbacks/checkpoint.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/callbacks/device_stats_monitor.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/callbacks/early_stopping.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/callbacks/finetuning.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/callbacks/gradient_accumulation_scheduler.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/callbacks/lambda_function.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/callbacks/lr_finder.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/callbacks/lr_monitor.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/callbacks/model_checkpoint.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/callbacks/model_summary.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/callbacks/on_exception_checkpoint.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/callbacks/prediction_writer.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/callbacks/progress/__init__.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/callbacks/progress/progress_bar.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/callbacks/progress/tqdm_progress.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/callbacks/rich_model_summary.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/callbacks/spike.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/callbacks/throughput_monitor.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/callbacks/timer.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/cli.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/core/__init__.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/core/hooks.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/core/mixins/__init__.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/core/mixins/hparams_mixin.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/core/optimizer.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/core/saving.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/demos/boring_classes.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/demos/mnist_datamodule.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/demos/transformer.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/loggers/__init__.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/loggers/comet.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/loggers/csv_logs.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/loggers/logger.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/loggers/mlflow.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/loggers/neptune.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/loggers/tensorboard.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/loggers/utilities.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/loggers/wandb.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/loops/__init__.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/loops/evaluation_loop.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/loops/fetchers.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/loops/fit_loop.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/loops/loop.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/loops/optimization/__init__.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/loops/optimization/automatic.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/loops/optimization/closure.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/loops/optimization/manual.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/loops/prediction_loop.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/loops/progress.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/loops/training_epoch_loop.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/loops/utilities.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/overrides/__init__.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/overrides/distributed.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/plugins/__init__.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/plugins/environments/__init__.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/plugins/io/__init__.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/plugins/io/async_plugin.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/plugins/io/checkpoint_plugin.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/plugins/io/torch_plugin.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/plugins/io/wrapper.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/plugins/io/xla_plugin.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/plugins/layer_sync.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/plugins/precision/__init__.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/plugins/precision/bitsandbytes.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/plugins/precision/deepspeed.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/plugins/precision/double.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/plugins/precision/fsdp.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/plugins/precision/half.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/plugins/precision/transformer_engine.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/plugins/precision/xla.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/profilers/__init__.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/profilers/advanced.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/profilers/base.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/profilers/profiler.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/profilers/pytorch.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/profilers/simple.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/profilers/xla.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/serve/__init__.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/serve/servable_module.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/serve/servable_module_validator.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/strategies/__init__.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/strategies/ddp.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/strategies/deepspeed.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/strategies/fsdp.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/strategies/launchers/__init__.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/strategies/launchers/launcher.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/strategies/launchers/multiprocessing.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/strategies/launchers/subprocess_script.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/strategies/launchers/xla.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/strategies/model_parallel.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/strategies/parallel.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/strategies/single_device.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/strategies/single_xla.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/strategies/strategy.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/strategies/xla.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/trainer/__init__.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/trainer/call.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/trainer/configuration_validator.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/trainer/connectors/__init__.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/trainer/connectors/accelerator_connector.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/trainer/connectors/callback_connector.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/trainer/connectors/checkpoint_connector.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/trainer/connectors/data_connector.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/trainer/connectors/logger_connector/__init__.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/trainer/connectors/logger_connector/fx_validator.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/trainer/connectors/logger_connector/logger_connector.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/trainer/connectors/signal_connector.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/trainer/setup.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/trainer/states.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/trainer/trainer.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/tuner/__init__.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/tuner/batch_size_scaling.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/tuner/tuning.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/utilities/__init__.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/utilities/_pytree.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/utilities/argparse.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/utilities/combined_loader.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/utilities/compile.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/utilities/consolidate_checkpoint.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/utilities/data.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/utilities/deepspeed.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/utilities/enums.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/utilities/exceptions.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/utilities/grads.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/utilities/imports.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/utilities/memory.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/utilities/migration/__init__.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/utilities/migration/migration.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/utilities/migration/utils.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/utilities/model_summary/__init__.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/utilities/model_summary/model_summary.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/utilities/model_summary/model_summary_deepspeed.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/utilities/parameter_tying.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/utilities/parsing.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/utilities/rank_zero.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/utilities/seed.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/utilities/signature_utils.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/utilities/testing/__init__.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/utilities/testing/_runif.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/utilities/types.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/utilities/upgrade_checkpoint.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/utilities/warnings.py +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning.egg-info/dependency_links.txt +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning.egg-info/entry_points.txt +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning.egg-info/not-zip-safe +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning.egg-info/requires.txt +0 -0
- {lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: lightning
|
|
3
|
-
Version: 2.4.0.
|
|
3
|
+
Version: 2.4.0.dev20240804
|
|
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.
|
|
@@ -27,22 +27,22 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
27
27
|
Classifier: Programming Language :: Python :: 3.12
|
|
28
28
|
Requires-Python: >=3.9
|
|
29
29
|
Description-Content-Type: text/markdown
|
|
30
|
-
Provides-Extra:
|
|
31
|
-
Provides-Extra: fabric-test
|
|
32
|
-
Provides-Extra: fabric-examples
|
|
33
|
-
Provides-Extra: pytorch-strategies
|
|
30
|
+
Provides-Extra: pytorch-examples
|
|
34
31
|
Provides-Extra: pytorch-extra
|
|
35
32
|
Provides-Extra: pytorch-test
|
|
36
|
-
Provides-Extra: pytorch-
|
|
33
|
+
Provides-Extra: pytorch-strategies
|
|
34
|
+
Provides-Extra: fabric-examples
|
|
35
|
+
Provides-Extra: fabric-test
|
|
36
|
+
Provides-Extra: fabric-strategies
|
|
37
37
|
Provides-Extra: fabric-all
|
|
38
38
|
Provides-Extra: fabric-dev
|
|
39
39
|
Provides-Extra: pytorch-all
|
|
40
40
|
Provides-Extra: pytorch-dev
|
|
41
|
-
Provides-Extra: strategies
|
|
42
|
-
Provides-Extra: test
|
|
43
41
|
Provides-Extra: examples
|
|
44
|
-
Provides-Extra: data
|
|
45
42
|
Provides-Extra: extra
|
|
43
|
+
Provides-Extra: test
|
|
44
|
+
Provides-Extra: strategies
|
|
45
|
+
Provides-Extra: data
|
|
46
46
|
Provides-Extra: all
|
|
47
47
|
Provides-Extra: dev
|
|
48
48
|
License-File: LICENSE
|
|
@@ -65,7 +65,7 @@ ______________________________________________________________________
|
|
|
65
65
|
<a href="#examples">Examples</a> •
|
|
66
66
|
<a href="#pytorch-lightning-train-and-deploy-pytorch-at-scale">PyTorch Lightning</a> •
|
|
67
67
|
<a href="#lightning-fabric-expert-control">Fabric</a> •
|
|
68
|
-
<a href="https://pytorch-lightning.readthedocs.io/en/2.4.0.
|
|
68
|
+
<a href="https://pytorch-lightning.readthedocs.io/en/2.4.0.dev20240804">Docs</a> •
|
|
69
69
|
<a href="#community">Community</a> •
|
|
70
70
|
<a href="https://lightning.ai/docs/pytorch/stable/generated/CONTRIBUTING.html">Contribute</a> •
|
|
71
71
|
</p>
|
|
@@ -141,13 +141,16 @@ ______________________________________________________________________
|
|
|
141
141
|
### Examples
|
|
142
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:
|
|
143
143
|
|
|
144
|
-
| Task | Description
|
|
145
|
-
|
|
146
|
-
| [Hello world](#hello-simple-model) | Pretrain - Hello world example
|
|
147
|
-
| [Image
|
|
148
|
-
| [
|
|
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> |
|
|
149
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> |
|
|
150
|
-
| [Audio generation](https://lightning.ai/lightning-ai/studios/finetune-a-personal-ai-music-generator) | Finetune - audio generator (transformer model)
|
|
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> |
|
|
151
154
|
|
|
152
155
|
### Hello simple model
|
|
153
156
|
|
|
@@ -583,7 +586,7 @@ Lightning is rigorously tested across multiple CPUs, GPUs and TPUs and against m
|
|
|
583
586
|
|
|
584
587
|
| System / PyTorch ver. | 1.13 | 2.0 | 2.1 |
|
|
585
588
|
| :--------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
|
|
586
|
-
| Linux py3.9 \[GPUs\] | | | [](https://dev.azure.com/Lightning-AI/lightning/_build/latest?definitionId=24&branchName=master) |
|
|
587
590
|
| Linux py3.9 \[TPUs\] | | [](https://github.com/Lightning-AI/lightning/actions/workflows/tpu-tests.yml) | |
|
|
588
591
|
| 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
592
|
| 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) |
|
|
@@ -133,13 +133,16 @@ ______________________________________________________________________
|
|
|
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 | Description
|
|
137
|
-
|
|
138
|
-
| [Hello world](#hello-simple-model) | Pretrain - Hello world example
|
|
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> |
|
|
141
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> |
|
|
142
|
-
| [Audio generation](https://lightning.ai/lightning-ai/studios/finetune-a-personal-ai-music-generator) | Finetune - audio generator (transformer model)
|
|
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> |
|
|
143
146
|
|
|
144
147
|
### Hello simple model
|
|
145
148
|
|
{lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/CHANGELOG.md
RENAMED
|
@@ -35,7 +35,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
|
|
|
35
35
|
|
|
36
36
|
### Fixed
|
|
37
37
|
|
|
38
|
-
-
|
|
38
|
+
- 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))
|
|
39
|
+
|
|
39
40
|
|
|
40
41
|
-
|
|
41
42
|
|
|
@@ -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]:
|
|
@@ -40,7 +40,7 @@ class MixedPrecision(Precision):
|
|
|
40
40
|
self,
|
|
41
41
|
precision: Literal["16-mixed", "bf16-mixed"],
|
|
42
42
|
device: str,
|
|
43
|
-
scaler: Optional["torch.
|
|
43
|
+
scaler: Optional["torch.amp.GradScaler"] = None,
|
|
44
44
|
) -> None:
|
|
45
45
|
if precision not in ("16-mixed", "bf16-mixed"):
|
|
46
46
|
raise ValueError(
|
{lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/strategies/fsdp.py
RENAMED
|
@@ -864,7 +864,7 @@ def _distributed_checkpoint_save(converted_state: Dict[str, Any], path: Path) ->
|
|
|
864
864
|
|
|
865
865
|
# let torch automatically infer the writer to use. This might also support fsspec paths in the future
|
|
866
866
|
# https://github.com/pytorch/pytorch/issues/118036
|
|
867
|
-
save(converted_state, checkpoint_id=path)
|
|
867
|
+
save(converted_state, checkpoint_id=path)
|
|
868
868
|
else: # deprecated
|
|
869
869
|
from torch.distributed.checkpoint import FileSystemWriter
|
|
870
870
|
|
|
@@ -883,7 +883,7 @@ def _distributed_checkpoint_load(module_state: Dict[str, Any], path: Path) -> No
|
|
|
883
883
|
|
|
884
884
|
# let torch automatically infer the reader to use. This might also support fsspec paths in the future
|
|
885
885
|
# https://github.com/pytorch/pytorch/issues/118036
|
|
886
|
-
load(module_state, checkpoint_id=path)
|
|
886
|
+
load(module_state, checkpoint_id=path)
|
|
887
887
|
else: # deprecated
|
|
888
888
|
from torch.distributed.checkpoint import FileSystemReader
|
|
889
889
|
|
|
@@ -172,7 +172,7 @@ class ModelParallelStrategy(ParallelStrategy):
|
|
|
172
172
|
)
|
|
173
173
|
|
|
174
174
|
@override
|
|
175
|
-
def setup_module(self, module:
|
|
175
|
+
def setup_module(self, module: Module) -> Module:
|
|
176
176
|
from torch.distributed.fsdp import FullyShardedDataParallel
|
|
177
177
|
|
|
178
178
|
if any(isinstance(mod, FullyShardedDataParallel) for mod in module.modules()):
|
|
@@ -181,7 +181,7 @@ class ModelParallelStrategy(ParallelStrategy):
|
|
|
181
181
|
f" The `{self.__class__.__name__}` only supports the new FSDP2 APIs in PyTorch >= 2.4."
|
|
182
182
|
)
|
|
183
183
|
|
|
184
|
-
module = self._parallelize_fn(module, self.device_mesh)
|
|
184
|
+
module = self._parallelize_fn(module, self.device_mesh) # type: ignore[arg-type]
|
|
185
185
|
if not isinstance(module, Module):
|
|
186
186
|
raise TypeError(
|
|
187
187
|
f"The `parallelize_fn` must return a `nn.Module` instance, but got: {type(module).__name__}"
|
|
@@ -462,7 +462,7 @@ def _load_checkpoint(
|
|
|
462
462
|
_load_raw_module_state(checkpoint.pop(module_key), module, strict=strict)
|
|
463
463
|
|
|
464
464
|
state_dict_options = StateDictOptions(
|
|
465
|
-
broadcast_from_rank0=True,
|
|
465
|
+
broadcast_from_rank0=True,
|
|
466
466
|
full_state_dict=True,
|
|
467
467
|
strict=strict,
|
|
468
468
|
)
|
|
@@ -546,7 +546,7 @@ def _load_raw_module_state(
|
|
|
546
546
|
from torch.distributed.checkpoint.state_dict import StateDictOptions, set_model_state_dict
|
|
547
547
|
|
|
548
548
|
state_dict_options = StateDictOptions(
|
|
549
|
-
broadcast_from_rank0=True,
|
|
549
|
+
broadcast_from_rank0=True,
|
|
550
550
|
full_state_dict=True,
|
|
551
551
|
# must be set False to allow loading each param separately below
|
|
552
552
|
strict=False,
|
{lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/utilities/load.py
RENAMED
|
@@ -160,7 +160,7 @@ class _NotYetLoadedTensor:
|
|
|
160
160
|
return getattr(self.metatensor, name)
|
|
161
161
|
|
|
162
162
|
# materializing these is needed for quantization (see lit-gpt)
|
|
163
|
-
if name in {"contiguous", "cuda", "half"}:
|
|
163
|
+
if name in {"contiguous", "cuda", "half", "data"}:
|
|
164
164
|
return getattr(self._load_tensor(), name)
|
|
165
165
|
|
|
166
166
|
raise AttributeError(f"'{type(self).__name__}' object has no attribute '{name}'")
|
{lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/fabric/utilities/logger.py
RENAMED
|
@@ -95,7 +95,7 @@ def _flatten_dict(params: MutableMapping[Any, Any], delimiter: str = "/", parent
|
|
|
95
95
|
result: Dict[str, Any] = {}
|
|
96
96
|
for k, v in params.items():
|
|
97
97
|
new_key = parent_key + delimiter + str(k) if parent_key else str(k)
|
|
98
|
-
if is_dataclass(v):
|
|
98
|
+
if is_dataclass(v) and not isinstance(v, type):
|
|
99
99
|
v = asdict(v)
|
|
100
100
|
elif isinstance(v, Namespace):
|
|
101
101
|
v = vars(v)
|
{lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/CHANGELOG.md
RENAMED
|
@@ -15,6 +15,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
|
|
|
15
15
|
|
|
16
16
|
- Added a flag `verbose` to the `seed_everything()` function ([#20108](https://github.com/Lightning-AI/pytorch-lightning/pull/20108))
|
|
17
17
|
|
|
18
|
+
-
|
|
18
19
|
|
|
19
20
|
### Changed
|
|
20
21
|
|
|
@@ -44,6 +45,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
|
|
|
44
45
|
|
|
45
46
|
- Fixed an issue that would cause too many printouts of the seed info when using `seed_everything()` ([#20108](https://github.com/Lightning-AI/pytorch-lightning/pull/20108))
|
|
46
47
|
|
|
48
|
+
- Fixed `_LoggerConnector`'s `_ResultMetric` to move all registered keys to the device of the logged value if needed ([#19814](https://github.com/Lightning-AI/pytorch-lightning/issues/19814))
|
|
49
|
+
|
|
47
50
|
|
|
48
51
|
|
|
49
52
|
## [2.3.0] - 2024-06-13
|
|
@@ -187,9 +187,6 @@ if _RICH_AVAILABLE:
|
|
|
187
187
|
value = f"{value:{self._metrics_format}}"
|
|
188
188
|
yield f"{name}: {value}"
|
|
189
189
|
|
|
190
|
-
else:
|
|
191
|
-
Task, Style = Any, Any # type: ignore[assignment, misc]
|
|
192
|
-
|
|
193
190
|
|
|
194
191
|
@dataclass
|
|
195
192
|
class RichProgressBarTheme:
|
|
@@ -209,14 +206,14 @@ class RichProgressBarTheme:
|
|
|
209
206
|
|
|
210
207
|
"""
|
|
211
208
|
|
|
212
|
-
description: Union[str, Style] = "white"
|
|
213
|
-
progress_bar: Union[str, Style] = "#6206E0"
|
|
214
|
-
progress_bar_finished: Union[str, Style] = "#6206E0"
|
|
215
|
-
progress_bar_pulse: Union[str, Style] = "#6206E0"
|
|
216
|
-
batch_progress: Union[str, Style] = "white"
|
|
217
|
-
time: Union[str, Style] = "grey54"
|
|
218
|
-
processing_speed: Union[str, Style] = "grey70"
|
|
219
|
-
metrics: Union[str, Style] = "white"
|
|
209
|
+
description: Union[str, "Style"] = "white"
|
|
210
|
+
progress_bar: Union[str, "Style"] = "#6206E0"
|
|
211
|
+
progress_bar_finished: Union[str, "Style"] = "#6206E0"
|
|
212
|
+
progress_bar_pulse: Union[str, "Style"] = "#6206E0"
|
|
213
|
+
batch_progress: Union[str, "Style"] = "white"
|
|
214
|
+
time: Union[str, "Style"] = "grey54"
|
|
215
|
+
processing_speed: Union[str, "Style"] = "grey70"
|
|
216
|
+
metrics: Union[str, "Style"] = "white"
|
|
220
217
|
metrics_text_delimiter: str = " "
|
|
221
218
|
metrics_format: str = ".3f"
|
|
222
219
|
|
|
@@ -298,25 +295,25 @@ class RichProgressBar(ProgressBar):
|
|
|
298
295
|
return not self.is_enabled
|
|
299
296
|
|
|
300
297
|
@property
|
|
301
|
-
def train_progress_bar(self) -> Task:
|
|
298
|
+
def train_progress_bar(self) -> "Task":
|
|
302
299
|
assert self.progress is not None
|
|
303
300
|
assert self.train_progress_bar_id is not None
|
|
304
301
|
return self.progress.tasks[self.train_progress_bar_id]
|
|
305
302
|
|
|
306
303
|
@property
|
|
307
|
-
def val_sanity_check_bar(self) -> Task:
|
|
304
|
+
def val_sanity_check_bar(self) -> "Task":
|
|
308
305
|
assert self.progress is not None
|
|
309
306
|
assert self.val_sanity_progress_bar_id is not None
|
|
310
307
|
return self.progress.tasks[self.val_sanity_progress_bar_id]
|
|
311
308
|
|
|
312
309
|
@property
|
|
313
|
-
def val_progress_bar(self) -> Task:
|
|
310
|
+
def val_progress_bar(self) -> "Task":
|
|
314
311
|
assert self.progress is not None
|
|
315
312
|
assert self.val_progress_bar_id is not None
|
|
316
313
|
return self.progress.tasks[self.val_progress_bar_id]
|
|
317
314
|
|
|
318
315
|
@property
|
|
319
|
-
def test_progress_bar(self) -> Task:
|
|
316
|
+
def test_progress_bar(self) -> "Task":
|
|
320
317
|
assert self.progress is not None
|
|
321
318
|
assert self.test_progress_bar_id is not None
|
|
322
319
|
return self.progress.tasks[self.test_progress_bar_id]
|
|
@@ -211,8 +211,8 @@ class ModelPruning(Callback):
|
|
|
211
211
|
# need to ignore typing here since pytorch base class does not define the PRUNING_TYPE attribute
|
|
212
212
|
if use_global_unstructured and pruning_fn.PRUNING_TYPE != "unstructured": # type: ignore
|
|
213
213
|
raise MisconfigurationException(
|
|
214
|
-
'Only the "unstructured" PRUNING_TYPE is supported with `use_global_unstructured=True`.'
|
|
215
|
-
f" Found method {pruning_fn} of type {pruning_fn.PRUNING_TYPE}. "
|
|
214
|
+
'Only the "unstructured" PRUNING_TYPE is supported with `use_global_unstructured=True`.'
|
|
215
|
+
f" Found method {pruning_fn} of type {pruning_fn.PRUNING_TYPE}. " # type: ignore[union-attr]
|
|
216
216
|
)
|
|
217
217
|
|
|
218
218
|
self.pruning_fn = pruning_fn
|
|
@@ -308,7 +308,7 @@ class ModelPruning(Callback):
|
|
|
308
308
|
|
|
309
309
|
def _apply_local_pruning(self, amount: float) -> None:
|
|
310
310
|
for module, name in self._parameters_to_prune:
|
|
311
|
-
self.pruning_fn(module, name=name, amount=amount)
|
|
311
|
+
self.pruning_fn(module, name=name, amount=amount) # type: ignore[call-arg]
|
|
312
312
|
|
|
313
313
|
def _resolve_global_kwargs(self, amount: float) -> Dict[str, Any]:
|
|
314
314
|
self._global_kwargs["amount"] = amount
|
|
@@ -17,7 +17,7 @@ Stochastic Weight Averaging Callback
|
|
|
17
17
|
"""
|
|
18
18
|
|
|
19
19
|
from copy import deepcopy
|
|
20
|
-
from typing import Any, Callable, Dict, List, Optional, Union, cast
|
|
20
|
+
from typing import Any, Callable, Dict, List, Literal, Optional, Union, cast
|
|
21
21
|
|
|
22
22
|
import torch
|
|
23
23
|
from torch import Tensor, nn
|
|
@@ -42,7 +42,7 @@ class StochasticWeightAveraging(Callback):
|
|
|
42
42
|
swa_lrs: Union[float, List[float]],
|
|
43
43
|
swa_epoch_start: Union[int, float] = 0.8,
|
|
44
44
|
annealing_epochs: int = 10,
|
|
45
|
-
annealing_strategy:
|
|
45
|
+
annealing_strategy: Literal["cos", "linear"] = "cos",
|
|
46
46
|
avg_fn: Optional[_AVG_FN] = None,
|
|
47
47
|
device: Optional[Union[torch.device, str]] = torch.device("cpu"),
|
|
48
48
|
):
|
|
@@ -303,14 +303,14 @@ class StochasticWeightAveraging(Callback):
|
|
|
303
303
|
dtype=module.running_var.dtype,
|
|
304
304
|
)
|
|
305
305
|
self.momenta[module] = module.momentum
|
|
306
|
-
module.momentum = None
|
|
306
|
+
module.momentum = None
|
|
307
307
|
assert module.num_batches_tracked is not None
|
|
308
308
|
module.num_batches_tracked *= 0
|
|
309
309
|
|
|
310
310
|
def reset_momenta(self) -> None:
|
|
311
311
|
"""Adapted from https://github.com/pytorch/pytorch/blob/v1.7.1/torch/optim/swa_utils.py#L164-L165."""
|
|
312
312
|
for bn_module in self.momenta:
|
|
313
|
-
bn_module.momentum = self.momenta[bn_module]
|
|
313
|
+
bn_module.momentum = self.momenta[bn_module]
|
|
314
314
|
|
|
315
315
|
@staticmethod
|
|
316
316
|
def update_parameters(
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"""Demo of a simple LSTM language model.
|
|
2
|
+
|
|
3
|
+
Code is adapted from the PyTorch examples at
|
|
4
|
+
https://github.com/pytorch/examples/blob/main/word_language_model
|
|
5
|
+
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from typing import Iterator, List, Optional, Sized, Tuple
|
|
9
|
+
|
|
10
|
+
import torch
|
|
11
|
+
import torch.nn as nn
|
|
12
|
+
import torch.nn.functional as F
|
|
13
|
+
from torch import Tensor
|
|
14
|
+
from torch.optim import Optimizer
|
|
15
|
+
from torch.utils.data import DataLoader, Sampler
|
|
16
|
+
|
|
17
|
+
from lightning.pytorch.core import LightningModule
|
|
18
|
+
from lightning.pytorch.demos.transformer import WikiText2
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class SimpleLSTM(nn.Module):
|
|
22
|
+
def __init__(
|
|
23
|
+
self, vocab_size: int = 33278, ninp: int = 512, nhid: int = 512, nlayers: int = 4, dropout: float = 0.2
|
|
24
|
+
):
|
|
25
|
+
super().__init__()
|
|
26
|
+
self.vocab_size = vocab_size
|
|
27
|
+
self.drop = nn.Dropout(dropout)
|
|
28
|
+
self.encoder = nn.Embedding(vocab_size, ninp)
|
|
29
|
+
self.rnn = nn.LSTM(ninp, nhid, nlayers, dropout=dropout, batch_first=True)
|
|
30
|
+
self.decoder = nn.Linear(nhid, vocab_size)
|
|
31
|
+
self.nlayers = nlayers
|
|
32
|
+
self.nhid = nhid
|
|
33
|
+
self.init_weights()
|
|
34
|
+
|
|
35
|
+
def init_weights(self) -> None:
|
|
36
|
+
nn.init.uniform_(self.encoder.weight, -0.1, 0.1)
|
|
37
|
+
nn.init.zeros_(self.decoder.bias)
|
|
38
|
+
nn.init.uniform_(self.decoder.weight, -0.1, 0.1)
|
|
39
|
+
|
|
40
|
+
def forward(self, input: Tensor, hidden: Tuple[Tensor, Tensor]) -> Tuple[Tensor, Tensor]:
|
|
41
|
+
emb = self.drop(self.encoder(input))
|
|
42
|
+
output, hidden = self.rnn(emb, hidden)
|
|
43
|
+
output = self.drop(output)
|
|
44
|
+
decoded = self.decoder(output).view(-1, self.vocab_size)
|
|
45
|
+
return F.log_softmax(decoded, dim=1), hidden
|
|
46
|
+
|
|
47
|
+
def init_hidden(self, batch_size: int) -> Tuple[Tensor, Tensor]:
|
|
48
|
+
weight = next(self.parameters())
|
|
49
|
+
return (
|
|
50
|
+
weight.new_zeros(self.nlayers, batch_size, self.nhid),
|
|
51
|
+
weight.new_zeros(self.nlayers, batch_size, self.nhid),
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
class SequenceSampler(Sampler[List[int]]):
|
|
56
|
+
def __init__(self, dataset: Sized, batch_size: int) -> None:
|
|
57
|
+
super().__init__()
|
|
58
|
+
self.dataset = dataset
|
|
59
|
+
self.batch_size = batch_size
|
|
60
|
+
self.chunk_size = len(self.dataset) // self.batch_size
|
|
61
|
+
|
|
62
|
+
def __iter__(self) -> Iterator[List[int]]:
|
|
63
|
+
n = len(self.dataset)
|
|
64
|
+
for i in range(self.chunk_size):
|
|
65
|
+
yield list(range(i, n - (n % self.batch_size), self.chunk_size))
|
|
66
|
+
|
|
67
|
+
def __len__(self) -> int:
|
|
68
|
+
return self.chunk_size
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
class LightningLSTM(LightningModule):
|
|
72
|
+
def __init__(self, vocab_size: int = 33278):
|
|
73
|
+
super().__init__()
|
|
74
|
+
self.model = SimpleLSTM(vocab_size=vocab_size)
|
|
75
|
+
self.hidden: Optional[Tuple[Tensor, Tensor]] = None
|
|
76
|
+
|
|
77
|
+
def on_train_epoch_end(self) -> None:
|
|
78
|
+
self.hidden = None
|
|
79
|
+
|
|
80
|
+
def training_step(self, batch: Tuple[Tensor, Tensor], batch_idx: int) -> Tensor:
|
|
81
|
+
input, target = batch
|
|
82
|
+
if self.hidden is None:
|
|
83
|
+
self.hidden = self.model.init_hidden(input.size(0))
|
|
84
|
+
self.hidden = (self.hidden[0].detach(), self.hidden[1].detach())
|
|
85
|
+
output, self.hidden = self.model(input, self.hidden)
|
|
86
|
+
loss = F.nll_loss(output, target.view(-1))
|
|
87
|
+
self.log("train_loss", loss, prog_bar=True)
|
|
88
|
+
return loss
|
|
89
|
+
|
|
90
|
+
def prepare_data(self) -> None:
|
|
91
|
+
WikiText2(download=True)
|
|
92
|
+
|
|
93
|
+
def train_dataloader(self) -> DataLoader:
|
|
94
|
+
dataset = WikiText2()
|
|
95
|
+
return DataLoader(dataset, batch_sampler=SequenceSampler(dataset, batch_size=20))
|
|
96
|
+
|
|
97
|
+
def configure_optimizers(self) -> Optimizer:
|
|
98
|
+
return torch.optim.SGD(self.parameters(), lr=20.0)
|
|
@@ -40,7 +40,7 @@ class MixedPrecision(Precision):
|
|
|
40
40
|
self,
|
|
41
41
|
precision: Literal["16-mixed", "bf16-mixed"],
|
|
42
42
|
device: str,
|
|
43
|
-
scaler: Optional["torch.
|
|
43
|
+
scaler: Optional["torch.amp.GradScaler"] = None,
|
|
44
44
|
) -> None:
|
|
45
45
|
if precision not in ("16-mixed", "bf16-mixed"):
|
|
46
46
|
raise ValueError(
|
|
@@ -95,7 +95,7 @@ class Precision(FabricPrecision, CheckpointHooks):
|
|
|
95
95
|
def _wrap_closure(
|
|
96
96
|
self,
|
|
97
97
|
model: "pl.LightningModule",
|
|
98
|
-
optimizer:
|
|
98
|
+
optimizer: Steppable,
|
|
99
99
|
closure: Callable[[], Any],
|
|
100
100
|
) -> Any:
|
|
101
101
|
"""This double-closure allows makes sure the ``closure`` is executed before the ``on_before_optimizer_step``
|
|
@@ -91,7 +91,7 @@ class _Sync:
|
|
|
91
91
|
fn = self.no_op if self.fn is None or not self.should or self.rank_zero_only else self.fn
|
|
92
92
|
# save the function as `_fn` as the meta are being re-created and the object references need to match.
|
|
93
93
|
# ignore typing, bad support for `partial`: mypy/issues/1484
|
|
94
|
-
self._fn: Callable = partial(fn, reduce_op=self.op, group=self.group) # type: ignore
|
|
94
|
+
self._fn: Callable = partial(fn, reduce_op=self.op, group=self.group) # type: ignore[arg-type,operator,misc]
|
|
95
95
|
|
|
96
96
|
@property
|
|
97
97
|
def __call__(self) -> Any:
|
|
@@ -400,26 +400,19 @@ class _ResultCollection(dict):
|
|
|
400
400
|
|
|
401
401
|
# register logged value if it doesn't exist
|
|
402
402
|
if key not in self:
|
|
403
|
-
|
|
403
|
+
metric = _ResultMetric(meta, isinstance(value, Tensor))
|
|
404
|
+
self[key] = metric
|
|
404
405
|
|
|
405
406
|
# check the stored metadata and the current one match
|
|
406
407
|
elif meta != self[key].meta:
|
|
407
408
|
raise MisconfigurationException(
|
|
408
409
|
f"You called `self.log({name}, ...)` twice in `{fx}` with different arguments. This is not allowed"
|
|
409
410
|
)
|
|
411
|
+
self[key].to(value.device)
|
|
410
412
|
|
|
411
413
|
batch_size = self._extract_batch_size(self[key], batch_size, meta)
|
|
412
414
|
self.update_metrics(key, value, batch_size)
|
|
413
415
|
|
|
414
|
-
def register_key(self, key: str, meta: _Metadata, value: _VALUE) -> None:
|
|
415
|
-
"""Create one _ResultMetric object per value.
|
|
416
|
-
|
|
417
|
-
Value can be provided as a nested collection
|
|
418
|
-
|
|
419
|
-
"""
|
|
420
|
-
metric = _ResultMetric(meta, isinstance(value, Tensor)).to(value.device)
|
|
421
|
-
self[key] = metric
|
|
422
|
-
|
|
423
416
|
def update_metrics(self, key: str, value: _VALUE, batch_size: int) -> None:
|
|
424
417
|
result_metric = self[key]
|
|
425
418
|
# performance: avoid calling `__call__` to avoid the checks in `torch.nn.Module._call_impl`
|
{lightning-2.4.0.dev20240721 → lightning-2.4.0.dev20240804}/src/lightning/pytorch/tuner/lr_finder.py
RENAMED
|
@@ -132,7 +132,9 @@ class _LRFinder:
|
|
|
132
132
|
trainer.strategy.lr_scheduler_configs = [LRSchedulerConfig(scheduler, interval="step")]
|
|
133
133
|
_validate_optimizers_attached(trainer.optimizers, trainer.lr_scheduler_configs)
|
|
134
134
|
|
|
135
|
-
def plot(
|
|
135
|
+
def plot(
|
|
136
|
+
self, suggest: bool = False, show: bool = False, ax: Optional["Axes"] = None
|
|
137
|
+
) -> Optional[Union["plt.Figure", "plt.SubFigure"]]:
|
|
136
138
|
"""Plot results from lr_find run
|
|
137
139
|
Args:
|
|
138
140
|
suggest: if True, will mark suggested lr to use with a red point
|
|
@@ -151,10 +153,11 @@ class _LRFinder:
|
|
|
151
153
|
lrs = self.results["lr"]
|
|
152
154
|
losses = self.results["loss"]
|
|
153
155
|
|
|
156
|
+
fig: Optional[Union[plt.Figure, plt.SubFigure]]
|
|
154
157
|
if ax is None:
|
|
155
158
|
fig, ax = plt.subplots()
|
|
156
159
|
else:
|
|
157
|
-
fig = ax.figure
|
|
160
|
+
fig = ax.figure
|
|
158
161
|
|
|
159
162
|
# Plot loss as a function of the learning rate
|
|
160
163
|
ax.plot(lrs, losses)
|
|
@@ -460,7 +463,7 @@ class _LinearLR(LRScheduler):
|
|
|
460
463
|
super().__init__(optimizer, last_epoch)
|
|
461
464
|
|
|
462
465
|
@override
|
|
463
|
-
def get_lr(self) -> List[float]:
|
|
466
|
+
def get_lr(self) -> List[float]:
|
|
464
467
|
curr_iter = self.last_epoch + 1
|
|
465
468
|
r = curr_iter / self.num_iter
|
|
466
469
|
|
|
@@ -497,7 +500,7 @@ class _ExponentialLR(LRScheduler):
|
|
|
497
500
|
super().__init__(optimizer, last_epoch)
|
|
498
501
|
|
|
499
502
|
@override
|
|
500
|
-
def get_lr(self) -> List[float]:
|
|
503
|
+
def get_lr(self) -> List[float]:
|
|
501
504
|
curr_iter = self.last_epoch + 1
|
|
502
505
|
r = curr_iter / self.num_iter
|
|
503
506
|
|
|
@@ -127,6 +127,9 @@ class _restricted_classmethod_impl(Generic[_T, _P, _R_co]):
|
|
|
127
127
|
return wrapper
|
|
128
128
|
|
|
129
129
|
|
|
130
|
-
|
|
131
|
-
#
|
|
132
|
-
|
|
130
|
+
if TYPE_CHECKING:
|
|
131
|
+
# trick static type checkers into thinking it's a @classmethod
|
|
132
|
+
# https://github.com/microsoft/pyright/issues/5865
|
|
133
|
+
_restricted_classmethod = classmethod
|
|
134
|
+
else:
|
|
135
|
+
_restricted_classmethod = _restricted_classmethod_impl
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2.4.0.dev20240804
|