diff --git a/paddle/phi/backends/processgroup_comm_utils.cc b/paddle/phi/backends/processgroup_comm_utils.cc index 580aebd17e6d53f61bfce0ce17bb87a254adf4c9..841b88d752e9a3547164d21171f0e7def326707d 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(