From 8f36c39537e9a2648decb57ce3bf240355577b54 Mon Sep 17 00:00:00 2001 From: Chengmo Date: Tue, 21 Jan 2020 17:25:53 +0800 Subject: [PATCH] Fix GEO-SGD init & send Bug (#22375) * test=develop, fix geo Send & Init --- paddle/fluid/operators/distributed/communicator.cc | 1 + python/paddle/fluid/communicator.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/paddle/fluid/operators/distributed/communicator.cc b/paddle/fluid/operators/distributed/communicator.cc index ff9909edd7d..9b14e5ca685 100644 --- a/paddle/fluid/operators/distributed/communicator.cc +++ b/paddle/fluid/operators/distributed/communicator.cc @@ -433,6 +433,7 @@ void GeoSgdCommunicator::Send(const std::vector &sparse_var_names, } GeoSgdDenseParamInit(training_scope_, old_scope_.get(), local_var_name); } + return; } std::shared_ptr ids_table = std::make_shared(); diff --git a/python/paddle/fluid/communicator.py b/python/paddle/fluid/communicator.py index 58596a926ff..f43e6467e5a 100644 --- a/python/paddle/fluid/communicator.py +++ b/python/paddle/fluid/communicator.py @@ -61,7 +61,7 @@ class Communicator(object): varnames = "&".join(vs["var_names"]) sections = "&".join([str(v) for v in vs["sections"]]) endpoints = "&".join(vs["epmap"]) - is_sparse = "1" if vs["is_sparse"] else "0" + is_sparse = "1" if vs["is_sparse"] == ['True'] else "0" push_var_names.append(k) envs[k] = "#".join([varnames, sections, endpoints, is_sparse]) -- GitLab