Need Replica ID in device name for distributed training
Got the following error during distributed training with benchmark_cnn.py. This happens only when set datasets_use_prefetch to True.
2018-04-12 16:41:01.490527: W tensorflow/core/distributed_runtime/rpc/grpc_channel.cc:237] Replica ID must be 0 in target: /job:worker/task:0/device:CPU:0 2018-04-12 16:41:01.490640: W tensorflow/core/framework/op_kernel.cc:1273] OP_REQUIRES failed at prefetching_kernels.cc:304 : Invalid argument: Could not find worker with targe t: /job:worker/task:0/device:CPU:0 Available workers: /job:ps/replica:0/task:0, /job:worker/replica:0/task:0, /job:worker/replica:0/task:1 2018-04-12 16:41:01.490721: F tensorflow/contrib/verbs/rdma.cc:1009] Check failed: status.ok() RecvLocalAsync was not ok. error message: Could not find worker with target: /job :worker/task:0/device:CPU:0 Available workers: /job:ps/replica:0/task:0, /job:worker/replica:0/task:0, /job:worker/replica:0/task:1 [[Node: FunctionBufferingResource = FunctionBufferingResource[buffer_size=1, container="", f=_fn_243b81cc[], shared_name="", thread_pool_size=1, _device="/job:worker/r eplica:0/task:0/device:GPU:0"](batch_processing/IteratorToStringHandle_G15, FunctionBufferingResource/target_device_G17)]] 2018-04-12 16:41:01.490747: F tensorflow/contrib/verbs/rdma.cc:1009] Check failed: status.ok() RecvLocalAsync was not ok. error message: Could not find worker with target: /job :worker/task:0/device:CPU:0 Available workers: /job:ps/replica:0/task:0, /job:worker/replica:0/task:0, /job:worker/replica:0/task:1 [[Node: FunctionBufferingResource = FunctionBufferingResource[buffer_size=1, container="", f=_fn_243b81cc[], shared_name="", thread_pool_size=1, _device="/job:worker/r eplica:0/task:0/device:GPU:0"](batch_processing/IteratorToStringHandle_G15, FunctionBufferingResource/target_device_G17)]]
It gives the same error with or without RDMA.
I have this error fixed by adding "/replica:0" before "/task" in a couple of proper places. Hope this can be addressed in future updates. Thanks.
@rohan100jain can you take a look?
To reproduce easily, you can add the following method to benchmark_cnn_distributed_test.py, right below method testReplicated:
def testReplicatedRealData(self):
test_name = 'testReplicatedRealData'
imagenet_dir = os.path.join(platforms_util.get_test_data_dir(),
'fake_tf_record_data')
params = test_util.get_params(test_name)._replace(
variable_update='distributed_replicated', data_dir=imagenet_dir,
data_name='imagenet')
self._test_distributed(test_name, 2, 2, params)
When fixing this, this test method can be included in the fix.
same error as @snuzxj , look for fixed, thanks
I got the same error too. Cuased by tensorflow 1.7+ ?
Got the same error, Tensorflow 1.9.
@snuzxj What did you do to workaround this issue?
I did a manual fix by adding "/replica:0"
And what arguments did you set when running the script?
Hi, In the benchmarks/scripts/tf_cnn_benchmarks/benchmark_cnn.py
fix manual lines 1099, 1107 and 1111 to:
worker_prefix = '/job:worker/replica:0/task:%s' % self.task_index
'/job:ps/replica:0/task:%s/cpu:0' % i
self.sync_queue_devices = ['/job:worker/replica:0/task:0/cpu:0']
@boriskovalev It works for me. Thanks
Please check with multi nodes and GPUs with grpc.