Skip to content

Commit 299ef38

Browse files
authored
Check whether to register hooks according to HOROVOD_ELASTIC (#2487)
* Check whether to register hooks according to HOROVOD_ELASTIC * Register hooks
1 parent 65a2ec0 commit 299ef38

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

elasticai_api/pytorch/optimizer.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,7 @@ def __init__(
9292
self._requires_update = set()
9393
self._synchronized = False
9494
self._should_synchronize = True
95-
if size() > 1 or os.environ.get("HOROVOD_ELASTIC") == "1":
96-
self._register_hooks()
95+
self._register_hooks()
9796

9897
self.fixed_global_batch_size = fixed_global_batch_size
9998
self._global_batch_num_per_step = global_batch_num_per_step

0 commit comments

Comments
 (0)