From 95e494e041d2bf7d1451a44da9ff4ea63f0e0c82 Mon Sep 17 00:00:00 2001 From: ronnywang Date: Fri, 11 Nov 2022 13:15:11 +0800 Subject: [PATCH] fix cpu build failed (#47833) * fix cpu build failed * update --- paddle/phi/backends/processgroup_comm_utils.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/paddle/phi/backends/processgroup_comm_utils.cc b/paddle/phi/backends/processgroup_comm_utils.cc index 580aebd17e..841b88d752 100644 --- a/paddle/phi/backends/processgroup_comm_utils.cc +++ b/paddle/phi/backends/processgroup_comm_utils.cc @@ -33,6 +33,8 @@ namespace detail { // In principle, the PHI Kernel cannot use the global singleton internally, // and the required members need to be passed in from the eucalyptus tree. ccl::CCLComm GetCCLComm(const Place& place, int global_gid) { +#if defined(PADDLE_WITH_NCCL) || defined(PADDLE_WITH_RCCL) || \ + defined(PADDLE_WITH_CUSTOM_DEVICE) paddle::distributed::ProcessGroup* pg = nullptr; if (paddle::distributed::ProcessGroupMapFromGid::getInstance()->has( global_gid)) { @@ -41,7 +43,7 @@ ccl::CCLComm GetCCLComm(const Place& place, int global_gid) { } else { return nullptr; } - +#endif if (paddle::platform::is_gpu_place(place)) { #if defined(PADDLE_WITH_NCCL) || defined(PADDLE_WITH_RCCL) return static_cast(pg)->NCCLComm( -- GitLab