Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ 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))


- Removed deprecated `TrainerModelHooksMixin.is_function_implemented` and `TrainerModelHooksMixin.has_arg` ([#10322](https://github.com/PyTorchLightning/pytorch-lightning/pull/10322))


Expand Down
15 changes: 0 additions & 15 deletions pytorch_lightning/plugins/environments/cluster_environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand All @@ -24,19 +22,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."""
Expand Down
20 changes: 0 additions & 20 deletions tests/deprecated_api/test_remove_1-6.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -420,20 +414,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))