diff --git a/src/pytorch_lightning/CHANGELOG.md b/src/pytorch_lightning/CHANGELOG.md index 6085c026f9553..c12ea445e1b5a 100644 --- a/src/pytorch_lightning/CHANGELOG.md +++ b/src/pytorch_lightning/CHANGELOG.md @@ -224,6 +224,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Removed the deprecated `SimpleProfiler.profile_iterable` and `AdvancedProfiler.profile_iterable` attributes ([#14864](https://github.com/Lightning-AI/lightning/pull/14864)) +- Remove the deprecated `Trainer.should_rank_save_checkpoint` ([#14885](https://github.com/Lightning-AI/lightning/pull/14885)) ### Fixed diff --git a/src/pytorch_lightning/trainer/trainer.py b/src/pytorch_lightning/trainer/trainer.py index c438b2f767d91..6f3e0d4ce7c4c 100644 --- a/src/pytorch_lightning/trainer/trainer.py +++ b/src/pytorch_lightning/trainer/trainer.py @@ -1755,16 +1755,6 @@ def world_size(self) -> int: # some strategies define a world size return getattr(self.strategy, "world_size", 1) - @property - def should_rank_save_checkpoint(self) -> bool: - rank_zero_deprecation( - "`Trainer.should_rank_save_checkpoint` is deprecated in v1.6 and will be removed in v1.8.", stacklevel=5 - ) - strategy = self.strategy - return ( - isinstance(strategy, pl.strategies.TPUSpawnStrategy) and strategy.local_rank == 0 or strategy.is_global_zero - ) - @property def num_nodes(self) -> int: return getattr(self.strategy, "num_nodes", 1) diff --git a/tests/tests_pytorch/deprecated_api/test_remove_1-8.py b/tests/tests_pytorch/deprecated_api/test_remove_1-8.py index a7ba047b05c7f..aa25c1cdda8ed 100644 --- a/tests/tests_pytorch/deprecated_api/test_remove_1-8.py +++ b/tests/tests_pytorch/deprecated_api/test_remove_1-8.py @@ -91,14 +91,6 @@ def test_v1_8_0_trainer_ckpt_path_attributes(fn_prefix: str): setattr(trainer, test_attr, "v") -def test_v1_8_0_deprecated_trainer_should_rank_save_checkpoint(tmpdir): - trainer = Trainer() - with pytest.deprecated_call( - match=r"`Trainer.should_rank_save_checkpoint` is deprecated in v1.6 and will be removed in v1.8." - ): - _ = trainer.should_rank_save_checkpoint - - def test_v1_8_0_trainer_optimizers_mixin(): trainer = Trainer() model = BoringModel()