From 33be014535609d3e4d58a36bf5243390cd8cc265 Mon Sep 17 00:00:00 2001 From: Qiao Longfei Date: Wed, 27 Mar 2019 17:12:58 +0800 Subject: [PATCH] fix distribute compile problem test=develop --- paddle/fluid/framework/details/CMakeLists.txt | 6 +++++- paddle/fluid/framework/details/async_ssa_graph_executor.cc | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/paddle/fluid/framework/details/CMakeLists.txt b/paddle/fluid/framework/details/CMakeLists.txt index a3a10eade88..9c4634bcbc9 100644 --- a/paddle/fluid/framework/details/CMakeLists.txt +++ b/paddle/fluid/framework/details/CMakeLists.txt @@ -89,7 +89,11 @@ cc_library(threaded_ssa_graph_executor SRCS threaded_ssa_graph_executor.cc DEPS cc_library(parallel_ssa_graph_executor SRCS parallel_ssa_graph_executor.cc DEPS threaded_ssa_graph_executor) -cc_library(async_ssa_graph_executor SRCS async_ssa_graph_executor.cc DEPS threaded_ssa_graph_executor communicator) +set(ASYNC_SSA_GRAPH_EXECUTOR_DEPS threaded_ssa_graph_executor) +if(WITH_DISTRIBUTE) + list(APPEND ASYNC_SSA_GRAPH_EXECUTOR_DEPS communicator) +endif() +cc_library(async_ssa_graph_executor SRCS async_ssa_graph_executor.cc DEPS ${ASYNC_SSA_GRAPH_EXECUTOR_DEPS}) cc_test(broadcast_op_test SRCS broadcast_op_handle_test.cc DEPS var_handle op_handle_base scope ddim memory device_context broadcast_op_handle) diff --git a/paddle/fluid/framework/details/async_ssa_graph_executor.cc b/paddle/fluid/framework/details/async_ssa_graph_executor.cc index 5ca676ccdeb..e9aad5d264d 100644 --- a/paddle/fluid/framework/details/async_ssa_graph_executor.cc +++ b/paddle/fluid/framework/details/async_ssa_graph_executor.cc @@ -15,7 +15,10 @@ #include "paddle/fluid/framework/details/async_ssa_graph_executor.h" #include "paddle/fluid/framework/variable_helper.h" + +#ifdef PADDLE_WITH_DISTRIBUTE #include "paddle/fluid/operators/distributed/communicator.h" +#endif namespace paddle { namespace framework { @@ -43,6 +46,7 @@ inline void NewTempScopeAndInitVars(const std::vector &var_infos, // get RpcContext and remote send and recv op void ProcessGraph(std::vector graphs, Scope *scope) { +#ifdef PADDLE_WITH_DISTRIBUTE using RpcCtxMap = operators::distributed::RpcCtxMap; VLOG(3) << "ProcessGraph"; RpcCtxMap send_varname_to_ctx; @@ -88,6 +92,7 @@ void ProcessGraph(std::vector graphs, Scope *scope) { recv_varname_to_ctx, scope); operators::distributed::Communicator::GetInstance()->Start(); } +#endif } AsyncSSAGraphExecutor::AsyncSSAGraphExecutor( -- GitLab