From c558dc30405da0d07fc3bd27d973939607f8afe0 Mon Sep 17 00:00:00 2001 From: jameszhang Date: Tue, 30 May 2023 10:19:24 +0800 Subject: [PATCH] [kunlun] support allreduce sparse (#54172) --- paddle/fluid/distributed/collective/reducer.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/paddle/fluid/distributed/collective/reducer.cc b/paddle/fluid/distributed/collective/reducer.cc index fae276090c1..21041e24042 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 -- GitLab