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 @@ -451,6 +451,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Remove `epoch` from `trainer.logged_metrics` ([#9904](https://github.com/PyTorchLightning/pytorch-lightning/pull/9904))


- Removed `should_rank_save_checkpoint` property from Trainer ([#9433](https://github.com/PyTorchLightning/pytorch-lightning/pull/9433))


### Fixed


Expand Down
2 changes: 1 addition & 1 deletion pytorch_lightning/callbacks/model_checkpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ def __resolve_ckpt_dir(self, trainer: "pl.Trainer") -> None:

self.dirpath = ckpt_path

if not trainer.fast_dev_run and trainer.should_rank_save_checkpoint:
if not trainer.fast_dev_run and trainer.training_type_plugin.should_rank_save_checkpoint:
self._fs.makedirs(self.dirpath, exist_ok=True)

def __warn_if_dir_not_empty(self, dirpath: _PATH) -> None:
Expand Down
4 changes: 0 additions & 4 deletions pytorch_lightning/trainer/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1507,10 +1507,6 @@ def world_size(self) -> int:
# some training types define a world size
return getattr(self.accelerator.training_type_plugin, "world_size", 1)

@property
def should_rank_save_checkpoint(self) -> bool:
return self.accelerator.training_type_plugin.should_rank_save_checkpoint

@property
def _distrib_type(self) -> DistributedType:
return self.accelerator_connector._distrib_type
Expand Down