Async execution causes errors in distributed computation.
bind_exec() method in python/module/executor_group.py may cause libzmq communication errors in distributed computation since output arrays of executors are tried to be read before they are filled completely. To my findings, the related code part may be fixed as below.
if self.for_training:
self.grad_arrays = [[exec_.grad_arrays[i] for exec_ in self.execs]
for i, name in enumerate(self.arg_names)
if exec_.grad_arrays[i].wait_to_read() or name in self.param_names]
else:
self.grad_arrays = None
data_names = [x[0] for x in data_shapes]
if self.inputs_need_grad:
self.input_grad_arrays = [[exec_.grad_arrays[i] for exec_ in self.execs]
for i, name in enumerate(self.arg_names)
if exec_.grad_arrays[i].wait_to_read() or name in data_names]
Not sure anymore :) Depending on -n parameter of launch.py, different errors are raised. Examining.
I'm much more sure now :) The second sentence in my previous comment was due to MxNet version conflict. Please forget it. However, my first comment seems true but my solution is syntactically incorrect, semantically correct :) The correct solution, to me of course, is as below:
if self.for_training:
self.grad_arrays = [[exec_.grad_arrays[i] for exec_ in self.execs if exec_.grad_arrays[i].wait_to_read() or True]
for i, name in enumerate(self.arg_names)
if name in self.param_names]
else:
self.grad_arrays = None
data_names = [x[0] for x in data_shapes]
if self.inputs_need_grad:
self.input_grad_arrays = [[exec_.grad_arrays[i] for exec_ in self.execs if exec_.grad_arrays[i].wait_to_read() or True]
for i, name in enumerate(self.arg_names)
if name in data_names]
This issue is closed due to lack of activity in the last 90 days. Feel free to reopen if this is still an active issue. Thanks!