From 5e9a203802a11836ed759b8f1e795189f187d94c Mon Sep 17 00:00:00 2001 From: jameszhang Date: Wed, 29 Mar 2023 10:53:34 +0800 Subject: [PATCH] [kunlun] support min/max in dygraph mode (#52228) * [kunlun] support min/max in dygraph mode * update xccl to 1.0.13 --- cmake/external/xpu.cmake | 2 +- paddle/fluid/distributed/collective/bkcl_tools.cc | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/cmake/external/xpu.cmake b/cmake/external/xpu.cmake index ffe840632b9..5e9c939c4df 100644 --- a/cmake/external/xpu.cmake +++ b/cmake/external/xpu.cmake @@ -9,7 +9,7 @@ set(XPU_RT_LIB_NAME "libxpurt.so") set(XPU_XFT_LIB_NAME "libxft.so") set(XPU_BASE_DATE "20230310") -set(XPU_XCCL_BASE_VERSION "1.0.12") +set(XPU_XCCL_BASE_VERSION "1.0.13") set(XPU_XFT_BASE_VERSION "latest") if(NOT DEFINED XPU_BASE_URL) diff --git a/paddle/fluid/distributed/collective/bkcl_tools.cc b/paddle/fluid/distributed/collective/bkcl_tools.cc index 13795ae67e5..ba5afbbf1fe 100644 --- a/paddle/fluid/distributed/collective/bkcl_tools.cc +++ b/paddle/fluid/distributed/collective/bkcl_tools.cc @@ -21,13 +21,16 @@ namespace distributed { BKCLOp ToBKCLRedType(ReduceOp reduction) { static const std::map red_type = { + {ReduceOp::MIN, BKCL_MIN}, + {ReduceOp::MAX, BKCL_MAX}, {ReduceOp::SUM, BKCL_ADD}, }; auto it = red_type.find(reduction); PADDLE_ENFORCE_EQ(it != red_type.end(), true, platform::errors::InvalidArgument( - "Invalid bkcl reduction. Must be BKCL_ADD")); + "Invalid bkcl reduction. Must be BKCL_MIN | BKCL_MAX | " + "BKCL_ADD")); return it->second; } -- GitLab