From 97004f674849492083e376b53e8006f08ba6cdf9 Mon Sep 17 00:00:00 2001 From: ronnywang Date: Tue, 8 Nov 2022 14:45:48 +0800 Subject: [PATCH] [CustomDevice] fix undefined symbol GetCCLComm in the cpu version (#47717) --- paddle/fluid/pybind/CMakeLists.txt | 1 + paddle/fluid/pybind/distributed_py.cc | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/paddle/fluid/pybind/CMakeLists.txt b/paddle/fluid/pybind/CMakeLists.txt index a4d35f52a4..3b9b0a9ca6 100755 --- a/paddle/fluid/pybind/CMakeLists.txt +++ b/paddle/fluid/pybind/CMakeLists.txt @@ -183,6 +183,7 @@ if(WITH_PYTHON) endif() set(PYBIND_SRCS ${PYBIND_SRCS} distributed_py.cc) endif() +set(PYBIND_DEPS ${PYBIND_DEPS} processgroup_comm_utils) if(WITH_ASCEND) set(PYBIND_DEPS ${PYBIND_DEPS} ascend_wrapper) diff --git a/paddle/fluid/pybind/distributed_py.cc b/paddle/fluid/pybind/distributed_py.cc index a4b53922a8..2b9d8d1631 100644 --- a/paddle/fluid/pybind/distributed_py.cc +++ b/paddle/fluid/pybind/distributed_py.cc @@ -59,6 +59,8 @@ limitations under the License. */ #include "paddle/fluid/distributed/store/tcp_store.h" #endif +#include "paddle/phi/kernels/sync_batch_norm_kernel.h" + namespace py = pybind11; namespace paddle { @@ -90,6 +92,9 @@ using GlooOptions = paddle::distributed::ProcessGroupGloo::GlooOptions; static std::string GLOO_SOCKET_IFNAME_ENV = "GLOO_SOCKET_IFNAME"; // NOLINT +static UNUSED void *use_ccl_comm_func = + phi::detail::GetCCLComm(phi::CPUPlace()); + void BindDistributed(py::module *m) { py::enum_(*m, "ReduceOp") .value("SUM", distributed::ReduceOp::SUM) -- GitLab