未验证 提交 5e9a2038 编写于 作者: J jameszhang 提交者: GitHub

[kunlun] support min/max in dygraph mode (#52228)

* [kunlun] support min/max in dygraph mode

* update xccl to 1.0.13
上级 fa07857a
...@@ -9,7 +9,7 @@ set(XPU_RT_LIB_NAME "libxpurt.so") ...@@ -9,7 +9,7 @@ set(XPU_RT_LIB_NAME "libxpurt.so")
set(XPU_XFT_LIB_NAME "libxft.so") set(XPU_XFT_LIB_NAME "libxft.so")
set(XPU_BASE_DATE "20230310") 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") set(XPU_XFT_BASE_VERSION "latest")
if(NOT DEFINED XPU_BASE_URL) if(NOT DEFINED XPU_BASE_URL)
......
...@@ -21,13 +21,16 @@ namespace distributed { ...@@ -21,13 +21,16 @@ namespace distributed {
BKCLOp ToBKCLRedType(ReduceOp reduction) { BKCLOp ToBKCLRedType(ReduceOp reduction) {
static const std::map<ReduceOp, BKCLOp> red_type = { static const std::map<ReduceOp, BKCLOp> red_type = {
{ReduceOp::MIN, BKCL_MIN},
{ReduceOp::MAX, BKCL_MAX},
{ReduceOp::SUM, BKCL_ADD}, {ReduceOp::SUM, BKCL_ADD},
}; };
auto it = red_type.find(reduction); auto it = red_type.find(reduction);
PADDLE_ENFORCE_EQ(it != red_type.end(), PADDLE_ENFORCE_EQ(it != red_type.end(),
true, true,
platform::errors::InvalidArgument( platform::errors::InvalidArgument(
"Invalid bkcl reduction. Must be BKCL_ADD")); "Invalid bkcl reduction. Must be BKCL_MIN | BKCL_MAX | "
"BKCL_ADD"));
return it->second; return it->second;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册