From 412d15c119c8c2979b08d6ff278b839a18d066ed Mon Sep 17 00:00:00 2001 From: Ting Zhou Date: Fri, 8 Jul 2022 22:30:59 +0000 Subject: [PATCH] fix horovod.torch import error --- smdebug/core/utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/smdebug/core/utils.py b/smdebug/core/utils.py index 0557072b4..429b12e9b 100644 --- a/smdebug/core/utils.py +++ b/smdebug/core/utils.py @@ -67,6 +67,8 @@ class FRAMEWORK(Enum): try: import horovod.torch as hvd + if not hvd._MPI_LIB_AVAILABLE: + raise ImportError("MPI lib is missing. Reinstall Horovod with HOROVOD_WITH_PYTORCH=1 to debug the build error.") # This redundant import is necessary because horovod does not raise an ImportError if the library is not present import torch # noqa