From 0e722c5ea287c59c0b7b3b296a664764ddbc2ad1 Mon Sep 17 00:00:00 2001 From: tangwei12 Date: Thu, 18 Oct 2018 17:13:56 +0800 Subject: [PATCH] fix lookuptable in reduce strategy --- paddle/fluid/framework/details/multi_devices_graph_pass.cc | 3 ++- paddle/fluid/framework/ir/graph.cc | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/paddle/fluid/framework/details/multi_devices_graph_pass.cc b/paddle/fluid/framework/details/multi_devices_graph_pass.cc index 134fcee82..4f481db06 100644 --- a/paddle/fluid/framework/details/multi_devices_graph_pass.cc +++ b/paddle/fluid/framework/details/multi_devices_graph_pass.cc @@ -680,7 +680,8 @@ int MultiDevSSAGraphBuilder::CreateDistTrainOp(ir::Graph *result, } if (node->Op()->Type() == "split_byref" || - node->Op()->Type() == "split_selected_rows") { + node->Op()->Type() == "split_selected_rows" || + node->Op()->Type() == "split_ids") { // TODO(paddle-dev): getting the first var is not safe. op_dev_id = GetVarDeviceID(*result, input_var_names[0]); if (strategy_.reduce_ == BuildStrategy::ReduceStrategy::kAllReduce) { diff --git a/paddle/fluid/framework/ir/graph.cc b/paddle/fluid/framework/ir/graph.cc index 398f70959..87fc5e689 100644 --- a/paddle/fluid/framework/ir/graph.cc +++ b/paddle/fluid/framework/ir/graph.cc @@ -69,6 +69,12 @@ bool IsDistTrainOp(ir::Node *node, const std::vector &send_vars, std::find(rpc_vars.begin(), rpc_vars.end(), var) != rpc_vars.end()) { return true; } + + if (!(var.find(".block") == std::string::npos && + var.find(".pserver") != std::string::npos) && + std::find(rpc_vars.begin(), rpc_vars.end(), var) != rpc_vars.end()) { + return true; + } } return false; }; -- GitLab