Wait all inputs ready

helinwang-patch-1
Yu Yang 7 years ago
parent 9b1f4d5d62
commit 631aa3d10a

@ -375,6 +375,12 @@ struct NCCLAllReduceOpHandle : public OpHandle {
if (this->inputs_.size() == 1) {
return; // No need to all reduce when GPU count = 1;
} else {
// Wait input done
for (auto *in : inputs_) {
auto &p = static_cast<VarHandle *>(in)->place_;
in->generated_op_->Wait(dev_ctx_[p]);
}
auto &var_name = static_cast<VarHandle *>(this->inputs_[0])->name_;
VLOG(3) << "Invoke NCCL AllReduce";
int dtype = -1;

Loading…
Cancel
Save