From 48982e9dc7397ca182b1a145b2c7d77acf8afd8f Mon Sep 17 00:00:00 2001 From: tangwei12 Date: Thu, 18 Oct 2018 21:25:47 +0800 Subject: [PATCH] fix lookuptable in reduce strategy --- paddle/fluid/framework/ir/graph.cc | 2 +- python/paddle/fluid/transpiler/distribute_transpiler.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/paddle/fluid/framework/ir/graph.cc b/paddle/fluid/framework/ir/graph.cc index 87fc5e689..cb22403de 100644 --- a/paddle/fluid/framework/ir/graph.cc +++ b/paddle/fluid/framework/ir/graph.cc @@ -71,7 +71,7 @@ bool IsDistTrainOp(ir::Node *node, const std::vector &send_vars, } if (!(var.find(".block") == std::string::npos && - var.find(".pserver") != std::string::npos) && + var.find(".pserver") == std::string::npos) && std::find(rpc_vars.begin(), rpc_vars.end(), var) != rpc_vars.end()) { return true; } diff --git a/python/paddle/fluid/transpiler/distribute_transpiler.py b/python/paddle/fluid/transpiler/distribute_transpiler.py index 2192139f8..83fc36e08 100644 --- a/python/paddle/fluid/transpiler/distribute_transpiler.py +++ b/python/paddle/fluid/transpiler/distribute_transpiler.py @@ -1133,7 +1133,8 @@ to transpile() call.") inputs={ 'Ids': [program.global_block().vars[table_grad_name]] }, - outputs={"Out": self.trainer_side_table_grad_list}) + outputs={"Out": self.trainer_side_table_grad_list}, + attrs={RPC_OP_ROLE_ATTR_NAME: DIST_OP_ROLE_ATTR_VALUE}) program.global_block()._insert_op( index=op_index + 2, type="send", -- GitLab