Skip to content

Commit

Permalink
Custom Plugin is_distributed (#6537)
Browse files Browse the repository at this point in the history
* return from plugin

* dont return for tpu
  • Loading branch information
amogkam committed Mar 15, 2021
1 parent 6453091 commit 6a14146
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pytorch_lightning/trainer/connectors/accelerator_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,10 @@ def use_deepspeed(self) -> bool:

@property
def is_distributed(self) -> bool:
# Used for custom plugins.
# Custom plugins should implement is_distributed property.
if hasattr(self.training_type_plugin, 'is_distributed') and not self.on_tpu:
return self.training_type_plugin.is_distributed
is_distributed = self.use_ddp or self.use_ddp2 or self.use_horovod
if self.on_tpu:
is_distributed |= self.training_type_plugin.is_distributed
Expand Down

0 comments on commit 6a14146

Please sign in to comment.