提交 d2cb3790 编写于 作者: Y Yu Yang

Wait all evernts

上级 4137bb4e
......@@ -420,11 +420,11 @@ struct NCCLAllReduceOpHandle : public OpHandle {
}
} else {
if (events_.size() > 1) {
int dev_id =
boost::get<platform::CUDAPlace>(waited_dev->GetPlace()).device;
auto stream =
static_cast<platform::CUDADeviceContext *>(waited_dev)->stream();
PADDLE_ENFORCE(cudaStreamWaitEvent(stream, events_[dev_id], 0));
for (auto &ev : events_) {
PADDLE_ENFORCE(cudaStreamWaitEvent(stream, ev.second, 0));
}
}
}
}
......
......@@ -47,7 +47,7 @@ class ParallelExecutor(unittest.TestCase):
dtypes=['float32', 'int64'])
img, label = fluid.layers.read_file(reader)
hidden = img
for _ in xrange(2):
for _ in xrange(4):
hidden = fluid.layers.fc(
hidden,
size=200,
......@@ -60,7 +60,7 @@ class ParallelExecutor(unittest.TestCase):
adam = fluid.optimizer.Adam()
adam.minimize(loss)
act_places = []
for each in [fluid.CUDAPlace(0), fluid.CUDAPlace(1)]:
for each in [fluid.CUDAPlace(0)]:
p = fluid.core.Place()
p.set_place(each)
act_places.append(p)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册