diff --git a/_modules/mala/common/parameters.html b/_modules/mala/common/parameters.html index 9840e33ef..d2bc02de1 100644 --- a/_modules/mala/common/parameters.html +++ b/_modules/mala/common/parameters.html @@ -82,8 +82,10 @@
import pickle
from time import sleep
+horovod_available = False
try:
import horovod.torch as hvd
+ horovod_available = True
except ModuleNotFoundError:
pass
import numpy as np
@@ -1333,19 +1335,25 @@ Source code for mala.common.parameters
@use_horovod.setter
def use_horovod(self, value):
- if value:
- hvd.init()
+ if value is False:
+ self._use_horovod = False
+ else:
+ if horovod_available:
+ hvd.init()
+ # Invalidate, will be updated in setter.
+ set_horovod_status(value)
+ self.device = None
+ self._use_horovod = value
+ self.network._update_horovod(self.use_horovod)
+ self.descriptors._update_horovod(self.use_horovod)
+ self.targets._update_horovod(self.use_horovod)
+ self.data._update_horovod(self.use_horovod)
+ self.running._update_horovod(self.use_horovod)
+ self.hyperparameters._update_horovod(self.use_horovod)
+ else:
+ parallel_warn("Horovod requested, but not installed found. "
+ "MALA will operate without horovod only.")
- # Invalidate, will be updated in setter.
- set_horovod_status(value)
- self.device = None
- self._use_horovod = value
- self.network._update_horovod(self.use_horovod)
- self.descriptors._update_horovod(self.use_horovod)
- self.targets._update_horovod(self.use_horovod)
- self.data._update_horovod(self.use_horovod)
- self.running._update_horovod(self.use_horovod)
- self.hyperparameters._update_horovod(self.use_horovod)
@property
def device(self):
diff --git a/objects.inv b/objects.inv
index a64171b95..f61fcd82d 100644
Binary files a/objects.inv and b/objects.inv differ