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
2 changes: 1 addition & 1 deletion docs/source/governance.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Board

Alumni
------
- Jeff Yang (`ydcjeff <https://github.com/ydcjeff>`_)
- Jeff Yang (`ydcjeff <https://github.com/ydcjeff>`_)
- Jeff Ling (`jeffling <https://github.com/jeffling>`_)
- Teddy Koker (`teddykoker <https://github.com/teddykoker>`_)
- Nate Raw (`nateraw <https://github.com/nateraw>`_)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -742,6 +742,11 @@ def set_distributed_mode(self, distributed_backend: Optional[str] = None):

# special case with DDP on CPUs
if self.distributed_backend == "ddp_cpu":
if _TPU_AVAILABLE:
raise MisconfigurationException(
"`accelerator='ddp_cpu'` is not supported on TPU machines. "
"Learn more: https://github.com/PyTorchLightning/pytorch-lightning/issues/7810"
)
self._distrib_type = DistributedType.DDP_SPAWN
if self.num_gpus > 0:
rank_zero_warn(
Expand Down
7 changes: 7 additions & 0 deletions tests/accelerators/test_tpu_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,3 +264,10 @@ def on_train_end(self, trainer, pl_module):

for param, param_copy in zip(model.parameters(), model_copy.parameters()):
assert not torch.equal(param.cpu().data, param_copy.data)


@RunIf(tpu=True)
def test_ddp_cpu_not_supported_on_tpus():

with pytest.raises(MisconfigurationException, match="`accelerator='ddp_cpu'` is not supported on TPU machines"):
Trainer(accelerator="ddp_cpu")