Skip to content

Commit d577f46

Browse files
authored
Remove deprecated utilities.distributed.rank_zero_{warn,deprecation} (#10451)
1 parent aad8642 commit d577f46

File tree

4 files changed

+4
-30
lines changed

4 files changed

+4
-30
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
110110
* ([#10448](https://github.com/PyTorchLightning/pytorch-lightning/pull/10448))
111111

112112

113+
- Removed deprecated `utilities.distributed.rank_zero_{warn/deprecation}` ([#10451](https://github.com/PyTorchLightning/pytorch-lightning/pull/10451))
114+
115+
113116
### Fixed
114117

115118
- Fixed an issue where class or init-only variables of dataclasses were passed to the dataclass constructor in `utilities.apply_to_collection` ([#9702](https://github.com/PyTorchLightning/pytorch-lightning/issues/9702))

pytorch_lightning/callbacks/lr_monitor.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@
2727

2828
import pytorch_lightning as pl
2929
from pytorch_lightning.callbacks.base import Callback
30-
from pytorch_lightning.utilities import rank_zero_warn
31-
from pytorch_lightning.utilities.distributed import rank_zero_deprecation
30+
from pytorch_lightning.utilities import rank_zero_deprecation, rank_zero_warn
3231
from pytorch_lightning.utilities.exceptions import MisconfigurationException
3332

3433

pytorch_lightning/utilities/distributed.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -66,26 +66,6 @@ def _get_rank() -> int:
6666
rank_zero_only.rank = getattr(rank_zero_only, "rank", _get_rank())
6767

6868

69-
def rank_zero_warn(*args: Any, stacklevel: int = 5, **kwargs: Any) -> None:
70-
from pytorch_lightning.utilities.warnings import rank_zero_deprecation, rank_zero_warn
71-
72-
rank_zero_deprecation(
73-
"`pytorch_lightning.utilities.distributed.rank_zero_warn` has been moved to"
74-
" `pytorch_lightning.utilities.rank_zero_warn` in v1.3.7 and will be removed in v1.6"
75-
)
76-
return rank_zero_warn(*args, stacklevel=stacklevel, **kwargs)
77-
78-
79-
def rank_zero_deprecation(*args: Any, stacklevel: int = 5, **kwargs: Any) -> None:
80-
from pytorch_lightning.utilities.warnings import rank_zero_deprecation
81-
82-
rank_zero_deprecation(
83-
"`pytorch_lightning.utilities.distributed.rank_zero_deprecation` has been moved to"
84-
" `pytorch_lightning.utilities.rank_zero_deprecation` in v1.3.7 and will be removed in v1.6"
85-
)
86-
return rank_zero_deprecation(*args, stacklevel=stacklevel, **kwargs)
87-
88-
8969
def _info(*args: Any, stacklevel: int = 2, **kwargs: Any) -> None:
9070
if python_version() >= "3.8.0":
9171
kwargs["stacklevel"] = stacklevel

tests/deprecated_api/test_remove_1-6.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
import pytest
1818

1919
from pytorch_lightning import Trainer
20-
from pytorch_lightning.utilities.distributed import rank_zero_deprecation, rank_zero_warn
2120
from pytorch_lightning.utilities.model_helpers import is_overridden
2221
from pytorch_lightning.utilities.model_summary import ModelSummary
2322
from tests.helpers import BoringModel
@@ -78,13 +77,6 @@ def test_v1_6_0_train_loop(tmpdir):
7877
_ = trainer.train_loop
7978

8079

81-
def test_v1_6_0_rank_zero_warnings_moved():
82-
with pytest.deprecated_call(match="in v1.3.7 and will be removed in v1.6"):
83-
rank_zero_warn("test")
84-
with pytest.deprecated_call(match="in v1.3.7 and will be removed in v1.6"):
85-
rank_zero_deprecation("test")
86-
87-
8880
def test_v1_6_0_deprecated_model_summary_mode(tmpdir):
8981
model = BoringModel()
9082
with pytest.deprecated_call(match="Argument `mode` in `ModelSummary` is deprecated in v1.4"):

0 commit comments

Comments
 (0)