提交 c60f312d 编写于 作者: Q Qiao Longfei

add trick

上级 103c9bb3
...@@ -57,6 +57,8 @@ class ConcurrentSet { ...@@ -57,6 +57,8 @@ class ConcurrentSet {
std::future<void> GetAndClear(std::vector<int64_t>* result) { std::future<void> GetAndClear(std::vector<int64_t>* result) {
auto task = [this, &result] { auto task = [this, &result] {
result->clear(); result->clear();
// FIXME(qiao): use a trick to avoid the bug of recv an selected rows
result->push_back(0);
for (auto& id : set_) { for (auto& id : set_) {
result->push_back(id); result->push_back(id);
} }
......
...@@ -108,7 +108,9 @@ void ParameterRecv<T>::operator()(const RpcContext &rpc_ctx, ...@@ -108,7 +108,9 @@ void ParameterRecv<T>::operator()(const RpcContext &rpc_ctx,
VLOG(3) << "recv_slr size: " << recv_slr.rows().size() << " " VLOG(3) << "recv_slr size: " << recv_slr.rows().size() << " "
<< sstream.str(); << sstream.str();
} }
for (auto i = 0; i < recv_slr.rows().size(); ++i) {
// FIXME(qiao): use a trick to avoid the bug of recv an selected rows
for (auto i = 1; i < recv_slr.rows().size(); ++i) {
auto row_id = recv_slr.rows()[i] + row_offset; auto row_id = recv_slr.rows()[i] + row_offset;
PADDLE_ENFORCE_LT(row_id, recv_dims[1]); PADDLE_ENFORCE_LT(row_id, recv_dims[1]);
memcpy(recv_tensor->data<T>() + row_id * width, memcpy(recv_tensor->data<T>() + row_id * width,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册