Skip to content
This repository has been archived by the owner on Aug 3, 2021. It is now read-only.

Commit

Permalink
Support for Horovod 0.14
Browse files Browse the repository at this point in the history
  • Loading branch information
vsl9 committed Sep 24, 2018
1 parent 4210eab commit 177d7b5
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions open_seq2seq/optimizers/optimizers.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ def get_regularization_loss(scope=None, name="total_regularization_loss"):

def reduce_gradients(grads_and_vars, on_horovod):
if on_horovod:
from horovod.common import size
from horovod.tensorflow import allreduce
from horovod.tensorflow import allreduce, size

if size() > 1:
averaged_grads_and_vars = []
Expand Down Expand Up @@ -461,4 +460,4 @@ def _clip_by_global_norm(t_list, clip_norm, use_norm, name=None):
for (c_v, t) in zip(values_clipped, t_list)]

return list_clipped, use_norm


0 comments on commit 177d7b5

Please sign in to comment.