File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -64,24 +64,29 @@ class FRAMEWORK(Enum):
6464except (ImportError , ModuleNotFoundError ):
6565 _torch_dist_imported = None
6666
67-
67+ logger = get_logger ()
6868try :
6969 import horovod .torch as hvd
7070
7171 # This redundant import is necessary because horovod does not raise an ImportError if the library is not present
7272 import torch # noqa
73+ #make sure the library is correctly imported
74+ hvd .init ()
7375
7476 _hvd_imported = hvd
77+ except AttributeError :
78+ _hvd_imported = None
79+ logger .error ("horovod.torch is not correctly imported." )
80+ raise
7581except (ModuleNotFoundError , ImportError ):
7682 try :
7783 import horovod .tensorflow as hvd
7884
7985 _hvd_imported = hvd
8086 except (ModuleNotFoundError , ImportError ):
8187 _hvd_imported = None
88+ raise
8289
83-
84- logger = get_logger ()
8590error_handling_agent = (
8691 ErrorHandlingAgent .get_error_handling_agent ()
8792) # set up error handler to wrap smdebug functions
You can’t perform that action at this time.
0 commit comments