Skip to content

Commit

Permalink
Remove AcceleratorConnector.devices
Browse files Browse the repository at this point in the history
  • Loading branch information
DuYicong515 committed Mar 24, 2022
1 parent a9bfcc7 commit 951393a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -757,6 +757,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Removed `AcceleratorConnector.parallel_device_ids` property ([#12072](https://github.com/PyTorchLightning/pytorch-lightning/pull/12072))


- Removed `AcceleratorConnector.devices` property ([#12435](https://github.com/PyTorchLightning/pytorch-lightning/pull/12435))


### Fixed

- Fixed an issue where `ModelCheckpoint` could delete older checkpoints when `dirpath` has changed during resumed training ([#12045](https://github.com/PyTorchLightning/pytorch-lightning/pull/12045))
Expand Down
9 changes: 0 additions & 9 deletions pytorch_lightning/trainer/connectors/accelerator_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
DeepSpeedStrategy,
HorovodStrategy,
IPUStrategy,
ParallelStrategy,
SingleDeviceStrategy,
SingleTPUStrategy,
Strategy,
Expand Down Expand Up @@ -784,14 +783,6 @@ def _lazy_init_strategy(self) -> None:
def parallel_devices(self) -> List[Union[torch.device, int]]:
return self._parallel_devices

@property
def devices(self) -> int:
if isinstance(self.strategy, SingleDeviceStrategy):
return 1
elif isinstance(self.strategy, ParallelStrategy):
return len(self.strategy.parallel_devices)
return 0

@property
def tpu_cores(self) -> Optional[Union[List[int], int]]:
if isinstance(self.accelerator, TPUAccelerator):
Expand Down

0 comments on commit 951393a

Please sign in to comment.