Skip to content

Commit 97004f6

Browse files
authored
[CustomDevice] fix undefined symbol GetCCLComm in the cpu version (#47717)
1 parent 14c9570 commit 97004f6

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

paddle/fluid/pybind/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ if(WITH_PYTHON)
183183
endif()
184184
set(PYBIND_SRCS ${PYBIND_SRCS} distributed_py.cc)
185185
endif()
186+
set(PYBIND_DEPS ${PYBIND_DEPS} processgroup_comm_utils)
186187

187188
if(WITH_ASCEND)
188189
set(PYBIND_DEPS ${PYBIND_DEPS} ascend_wrapper)

paddle/fluid/pybind/distributed_py.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ limitations under the License. */
5959
#include "paddle/fluid/distributed/store/tcp_store.h"
6060
#endif
6161

62+
#include "paddle/phi/kernels/sync_batch_norm_kernel.h"
63+
6264
namespace py = pybind11;
6365

6466
namespace paddle {
@@ -90,6 +92,9 @@ using GlooOptions = paddle::distributed::ProcessGroupGloo::GlooOptions;
9092

9193
static std::string GLOO_SOCKET_IFNAME_ENV = "GLOO_SOCKET_IFNAME"; // NOLINT
9294

95+
static UNUSED void *use_ccl_comm_func =
96+
phi::detail::GetCCLComm(phi::CPUPlace());
97+
9398
void BindDistributed(py::module *m) {
9499
py::enum_<distributed::ReduceOp>(*m, "ReduceOp")
95100
.value("SUM", distributed::ReduceOp::SUM)

0 commit comments

Comments
 (0)