Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose name argument to TF allreduce operation. #2325

Merged
merged 1 commit into from Sep 24, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions horovod/tensorflow/__init__.py
Expand Up @@ -52,7 +52,8 @@

def allreduce(tensor, average=None, device_dense='', device_sparse='',
compression=Compression.none, op=None,
prescale_factor=1.0, postscale_factor=1.0):
prescale_factor=1.0, postscale_factor=1.0,
name=None):
"""Perform an allreduce on a tf.Tensor or tf.IndexedSlices.

This function performs a bandwidth-optimal ring allreduce on the input
Expand All @@ -79,6 +80,7 @@ def allreduce(tensor, average=None, device_dense='', device_sparse='',
Defaults to Average if None is given.
prescale_factor: Multiplicative factor to scale tensor before allreduce.
postscale_factor: Multiplicative factor to scale tensor after allreduce.
name: A name of the allreduce operation

Returns:
A tensor of the same shape and type as `tensor`, summed across all
Expand Down Expand Up @@ -116,7 +118,8 @@ def allreduce(tensor, average=None, device_dense='', device_sparse='',
tensor_compressed, ctx = compression.compress(tensor)
summed_tensor_compressed = _allreduce(tensor_compressed, op=op,
prescale_factor=prescale_factor,
postscale_factor=postscale_factor)
postscale_factor=postscale_factor,
name=name)
summed_tensor = compression.decompress(summed_tensor_compressed, ctx)
if op == Adasum:
if 'CPU' not in tensor.device and gpu_available('tensorflow'):
Expand Down