Skip to content

Commit f64842c

Browse files
committed
exclude mpi run from auto-detection of horovod (#8610)
1 parent c623757 commit f64842c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pytorch_lightning/trainer/connectors/accelerator_connector.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -857,7 +857,7 @@ def check_horovod(self):
857857
@staticmethod
858858
def has_horovodrun() -> bool:
859859
"""Returns True if running with `horovodrun` using Gloo or OpenMPI."""
860-
return "OMPI_COMM_WORLD_RANK" in os.environ or "HOROVOD_RANK" in os.environ
860+
return _HOROVOD_AVAILABLE and ("OMPI_COMM_WORLD_RANK" in os.environ or "HOROVOD_RANK" in os.environ)
861861

862862
def update_device_type_if_ipu_plugin(self) -> None:
863863
# This allows the poptorch.Options that are passed into the IPUPlugin to be the source of truth,

0 commit comments

Comments
 (0)