diff --git a/paddle/fluid/distributed/collective/reducer.cc b/paddle/fluid/distributed/collective/reducer.cc index fae276090c13e7c8f09691844c9b6fad0c745570..21041e24042d3140d26adde477b5ee9694478401 100644 --- a/paddle/fluid/distributed/collective/reducer.cc +++ b/paddle/fluid/distributed/collective/reducer.cc @@ -1097,6 +1097,15 @@ void EagerReducer::AllReduceSparse(EagerGroup *group, PADDLE_THROW(platform::errors::PermissionDenied( "Paddle can't concat grad tensors since it's not compiled with NCCL," "Please recompile or reinstall Paddle with NCCL support.")); +#endif + } else if (platform::is_xpu_place(inner_place_)) { +#ifdef PADDLE_WITH_XPU_BKCL + dev_ctx = static_cast( + platform::DeviceContextPool::Instance().Get(inner_place_)); +#else + PADDLE_THROW(platform::errors::PermissionDenied( + "Paddle can't concat grad tensors since it's not compiled with XCCL," + "Please recompile or reinstall Paddle with XCCL support.")); #endif } else if (platform::is_custom_place(inner_place_)) { #ifdef PADDLE_WITH_CUSTOM_DEVICE