diff --git a/paddle/fluid/operators/distributed/communicator.cc b/paddle/fluid/operators/distributed/communicator.cc index 993bf6c988e8e7d402e49bf961ff939df9b62fad..a0ac82a6f4a432ee0f0427a90508c88a262799e3 100644 --- a/paddle/fluid/operators/distributed/communicator.cc +++ b/paddle/fluid/operators/distributed/communicator.cc @@ -449,7 +449,7 @@ void GeoCommunicator::InitImpl(const RpcCtxMap &send_varname_to_ctx, old_scope_.reset(new Scope()); pserver_scope_.reset(new Scope()); - Init(); + InitParams(); } void GeoCommunicator::Send(const std::vector &var_names, @@ -822,7 +822,7 @@ void GeoCommunicator::InitSparse() { paddle::platform::CPUDeviceContext()); for (auto &id : ids) { - blas.VCOPY(dim1, global_value.data() + k * width, + blas.VCOPY(dim1, global_value.data() + id * dim1, values[id][0]->data()); } } diff --git a/paddle/fluid/operators/distributed/parameter_recv.cc b/paddle/fluid/operators/distributed/parameter_recv.cc index fa68562b08c35cc4d9b808d9e5b2d26c10b3c59f..3b8479c91b0b619430ebde26b26f0ae6c9fc59cb 100644 --- a/paddle/fluid/operators/distributed/parameter_recv.cc +++ b/paddle/fluid/operators/distributed/parameter_recv.cc @@ -60,7 +60,7 @@ void RecvSparseLodTensor(const CommContext &rpc_ctx, // sparse param in recv_scope is LoDTensor rets.push_back(rpc_client->AsyncGetVarNoBarrier( rpc_ctx.epmap[i], cpu_ctx, *local_scope.get(), recv_var_name, - recv_var_name, recv_var_name)); + recv_var_name)); const auto *value = local_var->Get().data(); tensors.push_back(value); @@ -88,7 +88,7 @@ void RecvSparseLodTensor(const CommContext &rpc_ctx, "recved var must has same dims with local var"); auto *merged_t = merged_var->GetMutable(); - auto *merged_d = merged_t->mutable_data(place)(); + auto *merged_d = merged_t->mutable_data(cpu_place); auto pserver_num = rpc_ctx.splited_varnames.size(); for (int x = 0; x < height; ++x) { @@ -220,9 +220,9 @@ void ParameterRecv::operator()(const CommContext &rpc_ctx, if (rpc_ctx.is_sparse) { if (geo_records) { - RecvGeoSparseRecords()(rpc_ctx, scope); + RecvGeoSparseRecords(rpc_ctx, scope); } else { - RecvSparseLodTensor()(rpc_ctx, scope); + RecvSparseLodTensor(rpc_ctx, scope); } } else { RecvLodTensor(rpc_ctx, scope);