From d0c936b759b9f71b0108df4c336227a37bd6178f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20W=C3=A4lchli?= Date: Wed, 3 Nov 2021 17:11:02 +0100 Subject: [PATCH 1/3] remove deprecated "creates_children" method --- .../plugins/environments/cluster_environment.py | 13 ------------- tests/deprecated_api/test_remove_1-6.py | 14 -------------- 2 files changed, 27 deletions(-) diff --git a/pytorch_lightning/plugins/environments/cluster_environment.py b/pytorch_lightning/plugins/environments/cluster_environment.py index 237842b4ffb59..ef651ce32e85e 100644 --- a/pytorch_lightning/plugins/environments/cluster_environment.py +++ b/pytorch_lightning/plugins/environments/cluster_environment.py @@ -24,19 +24,6 @@ class ClusterEnvironment(ABC): def creates_processes_externally(self) -> bool: """Whether the environment creates the subprocesses or not.""" - def creates_children(self) -> bool: - """Whether the environment creates the subprocesses or not. - - .. deprecated:: v1.5 - This method was deprecated in v1.5 and will be removed in v1.6. Use the property - :attr:`creates_processes_externally` instead. - """ - rank_zero_deprecation( - f"`{self.__class__.__name__}.creates_children()` was deprecated in v1.5 and will be removed in v1.6." - " Use the property :attr:`creates_processes_externally` instead." - ) - return self.creates_processes_externally - @abstractmethod def master_address(self) -> str: """The master address through which all processes connect and communicate.""" diff --git a/tests/deprecated_api/test_remove_1-6.py b/tests/deprecated_api/test_remove_1-6.py index 62791b482c186..5c256985a8b9e 100644 --- a/tests/deprecated_api/test_remove_1-6.py +++ b/tests/deprecated_api/test_remove_1-6.py @@ -431,20 +431,6 @@ def test_v1_6_0_is_slurm_managing_tasks(): trainer._accelerator_connector.is_slurm_managing_tasks = False -@pytest.mark.parametrize( - "cluster_environment", - [ - KubeflowEnvironment(), - LightningEnvironment(), - SLURMEnvironment(), - TorchElasticEnvironment(), - ], -) -def test_v1_6_0_cluster_environment_creates_children(cluster_environment): - with pytest.deprecated_call(match="was deprecated in v1.5 and will be removed in v1.6"): - cluster_environment.creates_children() - - def test_v1_6_0_master_params(): with pytest.deprecated_call(match="`PrecisionPlugin.master_params` was deprecated in v1.5"): PrecisionPlugin().master_params(Mock(spec=Optimizer)) From 25585b3d96f66996eb156a1bae6d09ebec306134 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20W=C3=A4lchli?= Date: Wed, 3 Nov 2021 17:11:36 +0100 Subject: [PATCH 2/3] unused imports --- .../plugins/environments/cluster_environment.py | 2 -- tests/deprecated_api/test_remove_1-6.py | 6 ------ 2 files changed, 8 deletions(-) diff --git a/pytorch_lightning/plugins/environments/cluster_environment.py b/pytorch_lightning/plugins/environments/cluster_environment.py index ef651ce32e85e..dd1a43c45756a 100644 --- a/pytorch_lightning/plugins/environments/cluster_environment.py +++ b/pytorch_lightning/plugins/environments/cluster_environment.py @@ -13,8 +13,6 @@ # limitations under the License. from abc import ABC, abstractmethod -from pytorch_lightning.utilities import rank_zero_deprecation - class ClusterEnvironment(ABC): """Specification of a cluster environment.""" diff --git a/tests/deprecated_api/test_remove_1-6.py b/tests/deprecated_api/test_remove_1-6.py index 5c256985a8b9e..48b7c888e3432 100644 --- a/tests/deprecated_api/test_remove_1-6.py +++ b/tests/deprecated_api/test_remove_1-6.py @@ -22,12 +22,6 @@ from pytorch_lightning.callbacks import ModelCheckpoint from pytorch_lightning.callbacks.early_stopping import EarlyStopping from pytorch_lightning.plugins import PrecisionPlugin -from pytorch_lightning.plugins.environments import ( - KubeflowEnvironment, - LightningEnvironment, - SLURMEnvironment, - TorchElasticEnvironment, -) from pytorch_lightning.plugins.training_type import DDPPlugin, DDPSpawnPlugin from pytorch_lightning.utilities.distributed import rank_zero_deprecation, rank_zero_warn from pytorch_lightning.utilities.model_helpers import is_overridden From 133c84c858d8abc05c03370e4156dee8e832b95c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20W=C3=A4lchli?= Date: Wed, 3 Nov 2021 17:14:24 +0100 Subject: [PATCH 3/3] update changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eabd9329f0c73..78e1970efe3f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -57,7 +57,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). ### Removed -- +- Remove deprecated method `ClusterEnvironment.creates_children` ([#10339](https://github.com/PyTorchLightning/pytorch-lightning/issues/10339)) -