From b8008580b32ae21a5bcef8b31dbd7cacf62555c5 Mon Sep 17 00:00:00 2001 From: houj04 <35131887+houj04@users.noreply.github.com> Date: Thu, 16 Feb 2023 11:10:14 +0800 Subject: [PATCH] [XPU] update xccl to 1.0.8 and xdnn to 20230215 (#50247) * [XPU] update xccl to 1.0.8 * update xdnn. add uint8 for concat and split. * update xdnn to 20230215. --- cmake/external/xpu.cmake | 4 ++-- paddle/fluid/platform/device/xpu/bkcl_helper.h | 6 ++++-- paddle/fluid/pybind/process_group_utils.h | 6 ++++++ paddle/phi/backends/xpu/enforce_xpu.h | 2 +- paddle/phi/kernels/xpu/concat_and_split_functor.cc | 1 + 5 files changed, 14 insertions(+), 5 deletions(-) diff --git a/cmake/external/xpu.cmake b/cmake/external/xpu.cmake index 7eee112036a..0030c2e108f 100644 --- a/cmake/external/xpu.cmake +++ b/cmake/external/xpu.cmake @@ -7,8 +7,8 @@ set(XPU_PROJECT "extern_xpu") set(XPU_API_LIB_NAME "libxpuapi.so") set(XPU_RT_LIB_NAME "libxpurt.so") -set(XPU_BASE_DATE "20230119") -set(XPU_XCCL_BASE_VERSION "1.0.7") +set(XPU_BASE_DATE "20230215") +set(XPU_XCCL_BASE_VERSION "1.0.8") if(NOT DEFINED XPU_BASE_URL) set(XPU_BASE_URL_WITHOUT_DATE diff --git a/paddle/fluid/platform/device/xpu/bkcl_helper.h b/paddle/fluid/platform/device/xpu/bkcl_helper.h index 7bd1b67efd6..e7c968bd34f 100644 --- a/paddle/fluid/platform/device/xpu/bkcl_helper.h +++ b/paddle/fluid/platform/device/xpu/bkcl_helper.h @@ -51,10 +51,12 @@ inline BKCLDataType ToBKCLDataType(framework::proto::VarType::Type type) { return BKCL_FLOAT64; } else if (type == framework::proto::VarType::FP16) { return BKCL_FLOAT16; + } else if (type == framework::proto::VarType::UINT8) { + return BKCL_UINT8; } else { PADDLE_THROW(platform::errors::Unimplemented( - "BKCL currently only support FP32, INT64, INT32, FP64 and FP16, other " - "data types are not supported.")); + "BKCL currently only support FP32, INT64, INT32, FP64, FP16 and UINT8, " + "other data types are not supported.")); } } diff --git a/paddle/fluid/pybind/process_group_utils.h b/paddle/fluid/pybind/process_group_utils.h index 4e5af25f26d..6e71984b043 100644 --- a/paddle/fluid/pybind/process_group_utils.h +++ b/paddle/fluid/pybind/process_group_utils.h @@ -149,6 +149,9 @@ void ConcatDenseTensorWithType(const phi::XPUContext &dev_ctx, case phi::DataType::INT64: ConcatDenseTensor()(dev_ctx, t_list, p_out); break; + case phi::DataType::UINT8: + ConcatDenseTensor()(dev_ctx, t_list, p_out); + break; default: PADDLE_THROW(platform::errors::Unimplemented( "Data type (%s) is not supported when it concats tensors.", type)); @@ -217,6 +220,9 @@ void SplitDenseTensorWithType(const phi::XPUContext &dev_ctx, case phi::DataType::INT64: SplitDenseTensor()(dev_ctx, t_in, p_list); break; + case phi::DataType::UINT8: + SplitDenseTensor()(dev_ctx, t_in, p_list); + break; default: PADDLE_THROW(platform::errors::Unimplemented( "Data type (%s) is not supported when it splits tensors.", type)); diff --git a/paddle/phi/backends/xpu/enforce_xpu.h b/paddle/phi/backends/xpu/enforce_xpu.h index 71bea73634b..853001b1897 100644 --- a/paddle/phi/backends/xpu/enforce_xpu.h +++ b/paddle/phi/backends/xpu/enforce_xpu.h @@ -95,7 +95,7 @@ inline const char* xpuGetErrorString(int stat) { case XPUERR_INTERRUPTED: return "Execution interrupted by user"; default: - return "unkonwn error"; + return "unknown error"; } } diff --git a/paddle/phi/kernels/xpu/concat_and_split_functor.cc b/paddle/phi/kernels/xpu/concat_and_split_functor.cc index 8cb24859c78..edff1e90143 100644 --- a/paddle/phi/kernels/xpu/concat_and_split_functor.cc +++ b/paddle/phi/kernels/xpu/concat_and_split_functor.cc @@ -129,6 +129,7 @@ DEFINE_XPU_FUNCTOR(float) DEFINE_XPU_FUNCTOR(phi::dtype::float16) DEFINE_XPU_FUNCTOR(int32_t) DEFINE_XPU_FUNCTOR(int64_t) +DEFINE_XPU_FUNCTOR(uint8_t) } // namespace funcs } // namespace phi -- GitLab