From 63acbe7a6565da0eb848d5b8b28a7f7f299466a3 Mon Sep 17 00:00:00 2001 From: Qiao Longfei Date: Mon, 25 Mar 2019 19:12:32 +0800 Subject: [PATCH] fix bug --- .../distributed/async_sparse_param_update_recorder.h | 5 +---- paddle/fluid/operators/distributed/parameter_recv.cc | 3 +-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/paddle/fluid/operators/distributed/async_sparse_param_update_recorder.h b/paddle/fluid/operators/distributed/async_sparse_param_update_recorder.h index 0b9351a676..eadd842c7f 100644 --- a/paddle/fluid/operators/distributed/async_sparse_param_update_recorder.h +++ b/paddle/fluid/operators/distributed/async_sparse_param_update_recorder.h @@ -57,8 +57,6 @@ class ConcurrentSet { std::future GetAndClear(std::vector* result) { auto task = [this, &result] { result->clear(); - // FIXME(qiao): use a trick to avoid the bug of recv an selected rows - result->push_back(0); for (auto& id : set_) { result->push_back(id); } @@ -125,8 +123,7 @@ class AsyncSparseParamUpdateRecorder { fs.push_back(set->Update(update_rows)); } for (auto& f : fs) { - // no need to wait here because GetAndClear will wait. - // f.wait(); + f.wait(); } } diff --git a/paddle/fluid/operators/distributed/parameter_recv.cc b/paddle/fluid/operators/distributed/parameter_recv.cc index e9d34b1739..a387ee5ee1 100644 --- a/paddle/fluid/operators/distributed/parameter_recv.cc +++ b/paddle/fluid/operators/distributed/parameter_recv.cc @@ -109,8 +109,7 @@ void ParameterRecv::operator()(const RpcContext &rpc_ctx, << sstream.str(); } - // FIXME(qiao): use a trick to avoid the bug of recv an selected rows - for (auto i = 1; i < recv_slr.rows().size(); ++i) { + for (auto i = 0; i < recv_slr.rows().size(); ++i) { auto row_id = recv_slr.rows()[i] + row_offset; PADDLE_ENFORCE_LT(row_id, recv_dims[0]); memcpy(recv_tensor->data() + row_id * width, -- GitLab