From e82c66ba69a86be6ac256d838d0c6ce7220f02e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20W=C3=A4lchli?= Date: Fri, 30 Jul 2021 12:01:00 +0200 Subject: [PATCH] exclude mpi run from auto-detection of horovod (#8610) --- pytorch_lightning/trainer/connectors/accelerator_connector.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pytorch_lightning/trainer/connectors/accelerator_connector.py b/pytorch_lightning/trainer/connectors/accelerator_connector.py index c50590905631b..ebcbfa74e6613 100644 --- a/pytorch_lightning/trainer/connectors/accelerator_connector.py +++ b/pytorch_lightning/trainer/connectors/accelerator_connector.py @@ -857,7 +857,7 @@ def check_horovod(self): @staticmethod def has_horovodrun() -> bool: """Returns True if running with `horovodrun` using Gloo or OpenMPI.""" - return "OMPI_COMM_WORLD_RANK" in os.environ or "HOROVOD_RANK" in os.environ + return _HOROVOD_AVAILABLE and ("OMPI_COMM_WORLD_RANK" in os.environ or "HOROVOD_RANK" in os.environ) def update_device_type_if_ipu_plugin(self) -> None: # This allows the poptorch.Options that are passed into the IPUPlugin to be the source of truth,