Skip to content

Commit 1a6709d

Browse files
awaelchlilexierule
authored andcommitted
v1.3.7 & changelog
add back datamodule deprecation [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci v1.3.7
1 parent 55271b1 commit 1a6709d

File tree

9 files changed

+25
-20
lines changed

9 files changed

+25
-20
lines changed

.azure-pipelines/gpu-tests.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,9 @@ jobs:
5555
displayName: 'Image info & NVIDIA'
5656
5757
- bash: |
58-
export GIT_TERMINAL_PROMPT=1
59-
#sudo apt-get install -y cmake
60-
# python -m pip install "pip==20.1"
61-
pip install --requirement requirements.txt
6258
python -c "fname = 'requirements/extra.txt' ; lines = [line for line in open(fname).readlines() if 'horovod' not in line] ; open(fname, 'w').writelines(lines)"
63-
pip install --requirement ./requirements/devel.txt --upgrade-strategy only-if-needed
64-
pip install fairscale>=0.3.4 deepspeed==0.3.14 --upgrade-strategy only-if-needed
59+
pip install fairscale>=0.3.4 deepspeed==0.3.14
60+
pip install . --requirement requirements/devel.txt
6561
pip list
6662
displayName: 'Install dependencies'
6763

CHANGELOG.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
66

7+
## [1.3.7] - 2021-06-22
8+
9+
- Fixed a bug where skipping an optimizer while using amp causes amp to trigger an assertion error ([#7975](https://github.com/PyTorchLightning/pytorch-lightning/pull/7975))
10+
- Fixed deprecation messages not showing due to incorrect stacklevel ([#8002](https://github.com/PyTorchLightning/pytorch-lightning/pull/8002), [#8005](https://github.com/PyTorchLightning/pytorch-lightning/pull/8005))
11+
- Fixed setting a `DistributedSampler` when using a distributed plugin in a custom accelerator ([#7814](https://github.com/PyTorchLightning/pytorch-lightning/pull/7814))
12+
- Improved `PyTorchProfiler` chrome traces names ([#8009](https://github.com/PyTorchLightning/pytorch-lightning/pull/8009))
13+
- Fixed moving the best score to device in `EarlyStopping` callback for TPU devices ([#7959](https://github.com/PyTorchLightning/pytorch-lightning/pull/7959))
714

815
## [1.3.6] - 2021-06-15
916

@@ -58,9 +65,6 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
5865
- Fixed training loop total batch counter when accumulate grad batches was enabled ([#7692](https://github.com/PyTorchLightning/pytorch-lightning/pull/7692))
5966

6067

61-
- Fixed a bug where skipping an optimizer while using amp causes amp to trigger an assertion error ([#7975](https://github.com/PyTorchLightning/pytorch-lightning/pull/7975))
62-
63-
6468
## [1.3.2] - 2021-05-18
6569

6670
### Changed

pytorch_lightning/__about__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import time
22

33
_this_year = time.strftime("%Y")
4-
__version__ = '1.3.6'
4+
__version__ = '1.3.7'
55
__author__ = 'William Falcon et al.'
66
__author_email__ = '[email protected]'
77
__license__ = 'Apache-2.0'

pytorch_lightning/core/datamodule.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
from torch.utils.data import DataLoader, Dataset, IterableDataset
2121

2222
from pytorch_lightning.core.hooks import CheckpointHooks, DataHooks
23-
from pytorch_lightning.utilities import rank_zero_deprecation
2423
from pytorch_lightning.utilities.argparse import add_argparse_args, from_argparse_args, get_init_arguments_and_types
2524

2625

pytorch_lightning/core/lightning.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,10 @@ def example_input_array(self, example: Any) -> None:
165165

166166
@property
167167
def datamodule(self) -> Any:
168+
rank_zero_deprecation(
169+
"The `LightningModule.datamodule` property is deprecated in v1.3 and will be removed in v1.5."
170+
" Access the datamodule through using `self.trainer.datamodule` instead."
171+
)
168172
return self._datamodule
169173

170174
@datamodule.setter

pytorch_lightning/plugins/training_type/ddp_spawn.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,7 @@
2828
from pytorch_lightning.plugins.environments.cluster_environment import ClusterEnvironment
2929
from pytorch_lightning.plugins.training_type.parallel import ParallelPlugin
3030
from pytorch_lightning.trainer.states import TrainerFn
31-
from pytorch_lightning.utilities import (
32-
_TORCH_GREATER_EQUAL_1_7,
33-
_TORCH_GREATER_EQUAL_1_8,
34-
rank_zero_warn,
35-
)
31+
from pytorch_lightning.utilities import _TORCH_GREATER_EQUAL_1_7, _TORCH_GREATER_EQUAL_1_8, rank_zero_warn
3632
from pytorch_lightning.utilities.cloud_io import atomic_save
3733
from pytorch_lightning.utilities.cloud_io import load as pl_load
3834
from pytorch_lightning.utilities.distributed import rank_zero_only, ReduceOp, sync_ddp_if_available

pytorch_lightning/plugins/training_type/deepspeed.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
from pytorch_lightning.utilities.distributed import rank_zero_info, rank_zero_only
3434
from pytorch_lightning.utilities.exceptions import MisconfigurationException
3535
from pytorch_lightning.utilities.imports import _DEEPSPEED_AVAILABLE
36-
from pytorch_lightning.utilities.warnings import _warn, LightningDeprecationWarning
3736

3837
if _DEEPSPEED_AVAILABLE:
3938
import deepspeed

pytorch_lightning/trainer/model_hooks.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
from typing import Optional
1818

1919
from pytorch_lightning.core.lightning import LightningModule
20-
from pytorch_lightning.utilities import rank_zero_deprecation
21-
from pytorch_lightning.utilities.signature_utils import is_param_in_hook_signature
2220

2321

2422
class TrainerModelHooksMixin(ABC):

tests/deprecated_api/test_remove_1-5.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
from pytorch_lightning.utilities import device_parser
3131
from pytorch_lightning.utilities.imports import _compare_version
3232
from tests.deprecated_api import no_deprecated_call
33-
from tests.helpers import BoringModel
33+
from tests.helpers import BoringDataModule, BoringModel
3434
from tests.helpers.utils import no_warning_call
3535

3636

@@ -362,6 +362,15 @@ def test_v1_5_0_trainer_gpus_str_parsing(*_):
362362
assert gpus == [0]
363363

364364

365+
def test_v1_5_0_datamodule_setter():
366+
model = BoringModel()
367+
datamodule = BoringDataModule()
368+
with no_deprecated_call(match="The `LightningModule.datamodule`"):
369+
model.datamodule = datamodule
370+
with pytest.deprecated_call(match="The `LightningModule.datamodule`"):
371+
_ = model.datamodule
372+
373+
365374
def test_v1_5_0_trainer_tbptt_steps(tmpdir):
366375
with pytest.deprecated_call(match="is deprecated in v1.3 and will be removed in v1.5"):
367376
_ = Trainer(truncated_bptt_steps=1)

0 commit comments

Comments
 (0)