lightning 2.4.0.dev20240714__tar.gz → 2.4.0.dev20240728__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.dev20240714 → lightning-2.4.0.dev20240728}/.actions/assistant.py +11 -18
- {lightning-2.4.0.dev20240714/src/lightning.egg-info → lightning-2.4.0.dev20240728}/PKG-INFO +16 -15
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/README.md +8 -7
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/pyproject.toml +1 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/requirements/base.txt +0 -1
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/requirements/fabric/base.txt +0 -1
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/requirements/fabric/test.txt +1 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/requirements/pytorch/base.txt +0 -1
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/requirements/pytorch/test.txt +1 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/__setup__.py +2 -2
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/CHANGELOG.md +5 -3
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/__init__.py +0 -3
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/fabric.py +2 -2
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/loggers/csv_logs.py +0 -1
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/loggers/tensorboard.py +0 -5
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/utilities/load.py +1 -1
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/utilities/seed.py +6 -3
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/CHANGELOG.md +8 -1
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/__init__.py +0 -2
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/demos/transformer.py +1 -1
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/loggers/csv_logs.py +0 -3
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/loggers/tensorboard.py +0 -4
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/profilers/advanced.py +25 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/trainer/connectors/logger_connector/result.py +3 -10
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/trainer/trainer.py +0 -5
- lightning-2.4.0.dev20240728/src/lightning/version.info +1 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728/src/lightning.egg-info}/PKG-INFO +16 -15
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning.egg-info/SOURCES.txt +1 -1
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning.egg-info/requires.txt +6 -1
- lightning-2.4.0.dev20240728/src/version.info +1 -0
- lightning-2.4.0.dev20240714/src/lightning/version.info +0 -1
- lightning-2.4.0.dev20240714/src/version.info +0 -1
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/CITATION.cff +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/LICENSE +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/requirements/fabric/docs.txt +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/requirements/fabric/examples.txt +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/requirements/fabric/strategies.txt +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/requirements/pytorch/docs.txt +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/requirements/pytorch/examples.txt +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/requirements/pytorch/extra.txt +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/requirements/pytorch/strategies.txt +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/setup.cfg +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/setup.py +0 -0
- /lightning-2.4.0.dev20240714/src/lightning/38c573b530d46c5a2d30dc86e35587e8046a152f4dadd223 → /lightning-2.4.0.dev20240728/src/lightning/0fdd3a84997ec8a0e362f279db54032f038e6859f389ef21 +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/__about__.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/__init__.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/__version__.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/data/__init__.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/_graveyard/__init__.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/_graveyard/tpu.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/accelerators/__init__.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/accelerators/accelerator.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/accelerators/cpu.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/accelerators/cuda.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/accelerators/mps.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/accelerators/registry.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/accelerators/xla.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/cli.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/connector.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/loggers/__init__.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/loggers/logger.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/plugins/__init__.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/plugins/collectives/__init__.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/plugins/collectives/collective.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/plugins/collectives/single_device.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/plugins/collectives/torch_collective.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/plugins/environments/__init__.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/plugins/environments/cluster_environment.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/plugins/environments/kubeflow.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/plugins/environments/lightning.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/plugins/environments/lsf.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/plugins/environments/mpi.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/plugins/environments/slurm.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/plugins/environments/torchelastic.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/plugins/environments/xla.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/plugins/io/__init__.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/plugins/io/checkpoint_io.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/plugins/io/torch_io.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/plugins/io/xla.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/plugins/precision/__init__.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/plugins/precision/amp.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/plugins/precision/bitsandbytes.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/plugins/precision/deepspeed.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/plugins/precision/double.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/plugins/precision/fsdp.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/plugins/precision/half.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/plugins/precision/precision.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/plugins/precision/transformer_engine.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/plugins/precision/utils.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/plugins/precision/xla.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/strategies/__init__.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/strategies/ddp.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/strategies/deepspeed.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/strategies/dp.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/strategies/fsdp.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/strategies/launchers/__init__.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/strategies/launchers/launcher.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/strategies/launchers/multiprocessing.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/strategies/launchers/subprocess_script.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/strategies/launchers/xla.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/strategies/model_parallel.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/strategies/parallel.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/strategies/registry.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/strategies/single_device.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/strategies/single_xla.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/strategies/strategy.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/strategies/xla.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/strategies/xla_fsdp.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/utilities/__init__.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/utilities/apply_func.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/utilities/cloud_io.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/utilities/consolidate_checkpoint.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/utilities/data.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/utilities/device_dtype_mixin.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/utilities/device_parser.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/utilities/distributed.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/utilities/enums.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/utilities/exceptions.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/utilities/imports.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/utilities/init.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/utilities/logger.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/utilities/optimizer.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/utilities/rank_zero.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/utilities/registry.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/utilities/spike.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/utilities/testing/__init__.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/utilities/testing/_runif.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/utilities/throughput.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/utilities/types.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/utilities/warnings.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/wrappers.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/py.typed +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/_graveyard/__init__.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/_graveyard/_torchmetrics.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/_graveyard/hpu.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/_graveyard/precision.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/_graveyard/tpu.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/accelerators/__init__.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/accelerators/accelerator.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/accelerators/cpu.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/accelerators/cuda.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/accelerators/mps.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/accelerators/xla.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/callbacks/__init__.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/callbacks/batch_size_finder.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/callbacks/callback.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/callbacks/checkpoint.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/callbacks/device_stats_monitor.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/callbacks/early_stopping.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/callbacks/finetuning.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/callbacks/gradient_accumulation_scheduler.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/callbacks/lambda_function.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/callbacks/lr_finder.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/callbacks/lr_monitor.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/callbacks/model_checkpoint.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/callbacks/model_summary.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/callbacks/on_exception_checkpoint.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/callbacks/prediction_writer.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/callbacks/progress/__init__.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/callbacks/progress/progress_bar.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/callbacks/progress/rich_progress.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/callbacks/progress/tqdm_progress.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/callbacks/pruning.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/callbacks/rich_model_summary.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/callbacks/spike.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/callbacks/stochastic_weight_avg.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/callbacks/throughput_monitor.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/callbacks/timer.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/cli.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/core/__init__.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/core/datamodule.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/core/hooks.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/core/mixins/__init__.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/core/mixins/hparams_mixin.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/core/module.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/core/optimizer.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/core/saving.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/demos/__init__.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/demos/boring_classes.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/demos/mnist_datamodule.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/loggers/__init__.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/loggers/comet.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/loggers/logger.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/loggers/mlflow.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/loggers/neptune.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/loggers/utilities.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/loggers/wandb.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/loops/__init__.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/loops/evaluation_loop.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/loops/fetchers.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/loops/fit_loop.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/loops/loop.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/loops/optimization/__init__.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/loops/optimization/automatic.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/loops/optimization/closure.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/loops/optimization/manual.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/loops/prediction_loop.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/loops/progress.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/loops/training_epoch_loop.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/loops/utilities.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/overrides/__init__.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/overrides/distributed.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/plugins/__init__.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/plugins/environments/__init__.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/plugins/io/__init__.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/plugins/io/async_plugin.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/plugins/io/checkpoint_plugin.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/plugins/io/torch_plugin.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/plugins/io/wrapper.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/plugins/io/xla_plugin.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/plugins/layer_sync.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/plugins/precision/__init__.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/plugins/precision/amp.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/plugins/precision/bitsandbytes.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/plugins/precision/deepspeed.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/plugins/precision/double.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/plugins/precision/fsdp.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/plugins/precision/half.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/plugins/precision/precision.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/plugins/precision/transformer_engine.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/plugins/precision/xla.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/profilers/__init__.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/profilers/base.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/profilers/profiler.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/profilers/pytorch.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/profilers/simple.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/profilers/xla.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/serve/__init__.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/serve/servable_module.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/serve/servable_module_validator.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/strategies/__init__.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/strategies/ddp.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/strategies/deepspeed.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/strategies/fsdp.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/strategies/launchers/__init__.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/strategies/launchers/launcher.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/strategies/launchers/multiprocessing.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/strategies/launchers/subprocess_script.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/strategies/launchers/xla.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/strategies/model_parallel.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/strategies/parallel.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/strategies/single_device.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/strategies/single_xla.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/strategies/strategy.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/strategies/xla.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/trainer/__init__.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/trainer/call.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/trainer/configuration_validator.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/trainer/connectors/__init__.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/trainer/connectors/accelerator_connector.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/trainer/connectors/callback_connector.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/trainer/connectors/checkpoint_connector.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/trainer/connectors/data_connector.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/trainer/connectors/logger_connector/__init__.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/trainer/connectors/logger_connector/fx_validator.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/trainer/connectors/logger_connector/logger_connector.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/trainer/connectors/signal_connector.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/trainer/setup.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/trainer/states.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/tuner/__init__.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/tuner/batch_size_scaling.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/tuner/lr_finder.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/tuner/tuning.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/utilities/__init__.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/utilities/_pytree.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/utilities/argparse.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/utilities/combined_loader.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/utilities/compile.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/utilities/consolidate_checkpoint.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/utilities/data.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/utilities/deepspeed.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/utilities/enums.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/utilities/exceptions.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/utilities/grads.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/utilities/imports.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/utilities/memory.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/utilities/migration/__init__.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/utilities/migration/migration.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/utilities/migration/utils.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/utilities/model_helpers.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/utilities/model_summary/__init__.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/utilities/model_summary/model_summary.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/utilities/model_summary/model_summary_deepspeed.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/utilities/parameter_tying.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/utilities/parsing.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/utilities/rank_zero.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/utilities/seed.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/utilities/signature_utils.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/utilities/testing/__init__.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/utilities/testing/_runif.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/utilities/types.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/utilities/upgrade_checkpoint.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/utilities/warnings.py +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning.egg-info/dependency_links.txt +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning.egg-info/entry_points.txt +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning.egg-info/not-zip-safe +0 -0
- {lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning.egg-info/top_level.txt +0 -0
|
@@ -22,9 +22,9 @@ from distutils.version import LooseVersion
|
|
|
22
22
|
from itertools import chain
|
|
23
23
|
from os.path import dirname, isfile
|
|
24
24
|
from pathlib import Path
|
|
25
|
-
from typing import Any, Dict, Iterable, Iterator, List, Optional, Sequence, Tuple
|
|
25
|
+
from typing import Any, Dict, Iterable, Iterator, List, Optional, Sequence, Tuple
|
|
26
26
|
|
|
27
|
-
from
|
|
27
|
+
from packaging.requirements import Requirement
|
|
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
87
|
major = LooseVersion(version).version[0]
|
|
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.4.0.
|
|
3
|
+
Version: 2.4.0.dev20240728
|
|
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.
|
|
@@ -28,28 +28,28 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
28
28
|
Requires-Python: >=3.9
|
|
29
29
|
Description-Content-Type: text/markdown
|
|
30
30
|
Provides-Extra: fabric-strategies
|
|
31
|
-
Provides-Extra: fabric-test
|
|
32
31
|
Provides-Extra: fabric-examples
|
|
32
|
+
Provides-Extra: fabric-test
|
|
33
33
|
Provides-Extra: pytorch-strategies
|
|
34
|
-
Provides-Extra: pytorch-extra
|
|
35
|
-
Provides-Extra: pytorch-test
|
|
36
34
|
Provides-Extra: pytorch-examples
|
|
35
|
+
Provides-Extra: pytorch-test
|
|
36
|
+
Provides-Extra: pytorch-extra
|
|
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
41
|
Provides-Extra: strategies
|
|
42
|
-
Provides-Extra: test
|
|
43
42
|
Provides-Extra: examples
|
|
44
|
-
Provides-Extra:
|
|
43
|
+
Provides-Extra: test
|
|
45
44
|
Provides-Extra: extra
|
|
45
|
+
Provides-Extra: data
|
|
46
46
|
Provides-Extra: all
|
|
47
47
|
Provides-Extra: dev
|
|
48
48
|
License-File: LICENSE
|
|
49
49
|
|
|
50
50
|
<div align="center">
|
|
51
51
|
|
|
52
|
-
<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%;">
|
|
53
53
|
|
|
54
54
|
<br/>
|
|
55
55
|
<br/>
|
|
@@ -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.dev20240728">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,12 +141,13 @@ ______________________________________________________________________
|
|
|
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 segmentation](https://lightning.ai/lightning-ai/studios/image-segmentation-with-pytorch-lightning) | Finetune - ResNet-50 model to segment images
|
|
148
|
-
| [Text classification](https://lightning.ai/lightning-ai/studios/text-classification-with-pytorch-lightning) | Finetune - text classifier (BERT model)
|
|
149
|
-
| [
|
|
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 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> |
|
|
148
|
+
| [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
|
+
| [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) | <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> |
|
|
150
151
|
|
|
151
152
|
### Hello simple model
|
|
152
153
|
|
|
@@ -582,7 +583,7 @@ Lightning is rigorously tested across multiple CPUs, GPUs and TPUs and against m
|
|
|
582
583
|
|
|
583
584
|
| System / PyTorch ver. | 1.13 | 2.0 | 2.1 |
|
|
584
585
|
| :--------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
|
|
585
|
-
| Linux py3.9 \[GPUs\] | | | [](https://dev.azure.com/Lightning-AI/lightning/_build/latest?definitionId=24&branchName=master) |
|
|
586
587
|
| Linux py3.9 \[TPUs\] | | [](https://github.com/Lightning-AI/lightning/actions/workflows/tpu-tests.yml) | |
|
|
587
588
|
| 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) |
|
|
588
589
|
| 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,12 +133,13 @@ ______________________________________________________________________
|
|
|
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 segmentation](https://lightning.ai/lightning-ai/studios/image-segmentation-with-pytorch-lightning) | Finetune - ResNet-50 model to segment images
|
|
140
|
-
| [Text classification](https://lightning.ai/lightning-ai/studios/text-classification-with-pytorch-lightning) | Finetune - text classifier (BERT model)
|
|
141
|
-
| [
|
|
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 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> |
|
|
140
|
+
| [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
|
+
| [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) | <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> |
|
|
142
143
|
|
|
143
144
|
### Hello simple model
|
|
144
145
|
|
|
@@ -1,7 +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
|
-
numpy >=1.21.0, <1.27.0
|
|
5
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
|
|
@@ -1,7 +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
|
-
numpy >=1.21.0, <1.27.0
|
|
5
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
|
|
@@ -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,7 +87,7 @@ 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",
|
{lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/CHANGELOG.md
RENAMED
|
@@ -11,13 +11,14 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
|
|
|
11
11
|
|
|
12
12
|
- Made saving non-distributed checkpoints fully atomic ([#20011](https://github.com/Lightning-AI/pytorch-lightning/pull/20011))
|
|
13
13
|
|
|
14
|
-
-
|
|
14
|
+
- Added a flag `verbose` to the `seed_everything()` function ([#20108](https://github.com/Lightning-AI/pytorch-lightning/pull/20108))
|
|
15
|
+
|
|
15
16
|
|
|
16
17
|
### Changed
|
|
17
18
|
|
|
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))
|
|
19
20
|
|
|
20
|
-
-
|
|
21
|
+
- NumPy is no longer a required dependency ([#20090](https://github.com/Lightning-AI/pytorch-lightning/issues/20090))
|
|
21
22
|
|
|
22
23
|
### Deprecated
|
|
23
24
|
|
|
@@ -34,7 +35,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
|
|
|
34
35
|
|
|
35
36
|
### Fixed
|
|
36
37
|
|
|
37
|
-
-
|
|
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
|
+
|
|
38
40
|
|
|
39
41
|
-
|
|
40
42
|
|
{lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/__init__.py
RENAMED
|
@@ -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()
|
|
@@ -909,7 +909,7 @@ class Fabric:
|
|
|
909
909
|
logger.log_metrics(metrics=metrics, step=step)
|
|
910
910
|
|
|
911
911
|
@staticmethod
|
|
912
|
-
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:
|
|
913
913
|
r"""Helper function to seed everything without explicitly importing Lightning.
|
|
914
914
|
|
|
915
915
|
See :func:`~lightning.fabric.utilities.seed.seed_everything` for more details.
|
|
@@ -919,7 +919,7 @@ class Fabric:
|
|
|
919
919
|
# Lightning sets `workers=False` by default to avoid breaking reproducibility, but since this is a new
|
|
920
920
|
# release, we can afford to do it.
|
|
921
921
|
workers = True
|
|
922
|
-
return seed_everything(seed=seed, workers=workers)
|
|
922
|
+
return seed_everything(seed=seed, workers=workers, verbose=verbose)
|
|
923
923
|
|
|
924
924
|
def _wrap_and_launch(self, to_run: Callable, *args: Any, **kwargs: Any) -> Any:
|
|
925
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:
|
|
@@ -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.4.0.dev20240714 → lightning-2.4.0.dev20240728}/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.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/fabric/utilities/seed.py
RENAMED
|
@@ -17,7 +17,7 @@ max_seed_value = 4294967295 # 2^32 - 1 (uint32)
|
|
|
17
17
|
min_seed_value = 0
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
def seed_everything(seed: Optional[int] = None, workers: bool = False) -> int:
|
|
20
|
+
def seed_everything(seed: Optional[int] = None, workers: bool = False, verbose: bool = True) -> int:
|
|
21
21
|
r"""Function that sets the seed for pseudo-random number generators in: torch, numpy, and Python's random module.
|
|
22
22
|
In addition, sets the following environment variables:
|
|
23
23
|
|
|
@@ -32,6 +32,7 @@ def seed_everything(seed: Optional[int] = None, workers: bool = False) -> int:
|
|
|
32
32
|
Trainer with a ``worker_init_fn``. If the user already provides such a function
|
|
33
33
|
for their dataloaders, setting this argument will have no influence. See also:
|
|
34
34
|
:func:`~lightning.fabric.utilities.seed.pl_worker_init_function`.
|
|
35
|
+
verbose: Whether to print a message on each rank with the seed being set.
|
|
35
36
|
|
|
36
37
|
"""
|
|
37
38
|
if seed is None:
|
|
@@ -52,7 +53,9 @@ def seed_everything(seed: Optional[int] = None, workers: bool = False) -> int:
|
|
|
52
53
|
rank_zero_warn(f"{seed} is not in bounds, numpy accepts from {min_seed_value} to {max_seed_value}")
|
|
53
54
|
seed = 0
|
|
54
55
|
|
|
55
|
-
|
|
56
|
+
if verbose:
|
|
57
|
+
log.info(rank_prefixed_message(f"Seed set to {seed}", _get_rank()))
|
|
58
|
+
|
|
56
59
|
os.environ["PL_GLOBAL_SEED"] = str(seed)
|
|
57
60
|
random.seed(seed)
|
|
58
61
|
if _NUMPY_AVAILABLE:
|
|
@@ -76,7 +79,7 @@ def reset_seed() -> None:
|
|
|
76
79
|
if seed is None:
|
|
77
80
|
return
|
|
78
81
|
workers = os.environ.get("PL_SEED_WORKERS", "0")
|
|
79
|
-
seed_everything(int(seed), workers=bool(int(workers)))
|
|
82
|
+
seed_everything(int(seed), workers=bool(int(workers)), verbose=False)
|
|
80
83
|
|
|
81
84
|
|
|
82
85
|
def pl_worker_init_function(worker_id: int, rank: Optional[int] = None) -> None: # pragma: no cover
|
{lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/CHANGELOG.md
RENAMED
|
@@ -11,6 +11,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
|
|
|
11
11
|
|
|
12
12
|
- Made saving non-distributed checkpoints fully atomic ([#20011](https://github.com/Lightning-AI/pytorch-lightning/pull/20011))
|
|
13
13
|
|
|
14
|
+
- Added `dump_stats` flag to `AdvancedProfiler` ([#19703](https://github.com/Lightning-AI/pytorch-lightning/issues/19703))
|
|
15
|
+
|
|
16
|
+
- Added a flag `verbose` to the `seed_everything()` function ([#20108](https://github.com/Lightning-AI/pytorch-lightning/pull/20108))
|
|
17
|
+
|
|
14
18
|
-
|
|
15
19
|
|
|
16
20
|
### Changed
|
|
@@ -19,6 +23,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
|
|
|
19
23
|
|
|
20
24
|
- 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))
|
|
21
25
|
|
|
26
|
+
- NumPy is no longer a required dependency ([#20090](https://github.com/Lightning-AI/pytorch-lightning/issues/20090))
|
|
22
27
|
|
|
23
28
|
### Deprecated
|
|
24
29
|
|
|
@@ -38,7 +43,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
|
|
|
38
43
|
|
|
39
44
|
- Avoid LightningCLI saving hyperparameters with `class_path` and `init_args` since this would be a breaking change ([#20068](https://github.com/Lightning-AI/pytorch-lightning/pull/20068))
|
|
40
45
|
|
|
41
|
-
-
|
|
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))
|
|
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))
|
|
42
49
|
|
|
43
50
|
|
|
44
51
|
|
{lightning-2.4.0.dev20240714 → lightning-2.4.0.dev20240728}/src/lightning/pytorch/__init__.py
RENAMED
|
@@ -33,8 +33,6 @@ import lightning.pytorch._graveyard # noqa: E402, F401 # isort: skip
|
|
|
33
33
|
|
|
34
34
|
__all__ = ["Trainer", "LightningDataModule", "LightningModule", "Callback", "seed_everything"]
|
|
35
35
|
|
|
36
|
-
# for compatibility with namespace packages
|
|
37
|
-
__import__("pkg_resources").declare_namespace(__name__)
|
|
38
36
|
|
|
39
37
|
LIGHTNING_LOGO: str = """
|
|
40
38
|
####
|
|
@@ -88,7 +88,7 @@ class PositionalEncoding(nn.Module):
|
|
|
88
88
|
# TODO: Could make this a `nn.Parameter` with `requires_grad=False`
|
|
89
89
|
self.pe = self._init_pos_encoding(device=x.device)
|
|
90
90
|
|
|
91
|
-
x + self.pe[: x.size(0), :]
|
|
91
|
+
x = x + self.pe[: x.size(0), :]
|
|
92
92
|
return self.dropout(x)
|
|
93
93
|
|
|
94
94
|
def _init_pos_encoding(self, device: torch.device) -> Tensor:
|
|
@@ -19,7 +19,6 @@ CSV logger for basic experiment logging that does not require opening ports
|
|
|
19
19
|
|
|
20
20
|
"""
|
|
21
21
|
|
|
22
|
-
import logging
|
|
23
22
|
import os
|
|
24
23
|
from argparse import Namespace
|
|
25
24
|
from typing import Any, Dict, Optional, Union
|
|
@@ -35,8 +34,6 @@ from lightning.pytorch.core.saving import save_hparams_to_yaml
|
|
|
35
34
|
from lightning.pytorch.loggers.logger import Logger
|
|
36
35
|
from lightning.pytorch.utilities.rank_zero import rank_zero_only
|
|
37
36
|
|
|
38
|
-
log = logging.getLogger(__name__)
|
|
39
|
-
|
|
40
37
|
|
|
41
38
|
class ExperimentWriter(_FabricExperimentWriter):
|
|
42
39
|
r"""Experiment writer for CSVLogger.
|
|
@@ -16,7 +16,6 @@ TensorBoard Logger
|
|
|
16
16
|
------------------
|
|
17
17
|
"""
|
|
18
18
|
|
|
19
|
-
import logging
|
|
20
19
|
import os
|
|
21
20
|
from argparse import Namespace
|
|
22
21
|
from typing import Any, Dict, Optional, Union
|
|
@@ -36,8 +35,6 @@ from lightning.pytorch.loggers.logger import Logger
|
|
|
36
35
|
from lightning.pytorch.utilities.imports import _OMEGACONF_AVAILABLE
|
|
37
36
|
from lightning.pytorch.utilities.rank_zero import rank_zero_only, rank_zero_warn
|
|
38
37
|
|
|
39
|
-
log = logging.getLogger(__name__)
|
|
40
|
-
|
|
41
38
|
|
|
42
39
|
class TensorBoardLogger(Logger, FabricTensorBoardLogger):
|
|
43
40
|
r"""Log to local or remote file system in `TensorBoard <https://www.tensorflow.org/tensorboard>`_ format.
|
|
@@ -245,7 +242,6 @@ class TensorBoardLogger(Logger, FabricTensorBoardLogger):
|
|
|
245
242
|
try:
|
|
246
243
|
listdir_info = self._fs.listdir(root_dir)
|
|
247
244
|
except OSError:
|
|
248
|
-
log.warning("Missing logger folder: %s", root_dir)
|
|
249
245
|
return 0
|
|
250
246
|
|
|
251
247
|
existing_versions = []
|
|
@@ -16,13 +16,17 @@
|
|
|
16
16
|
import cProfile
|
|
17
17
|
import io
|
|
18
18
|
import logging
|
|
19
|
+
import os
|
|
19
20
|
import pstats
|
|
21
|
+
import tempfile
|
|
20
22
|
from pathlib import Path
|
|
21
23
|
from typing import Dict, Optional, Tuple, Union
|
|
22
24
|
|
|
23
25
|
from typing_extensions import override
|
|
24
26
|
|
|
27
|
+
from lightning.fabric.utilities.cloud_io import get_filesystem
|
|
25
28
|
from lightning.pytorch.profilers.profiler import Profiler
|
|
29
|
+
from lightning.pytorch.utilities.rank_zero import rank_zero_only
|
|
26
30
|
|
|
27
31
|
log = logging.getLogger(__name__)
|
|
28
32
|
|
|
@@ -40,6 +44,7 @@ class AdvancedProfiler(Profiler):
|
|
|
40
44
|
dirpath: Optional[Union[str, Path]] = None,
|
|
41
45
|
filename: Optional[str] = None,
|
|
42
46
|
line_count_restriction: float = 1.0,
|
|
47
|
+
dump_stats: bool = False,
|
|
43
48
|
) -> None:
|
|
44
49
|
"""
|
|
45
50
|
Args:
|
|
@@ -54,6 +59,8 @@ class AdvancedProfiler(Profiler):
|
|
|
54
59
|
reported for each action. either an integer (to select a count of lines),
|
|
55
60
|
or a decimal fraction between 0.0 and 1.0 inclusive (to select a percentage of lines)
|
|
56
61
|
|
|
62
|
+
dump_stats: Whether to save raw profiler results. When ``True`` then ``dirpath`` must be provided.
|
|
63
|
+
|
|
57
64
|
Raises:
|
|
58
65
|
ValueError:
|
|
59
66
|
If you attempt to stop recording an action which was never started.
|
|
@@ -61,6 +68,7 @@ class AdvancedProfiler(Profiler):
|
|
|
61
68
|
super().__init__(dirpath=dirpath, filename=filename)
|
|
62
69
|
self.profiled_actions: Dict[str, cProfile.Profile] = {}
|
|
63
70
|
self.line_count_restriction = line_count_restriction
|
|
71
|
+
self.dump_stats = dump_stats
|
|
64
72
|
|
|
65
73
|
@override
|
|
66
74
|
def start(self, action_name: str) -> None:
|
|
@@ -75,10 +83,27 @@ class AdvancedProfiler(Profiler):
|
|
|
75
83
|
raise ValueError(f"Attempting to stop recording an action ({action_name}) which was never started.")
|
|
76
84
|
pr.disable()
|
|
77
85
|
|
|
86
|
+
def _dump_stats(self, action_name: str, profile: cProfile.Profile) -> None:
|
|
87
|
+
assert self.dirpath
|
|
88
|
+
dst_filepath = os.path.join(self.dirpath, self._prepare_filename(action_name=action_name, extension=".prof"))
|
|
89
|
+
dst_fs = get_filesystem(dst_filepath)
|
|
90
|
+
dst_fs.mkdirs(self.dirpath, exist_ok=True)
|
|
91
|
+
# temporarily save to local since pstats can only dump into a local file
|
|
92
|
+
with tempfile.TemporaryDirectory(
|
|
93
|
+
prefix="test", suffix=str(rank_zero_only.rank), dir=os.getcwd()
|
|
94
|
+
) as tmp_dir, dst_fs.open(dst_filepath, "wb") as dst_file:
|
|
95
|
+
src_filepath = os.path.join(tmp_dir, "tmp.prof")
|
|
96
|
+
profile.dump_stats(src_filepath)
|
|
97
|
+
src_fs = get_filesystem(src_filepath)
|
|
98
|
+
with src_fs.open(src_filepath, "rb") as src_file:
|
|
99
|
+
dst_file.write(src_file.read())
|
|
100
|
+
|
|
78
101
|
@override
|
|
79
102
|
def summary(self) -> str:
|
|
80
103
|
recorded_stats = {}
|
|
81
104
|
for action_name, pr in self.profiled_actions.items():
|
|
105
|
+
if self.dump_stats:
|
|
106
|
+
self._dump_stats(action_name, pr)
|
|
82
107
|
s = io.StringIO()
|
|
83
108
|
ps = pstats.Stats(pr, stream=s).strip_dirs().sort_stats("cumulative")
|
|
84
109
|
ps.print_stats(self.line_count_restriction)
|
|
@@ -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`
|