Python horovod.tensorflow.broadcast_global_variables() Examples

The following are 3 code examples of horovod.tensorflow.broadcast_global_variables(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module horovod.tensorflow , or try the search function .
Example #1
Source File: multi_gpu_wrapper.py    From tf-hrnet with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def broadcast_global_variables(cls, *args):
    """Get a TensorFlow operation to broadcast all the global variables."""

    try:
      return mgw.broadcast_global_variables(*args)
    except NameError:
      raise NameError('module <mgw> not imported') 
Example #2
Source File: __init__.py    From training_results_v0.6 with Apache License 2.0 5 votes vote down vote up
def broadcast_global_variables(root_rank):
    """Broadcasts all global variables from root rank to all other processes.

    Arguments:
        root_rank: Rank of the process from which global variables will be broadcasted
                   to all other processes.
    """
    bcast_op = hvd.broadcast_global_variables(root_rank)
    return K.get_session().run(bcast_op) 
Example #3
Source File: callbacks.py    From training_results_v0.6 with Apache License 2.0 5 votes vote down vote up
def on_train_begin(self, logs=None):
        with tf.device(self.device):
            bcast_op = hvd.broadcast_global_variables(self.root_rank)
            K.get_session().run(bcast_op)