From 46ae295d0b4fb460e89f62244673b7838809d9be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20W=C3=A4lchli?= Date: Thu, 29 Jul 2021 03:38:25 +0200 Subject: [PATCH 1/3] fix --- pytorch_lightning/trainer/connectors/accelerator_connector.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pytorch_lightning/trainer/connectors/accelerator_connector.py b/pytorch_lightning/trainer/connectors/accelerator_connector.py index c50590905631b..16614c9365a8a 100644 --- a/pytorch_lightning/trainer/connectors/accelerator_connector.py +++ b/pytorch_lightning/trainer/connectors/accelerator_connector.py @@ -856,8 +856,8 @@ 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 + """Returns True if running with `horovodrun` using Gloo.""" + return "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, From 2682187aefe51d9103a09c6bc4999bf750a540f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20W=C3=A4lchli?= Date: Thu, 29 Jul 2021 04:14:44 +0200 Subject: [PATCH 2/3] update check --- pytorch_lightning/trainer/connectors/accelerator_connector.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pytorch_lightning/trainer/connectors/accelerator_connector.py b/pytorch_lightning/trainer/connectors/accelerator_connector.py index 16614c9365a8a..ebcbfa74e6613 100644 --- a/pytorch_lightning/trainer/connectors/accelerator_connector.py +++ b/pytorch_lightning/trainer/connectors/accelerator_connector.py @@ -856,8 +856,8 @@ def check_horovod(self): @staticmethod def has_horovodrun() -> bool: - """Returns True if running with `horovodrun` using Gloo.""" - return "HOROVOD_RANK" in os.environ + """Returns True if running with `horovodrun` using Gloo or OpenMPI.""" + 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, From 335bf507cca2ea03a7a67400b79233fb8d4958da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20W=C3=A4lchli?= Date: Thu, 29 Jul 2021 09:54:13 +0200 Subject: [PATCH 3/3] update changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a33cdd17031bd..4820690e4266a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -71,7 +71,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). ### Fixed -- +- Fixed horovod auto-detection when horovod is not installed and the launcher is `mpirun` ([#8610](https://github.com/PyTorchLightning/pytorch-lightning/pull/8610)) -