Fix a multi-gpu test failure.
The test uses tf.constant as input to all_reduce in pure eager mode, however in eager mode tf.constant always creates host tensors regardless of the enclosing device scope. This leads to NCCL error. PiperOrigin-RevId: 357252841 Change-Id: Iddaf5f52fe6634ec29dd385a9fa034761f3df91f
This commit is contained in:
parent
8e4ba814c2
commit
aa9bd19fe3
@ -131,7 +131,7 @@ class ReplicaCtxAllReduceTest(test.TestCase, parameterized.TestCase):
|
||||
def fn():
|
||||
|
||||
def replica_fn():
|
||||
value = constant_op.constant(1.0)
|
||||
value = array_ops.identity(1.0)
|
||||
reduced = strategy.extended._replica_ctx_all_reduce('SUM', value)
|
||||
return reduced
|
||||
|
||||
@ -152,7 +152,7 @@ class ReplicaCtxAllReduceTest(test.TestCase, parameterized.TestCase):
|
||||
def fn():
|
||||
|
||||
def replica_fn():
|
||||
value = (constant_op.constant(1.0), constant_op.constant(2.0))
|
||||
value = (array_ops.identity(1.0), array_ops.identity(1.0))
|
||||
reduced = strategy.extended._replica_ctx_all_reduce('SUM', value)
|
||||
return reduced
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user