From 7d449c93232e415bf48968f3b727084c1fb1ccb3 Mon Sep 17 00:00:00 2001 From: chenrunzhe Date: Mon, 11 Dec 2023 07:49:51 +0000 Subject: [PATCH 01/14] add support for XHPC --- CMakeLists.txt | 12 ++++++++ cmake/external/xpu.cmake | 38 ++++++++++++++++++++++-- setup.py | 6 ++++ tools/xpu/get_xhpc_dependences.sh | 49 +++++++++++++++++++++++++++++++ tools/xpu/pack_paddle_depence.sh | 7 +++-- 5 files changed, 107 insertions(+), 5 deletions(-) create mode 100644 tools/xpu/get_xhpc_dependences.sh diff --git a/CMakeLists.txt b/CMakeLists.txt index 2c123f76834b0b..ff4e98686c905b 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -54,6 +54,7 @@ option(WITH_XPU "Compile PaddlePaddle with BAIDU KUNLUN XPU" OFF) option(WITH_XPU_KP "Compile PaddlePaddle with BAIDU XPU compiler " OFF) option(WITH_XPU_XFT "Compile PaddlePaddle with BAIDU XPU-XFT" OFF) option(WITH_XPU_PLUGIN "Compile PaddlePaddle with BAIDU XPU plugin" OFF) +option(WITH_XPU_XHPC "Compile PaddlePaddle with BAIDU XPU-HPC library" OFF) option(WITH_WIN_DUMP_DBG "Compile with windows core dump debug mode" OFF) option(WITH_ROCM "Compile PaddlePaddle with ROCM platform" OFF) option(WITH_IPU "Compile PaddlePaddle with Graphcore IPU" OFF) @@ -86,6 +87,9 @@ endif() if(WITH_GPU AND WITH_XPU_XFT) message(FATAL_ERROR "Error when compile GPU and XPU-XFT at the same time") endif() +if(WITH_GPU AND WITH_XPU_XHPC) + message(FATAL_ERROR "Error when compile GPU and XPU-HPC at the same time") +endif() if(WITH_GPU AND WITH_ROCM) message(FATAL_ERROR "Error when compile CUDA and ROCM at the same time") endif() @@ -446,6 +450,14 @@ if(NOT WITH_XPU AND WITH_XPU_BKCL) CACHE STRING "Disable BKCL when compiling without XPU" FORCE) endif() +if(NOT WITH_XPU AND WITH_XPU_XHPC) + message( + WARNING "Disable XHPC when compiling without XPU. Force WITH_XPU_XHPC=OFF.") + set(WITH_XPU_XHPC + OFF + CACHE STRING "Disable XHPC when compiling without XPU" FORCE) +endif() + if(WITH_NCCL) add_definitions("-DPADDLE_WITH_NCCL") include(nccl) diff --git a/cmake/external/xpu.cmake b/cmake/external/xpu.cmake index 5534a24c8c297d..f00b7ce5407a2a 100644 --- a/cmake/external/xpu.cmake +++ b/cmake/external/xpu.cmake @@ -22,6 +22,8 @@ set(XPU_API_LIB_NAME "libxpuapi.so") set(XPU_RT_LIB_NAME "libxpurt.so") set(XPU_XFT_LIB_NAME "libxft.so") set(XPU_XPTI_LIB_NAME "libxpti.so") +set(XPU_XBLAS_LIB_NAME "libxpu_blas.so") +set(XPU_XFA_LIB_NAME "libxpu_flash_attention.so") if(NOT DEFINED XPU_BASE_DATE) set(XPU_BASE_DATE "20231128") @@ -75,11 +77,13 @@ elseif(WITH_BDCENTOS) set(XPU_XDNN_DIR_NAME "xdnn-bdcentos_x86_64") set(XPU_XCCL_DIR_NAME "${XPU_XCCL_PREFIX}-bdcentos_x86_64") set(XPU_XFT_DIR_NAME "xft_bdcentos6u3_x86_64_gcc82") + set(XPU_XHPC_DIR_NAME "xhpc-bdcentos_x86_64") elseif(WITH_UBUNTU) set(XPU_XRE_DIR_NAME "xre-ubuntu_x86_64") set(XPU_XDNN_DIR_NAME "xdnn-ubuntu_x86_64") set(XPU_XCCL_DIR_NAME "${XPU_XCCL_PREFIX}-ubuntu_x86_64") set(XPU_XFT_DIR_NAME "xft_ubuntu1604_x86_64") + set(XPU_XHPC_DIR_NAME "xhpc-ubuntu_x86_64") elseif(WITH_CENTOS) set(XPU_XRE_DIR_NAME "xre-centos7_x86_64") set(XPU_XDNN_DIR_NAME "xdnn-centos7_x86_64") @@ -90,6 +94,7 @@ else() set(XPU_XDNN_DIR_NAME "xdnn-ubuntu_x86_64") set(XPU_XCCL_DIR_NAME "${XPU_XCCL_PREFIX}-ubuntu_x86_64") set(XPU_XFT_DIR_NAME "xft_ubuntu1604_x86_64") + set(XPU_XHPC_DIR_NAME "xhpc-ubuntu_x86_64") endif() set(XPU_XPTI_DIR_NAME "xpti") @@ -109,6 +114,9 @@ set(XPU_XPTI_URL set(XPU_XFT_GET_DEPENCE_URL "https://baidu-kunlun-public.su.bcebos.com/paddle_depence/get_xft_dependence.sh" CACHE STRING "" FORCE) +set(XPU_XHPC_URL + "https://klx-sdk-release-public.su.bcebos.com/xhpc/dev/latest/output.tar.gz" + CACHE STRING "" FORCE) set(SNAPPY_PREFIX_DIR "${THIRD_PARTY_PATH}/xpu") set(XPU_DOWNLOAD_DIR "${SNAPPY_PREFIX_DIR}/src/${XPU_PROJECT}") @@ -117,7 +125,9 @@ set(XPU_INC_DIR "${THIRD_PARTY_PATH}/install/xpu/include") set(XPU_LIB_DIR "${THIRD_PARTY_PATH}/install/xpu/lib") set(XPU_API_LIB "${XPU_LIB_DIR}/${XPU_API_LIB_NAME}") +set(XPU_XBLAS_LIB "${XPU_LIB_DIR}/${XPU_XBLAS_LIB_NAME}") set(XPU_RT_LIB "${XPU_LIB_DIR}/${XPU_RT_LIB_NAME}") +set(XPU_XFA_LIB "${XPU_LIB_DIR}/${XPU_XFA_LIB_NAME}") set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_RPATH}" "${XPU_INSTALL_DIR}/lib") @@ -144,19 +154,22 @@ ExternalProject_Add( DOWNLOAD_DIR ${XPU_DOWNLOAD_DIR} DOWNLOAD_COMMAND bash ${CMAKE_SOURCE_DIR}/tools/xpu/check_xpu_dependence.sh ${XPU_BASE_URL} - ${XPU_XCCL_BASE_URL} && bash + ${XPU_XCCL_BASE_URL} && WITH_XPU_XHPC=${WITH_XPU_XHPC} bash ${CMAKE_SOURCE_DIR}/tools/xpu/pack_paddle_depence.sh ${XPU_XRE_URL} ${XPU_XRE_DIR_NAME} ${XPU_XDNN_URL} ${XPU_XDNN_DIR_NAME} ${XPU_XCCL_URL} ${XPU_XCCL_DIR_NAME} && wget ${XPU_XFT_GET_DEPENCE_URL} && bash get_xft_dependence.sh ${XPU_XFT_URL} ${XPU_XFT_DIR_NAME} && WITH_XPTI=${WITH_XPTI} bash ${CMAKE_SOURCE_DIR}/tools/xpu/get_xpti_dependence.sh ${XPU_XPTI_URL} - ${XPU_XPTI_DIR_NAME} + ${XPU_XPTI_DIR_NAME} && WITH_XPU_XHPC=${WITH_XPU_XHPC} bash + ${CMAKE_SOURCE_DIR}/tools/xpu/get_xhpc_dependences.sh ${XPU_XHPC_URL} + ${XPU_XHPC_DIR_NAME} DOWNLOAD_NO_PROGRESS 1 UPDATE_COMMAND "" CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${XPU_INSTALL_ROOT} CMAKE_CACHE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${XPU_INSTALL_ROOT} - BUILD_BYPRODUCTS ${XPU_API_LIB} + BUILD_BYPRODUCTS ${XPU_API_LIB} BUILD_BYPORDUCTS ${XPU_XBLAS_LIB} + BUILD_BYPRODUCTS ${XPU_XFA_LIB} BUILD_BYPRODUCTS ${XPU_RT_LIB} BUILD_BYPRODUCTS ${XPU_BKCL_LIB}) @@ -179,6 +192,20 @@ if(WITH_XPU_XFT) set(XPU_XFT_LIB "${XPU_LIB_DIR}/${XPU_XFT_LIB_NAME}") endif() +if(WITH_XPU_XHPC) + message(STATUS "Compile with XPU XHPC!") + add_definitions(-DPADDLE_WITH_XPU_XHPC) + + set(XPU_XHPC_INC_DIR "${XPU_INC_DIR}/xhpc") + include_directories(${XPU_XHPC_INC_DIR}) + set(XPU_XBLAS_INC_DIR "${XPU_INC_DIR}/xhpc/xblas") + include_directories(${XPU_XBLAS_INC_DIR}) + + set(XPU_XFA_INC_DIR "${XPU_INC_DIR}/xhpc/xfa") + include_directories(${XPU_XFA_INC_DIR}) + +endif() + if(WITH_XPTI) message(STATUS "Compile with XPU XPTI!") add_definitions(-DPADDLE_WITH_XPTI) @@ -206,6 +233,11 @@ if(WITH_XPTI) target_link_libraries(xpulib ${XPU_XPTI_LIB}) endif() +if(WITH_XPU_XHPC) + target_link_libraries(xpulib ${XPU_API_LIB} ${XPU_RT_LIB} ${XPU_XBLAS_LIB}) + target_link_libraries(xpulib ${XPU_API_LIB} ${XPU_RT_LIB} ${XPU_XFA_LIB}) +endif() + add_dependencies(xpulib ${XPU_PROJECT}) # Ensure that xpu/api.h can be included without dependency errors. diff --git a/setup.py b/setup.py index 05e7879607aade..673af9f1acc02e 100644 --- a/setup.py +++ b/setup.py @@ -1151,6 +1151,12 @@ def get_package_data_and_package_dir(): shutil.copy(env_dict.get("XPU_XPTI_LIB"), libs_path) package_data['paddle.libs'] += [env_dict.get("XPU_XPTI_LIB_NAME")] + if env_dict.get("WITH_XPU_XHPC") == 'ON': + shutil.copy(env_dict.get("XPU_XBLAS_LIB"), libs_path) + package_data['paddle.libs'] += [env_dict.get("XPU_XBLAS_LIB_NAME")] + shutil.copy(env_dict.get("XPU_XFA_LIB"), libs_path) + package_data['paddle.libs'] += [env_dict.get("XPU_XFA_LIB_NAME")] + # remove unused paddle/libs/__init__.py if os.path.isfile(libs_path + '/__init__.py'): os.remove(libs_path + '/__init__.py') diff --git a/tools/xpu/get_xhpc_dependences.sh b/tools/xpu/get_xhpc_dependences.sh new file mode 100644 index 00000000000000..ab365d367ef5a8 --- /dev/null +++ b/tools/xpu/get_xhpc_dependences.sh @@ -0,0 +1,49 @@ +#!/bin/bash + +# Copyright (c) 2023 PaddlePaddle Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -ex + +xhpc_base_url=$1 +xhpc_dir_name=$2 + +echo "xhpc_base_url: $xhpc_base_url" +echo "xhpc_dir_name: $xhpc_dir_name" + +if ! [ -n "$WITH_XPU_XHPC" ]; then + exit 0 +fi + +wget --no-check-certificate ${xhpc_base_url} -c -q -O xphc.tar.gz +if [[ $? -ne 0 ]]; then + echo "downloading failed: ${xhpc_base_url}" + exit 1 +else + echo "downloading ok: ${xhpc_base_url}" +fi + +tar -xf xphc.tar.gz + +mkdir -p xpu/include/xhpc/xblas +mkdir -p xpu/include/xhpc/xfa + +cp -r output/${xhpc_dir_name}/xblas/include/* xpu/include/xhpc/xblas +cp -r output/${xhpc_dir_name}/xblas/so/* xpu/lib/ + +cp -r output/${xhpc_dir_name}/xdnn/include/* xpu/include/ +cp -r output/${xhpc_dir_name}/xdnn/so/* xpu/lib + +cp -r output/${xhpc_dir_name}/xfa/include/* xpu/include/xhpc/xfa +cp -r output/${xhpc_dir_name}/xfa/so/* xpu/lib/ diff --git a/tools/xpu/pack_paddle_depence.sh b/tools/xpu/pack_paddle_depence.sh index 0538bf192695bd..b81312d0da1c51 100644 --- a/tools/xpu/pack_paddle_depence.sh +++ b/tools/xpu/pack_paddle_depence.sh @@ -38,9 +38,12 @@ tar xvf xccl.tar.gz mkdir -p xpu/include/xpu mkdir -p xpu/lib +if ! [ -n "$WITH_XPU_XHPC" ]; then + cp -r $XDNN_DIR_NAME/include/xpu/* xpu/include/xpu/ + cp -r $XDNN_DIR_NAME/so/libxpuapi.so xpu/lib/ +fi + cp -r $XRE_DIR_NAME/include/xpu/* xpu/include/xpu/ cp -r $XRE_DIR_NAME/so/libxpurt* xpu/lib/ -cp -r $XDNN_DIR_NAME/include/xpu/* xpu/include/xpu/ -cp -r $XDNN_DIR_NAME/so/libxpuapi.so xpu/lib/ cp -r $XCCL_DIR_NAME/include/* xpu/include/xpu/ cp -r $XCCL_DIR_NAME/so/* xpu/lib/ From 818e4d018bfa407bda45149495a065b7a77a2f80 Mon Sep 17 00:00:00 2001 From: chenrunzhe Date: Mon, 11 Dec 2023 07:49:51 +0000 Subject: [PATCH 02/14] add support for XHPC --- cmake/external/xpu.cmake | 15 +++++++++------ tools/xpu/pack_paddle_depence.sh | 24 +++++++++++++++++++++++- 2 files changed, 32 insertions(+), 7 deletions(-) diff --git a/cmake/external/xpu.cmake b/cmake/external/xpu.cmake index f00b7ce5407a2a..3414b3bba58267 100644 --- a/cmake/external/xpu.cmake +++ b/cmake/external/xpu.cmake @@ -114,9 +114,12 @@ set(XPU_XPTI_URL set(XPU_XFT_GET_DEPENCE_URL "https://baidu-kunlun-public.su.bcebos.com/paddle_depence/get_xft_dependence.sh" CACHE STRING "" FORCE) -set(XPU_XHPC_URL - "https://klx-sdk-release-public.su.bcebos.com/xhpc/dev/latest/output.tar.gz" - CACHE STRING "" FORCE) + +if(WITH_XPU_XHPC) + set(XPU_XHPC_URL + "https://klx-sdk-release-public.su.bcebos.com/xhpc/dev/latest/output.tar.gz" + CACHE STRING "" FORCE) +endif() set(SNAPPY_PREFIX_DIR "${THIRD_PARTY_PATH}/xpu") set(XPU_DOWNLOAD_DIR "${SNAPPY_PREFIX_DIR}/src/${XPU_PROJECT}") @@ -157,9 +160,9 @@ ExternalProject_Add( ${XPU_XCCL_BASE_URL} && WITH_XPU_XHPC=${WITH_XPU_XHPC} bash ${CMAKE_SOURCE_DIR}/tools/xpu/pack_paddle_depence.sh ${XPU_XRE_URL} ${XPU_XRE_DIR_NAME} ${XPU_XDNN_URL} ${XPU_XDNN_DIR_NAME} ${XPU_XCCL_URL} - ${XPU_XCCL_DIR_NAME} && wget ${XPU_XFT_GET_DEPENCE_URL} && bash - get_xft_dependence.sh ${XPU_XFT_URL} ${XPU_XFT_DIR_NAME} && - WITH_XPTI=${WITH_XPTI} bash + ${XPU_XCCL_DIR_NAME} ${XPU_XHPC_URL} ${XPU_XHPC_DIR_NAME} && wget + ${XPU_XFT_GET_DEPENCE_URL} && bash get_xft_dependence.sh ${XPU_XFT_URL} + ${XPU_XFT_DIR_NAME} && WITH_XPTI=${WITH_XPTI} bash ${CMAKE_SOURCE_DIR}/tools/xpu/get_xpti_dependence.sh ${XPU_XPTI_URL} ${XPU_XPTI_DIR_NAME} && WITH_XPU_XHPC=${WITH_XPU_XHPC} bash ${CMAKE_SOURCE_DIR}/tools/xpu/get_xhpc_dependences.sh ${XPU_XHPC_URL} diff --git a/tools/xpu/pack_paddle_depence.sh b/tools/xpu/pack_paddle_depence.sh index b81312d0da1c51..e3765e5c2611a9 100644 --- a/tools/xpu/pack_paddle_depence.sh +++ b/tools/xpu/pack_paddle_depence.sh @@ -17,6 +17,12 @@ set -e set -x +if [[ $# -e 8 ]]; then + echo "Compiling Paddle with XHPC" + XHPC_URL=$7 + XHPC_DIR_NAME=$8 +fi + XRE_URL=$1 XRE_DIR_NAME=$2 @@ -35,10 +41,26 @@ tar xvf xdnn.tar.gz wget --no-check-certificate ${XCCL_URL} -q -O xccl.tar.gz tar xvf xccl.tar.gz +if [ -n ${XHPC_URL} ]; then + wget --no-check-certificate ${XHPC_URL} -q -O xhpc.tar.gz + tar xvf xphc.tar.gz + mkdir -p xpu/include/xhpc/xblas + mkdir -p xpu/include/xhpc/xfa + + cp -r output/${XHPC_DIR_NAME}/xblas/include/* xpu/include/xhpc/xblas + cp -r output/${XHPC_DIR_NAME}/xblas/so/* xpu/lib/ + + cp -r output/${XHPC_DIR_NAME}/xdnn/include/* xpu/include/ + cp -r output/${XHPC_DIR_NAME}/xdnn/so/* xpu/lib + + cp -r output/${XHPC_DIR_NAME}/xfa/include/* xpu/include/xhpc/xfa + cp -r output/${XHPC_DIR_NAME}/xfa/so/* xpu/lib/ +fi + mkdir -p xpu/include/xpu mkdir -p xpu/lib -if ! [ -n "$WITH_XPU_XHPC" ]; then +if ! [ -n ${XHPC_URL} ]; then cp -r $XDNN_DIR_NAME/include/xpu/* xpu/include/xpu/ cp -r $XDNN_DIR_NAME/so/libxpuapi.so xpu/lib/ fi From a8c56857645eb31b3a39e5b91095e524799c1606 Mon Sep 17 00:00:00 2001 From: chenrunzhe Date: Mon, 11 Dec 2023 07:49:51 +0000 Subject: [PATCH 03/14] add support for XHPC --- tools/xpu/get_xhpc_dependences.sh | 49 ------------------------------- tools/xpu/pack_paddle_depence.sh | 2 +- 2 files changed, 1 insertion(+), 50 deletions(-) delete mode 100644 tools/xpu/get_xhpc_dependences.sh diff --git a/tools/xpu/get_xhpc_dependences.sh b/tools/xpu/get_xhpc_dependences.sh deleted file mode 100644 index ab365d367ef5a8..00000000000000 --- a/tools/xpu/get_xhpc_dependences.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/bash - -# Copyright (c) 2023 PaddlePaddle Authors. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -ex - -xhpc_base_url=$1 -xhpc_dir_name=$2 - -echo "xhpc_base_url: $xhpc_base_url" -echo "xhpc_dir_name: $xhpc_dir_name" - -if ! [ -n "$WITH_XPU_XHPC" ]; then - exit 0 -fi - -wget --no-check-certificate ${xhpc_base_url} -c -q -O xphc.tar.gz -if [[ $? -ne 0 ]]; then - echo "downloading failed: ${xhpc_base_url}" - exit 1 -else - echo "downloading ok: ${xhpc_base_url}" -fi - -tar -xf xphc.tar.gz - -mkdir -p xpu/include/xhpc/xblas -mkdir -p xpu/include/xhpc/xfa - -cp -r output/${xhpc_dir_name}/xblas/include/* xpu/include/xhpc/xblas -cp -r output/${xhpc_dir_name}/xblas/so/* xpu/lib/ - -cp -r output/${xhpc_dir_name}/xdnn/include/* xpu/include/ -cp -r output/${xhpc_dir_name}/xdnn/so/* xpu/lib - -cp -r output/${xhpc_dir_name}/xfa/include/* xpu/include/xhpc/xfa -cp -r output/${xhpc_dir_name}/xfa/so/* xpu/lib/ diff --git a/tools/xpu/pack_paddle_depence.sh b/tools/xpu/pack_paddle_depence.sh index e3765e5c2611a9..26ce0575eb5afd 100644 --- a/tools/xpu/pack_paddle_depence.sh +++ b/tools/xpu/pack_paddle_depence.sh @@ -17,7 +17,7 @@ set -e set -x -if [[ $# -e 8 ]]; then +if [[ $# -eq 8 ]]; then echo "Compiling Paddle with XHPC" XHPC_URL=$7 XHPC_DIR_NAME=$8 From 9bb25705f45e559a51ad140534115c8d6c5b22dc Mon Sep 17 00:00:00 2001 From: chenrunzhe Date: Mon, 11 Dec 2023 07:49:51 +0000 Subject: [PATCH 04/14] add support for XHPC --- cmake/external/xpu.cmake | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cmake/external/xpu.cmake b/cmake/external/xpu.cmake index 3414b3bba58267..0a37d7c360da63 100644 --- a/cmake/external/xpu.cmake +++ b/cmake/external/xpu.cmake @@ -28,6 +28,9 @@ set(XPU_XFA_LIB_NAME "libxpu_flash_attention.so") if(NOT DEFINED XPU_BASE_DATE) set(XPU_BASE_DATE "20231128") endif() +if(NOT DEFINED XPU_XHPC_BASE_DATE) + set(XPU_XHPC_BASE_DATE "20231208") +endif() set(XPU_XCCL_BASE_VERSION "1.1.6.1") if(NOT DEFINED XPU_XFT_BASE_VERSION) set(XPU_XFT_BASE_VERSION "20230602") @@ -117,7 +120,7 @@ set(XPU_XFT_GET_DEPENCE_URL if(WITH_XPU_XHPC) set(XPU_XHPC_URL - "https://klx-sdk-release-public.su.bcebos.com/xhpc/dev/latest/output.tar.gz" + "https://klx-sdk-release-public.su.bcebos.com/xhpc/dev/${XPU_XHPC_BASE_DATE}/${XPU_XHPC_DIR_NAME}.tar.gz" CACHE STRING "" FORCE) endif() @@ -164,9 +167,7 @@ ExternalProject_Add( ${XPU_XFT_GET_DEPENCE_URL} && bash get_xft_dependence.sh ${XPU_XFT_URL} ${XPU_XFT_DIR_NAME} && WITH_XPTI=${WITH_XPTI} bash ${CMAKE_SOURCE_DIR}/tools/xpu/get_xpti_dependence.sh ${XPU_XPTI_URL} - ${XPU_XPTI_DIR_NAME} && WITH_XPU_XHPC=${WITH_XPU_XHPC} bash - ${CMAKE_SOURCE_DIR}/tools/xpu/get_xhpc_dependences.sh ${XPU_XHPC_URL} - ${XPU_XHPC_DIR_NAME} + ${XPU_XPTI_DIR_NAME} DOWNLOAD_NO_PROGRESS 1 UPDATE_COMMAND "" CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${XPU_INSTALL_ROOT} From 4bf1c5e16d86f938c700b116eda5a460148c1aca Mon Sep 17 00:00:00 2001 From: chenrunzhe Date: Mon, 11 Dec 2023 07:49:51 +0000 Subject: [PATCH 05/14] add support for XHPC --- cmake/external/xpu.cmake | 4 ++-- tools/xpu/pack_paddle_depence.sh | 21 +++++++++++---------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/cmake/external/xpu.cmake b/cmake/external/xpu.cmake index 0a37d7c360da63..aa9ecfe815b036 100644 --- a/cmake/external/xpu.cmake +++ b/cmake/external/xpu.cmake @@ -238,8 +238,8 @@ if(WITH_XPTI) endif() if(WITH_XPU_XHPC) - target_link_libraries(xpulib ${XPU_API_LIB} ${XPU_RT_LIB} ${XPU_XBLAS_LIB}) - target_link_libraries(xpulib ${XPU_API_LIB} ${XPU_RT_LIB} ${XPU_XFA_LIB}) + target_link_libraries(xpulib ${XPU_API_LIB} ${XPU_RT_LIB} ${XPU_XBLAS_LIB} + ${XPU_XFA_LIB}) endif() add_dependencies(xpulib ${XPU_PROJECT}) diff --git a/tools/xpu/pack_paddle_depence.sh b/tools/xpu/pack_paddle_depence.sh index 26ce0575eb5afd..39d2ba02b49ccf 100644 --- a/tools/xpu/pack_paddle_depence.sh +++ b/tools/xpu/pack_paddle_depence.sh @@ -41,28 +41,29 @@ tar xvf xdnn.tar.gz wget --no-check-certificate ${XCCL_URL} -q -O xccl.tar.gz tar xvf xccl.tar.gz +mkdir -p xpu/include/xpu +mkdir -p xpu/lib + if [ -n ${XHPC_URL} ]; then wget --no-check-certificate ${XHPC_URL} -q -O xhpc.tar.gz tar xvf xphc.tar.gz + mkdir -p xpu/include/xhpc/xblas mkdir -p xpu/include/xhpc/xfa - cp -r output/${XHPC_DIR_NAME}/xblas/include/* xpu/include/xhpc/xblas - cp -r output/${XHPC_DIR_NAME}/xblas/so/* xpu/lib/ + cp -r ${XHPC_DIR_NAME}/xblas/include/* xpu/include/xhpc/xblas + cp -r ${XHPC_DIR_NAME}/xblas/so/* xpu/lib/ - cp -r output/${XHPC_DIR_NAME}/xdnn/include/* xpu/include/ - cp -r output/${XHPC_DIR_NAME}/xdnn/so/* xpu/lib + cp -r ${XHPC_DIR_NAME}/xdnn/include/* xpu/include/ + cp -r ${XHPC_DIR_NAME}/xdnn/so/* xpu/lib - cp -r output/${XHPC_DIR_NAME}/xfa/include/* xpu/include/xhpc/xfa - cp -r output/${XHPC_DIR_NAME}/xfa/so/* xpu/lib/ + cp -r ${XHPC_DIR_NAME}/xfa/include/* xpu/include/xhpc/xfa + cp -r ${XHPC_DIR_NAME}/xfa/so/* xpu/lib/ fi -mkdir -p xpu/include/xpu -mkdir -p xpu/lib - if ! [ -n ${XHPC_URL} ]; then cp -r $XDNN_DIR_NAME/include/xpu/* xpu/include/xpu/ - cp -r $XDNN_DIR_NAME/so/libxpuapi.so xpu/lib/ + cp -r $XDNN_DIR_NAME/so/* xpu/lib/ fi cp -r $XRE_DIR_NAME/include/xpu/* xpu/include/xpu/ From ec7374055ec420f7930a62fc7ff9eb5808cd9c7c Mon Sep 17 00:00:00 2001 From: chenrunzhe Date: Mon, 11 Dec 2023 07:49:51 +0000 Subject: [PATCH 06/14] add support for XHPC --- tools/xpu/pack_paddle_depence.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/xpu/pack_paddle_depence.sh b/tools/xpu/pack_paddle_depence.sh index 39d2ba02b49ccf..2b8ee17da39f53 100644 --- a/tools/xpu/pack_paddle_depence.sh +++ b/tools/xpu/pack_paddle_depence.sh @@ -46,7 +46,7 @@ mkdir -p xpu/lib if [ -n ${XHPC_URL} ]; then wget --no-check-certificate ${XHPC_URL} -q -O xhpc.tar.gz - tar xvf xphc.tar.gz + tar xvf xhpc.tar.gz mkdir -p xpu/include/xhpc/xblas mkdir -p xpu/include/xhpc/xfa From 93291063e556ba2512796b4d9bee3d08f7bb6c5f Mon Sep 17 00:00:00 2001 From: chenrunzhe Date: Mon, 11 Dec 2023 07:49:51 +0000 Subject: [PATCH 07/14] add support for XHPC --- tools/xpu/pack_paddle_depence.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/xpu/pack_paddle_depence.sh b/tools/xpu/pack_paddle_depence.sh index 2b8ee17da39f53..52e836df36b257 100644 --- a/tools/xpu/pack_paddle_depence.sh +++ b/tools/xpu/pack_paddle_depence.sh @@ -44,7 +44,9 @@ tar xvf xccl.tar.gz mkdir -p xpu/include/xpu mkdir -p xpu/lib -if [ -n ${XHPC_URL} ]; then +if ! [ -z ${XHPC_URL} ]; then + echo "Compiling Paddle with XHPC" + echo "XHPC_URL: ${XHPC_URL}" wget --no-check-certificate ${XHPC_URL} -q -O xhpc.tar.gz tar xvf xhpc.tar.gz @@ -61,7 +63,7 @@ if [ -n ${XHPC_URL} ]; then cp -r ${XHPC_DIR_NAME}/xfa/so/* xpu/lib/ fi -if ! [ -n ${XHPC_URL} ]; then +if [ -z ${XHPC_URL} ]; then cp -r $XDNN_DIR_NAME/include/xpu/* xpu/include/xpu/ cp -r $XDNN_DIR_NAME/so/* xpu/lib/ fi From 78eae41395ec200740b51e9c6eba0dda1b4fb7b5 Mon Sep 17 00:00:00 2001 From: chenrunzhe Date: Mon, 11 Dec 2023 07:49:51 +0000 Subject: [PATCH 08/14] add support for XHPC --- cmake/external/xpu.cmake | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/cmake/external/xpu.cmake b/cmake/external/xpu.cmake index aa9ecfe815b036..a5851e646e29a0 100644 --- a/cmake/external/xpu.cmake +++ b/cmake/external/xpu.cmake @@ -222,16 +222,8 @@ if(WITH_XPU_PLUGIN) include_directories(${CMAKE_SOURCE_DIR}/paddle/phi/kernels/xpu/plugin/include) endif() -if(WITH_XPU_BKCL AND WITH_XPU_XFT) - target_link_libraries(xpulib ${XPU_API_LIB} ${XPU_RT_LIB} ${XPU_BKCL_LIB} +target_link_libraries(xpulib ${XPU_API_LIB} ${XPU_RT_LIB} ${XPU_BKCL_LIB} ${XPU_XFT_LIB}) -elseif(WITH_XPU_BKCL) - target_link_libraries(xpulib ${XPU_API_LIB} ${XPU_RT_LIB} ${XPU_BKCL_LIB}) -elseif(WITH_XPU_XFT) - target_link_libraries(xpulib ${XPU_API_LIB} ${XPU_RT_LIB} ${XPU_XFT_LIB}) -else() - target_link_libraries(xpulib ${XPU_API_LIB} ${XPU_RT_LIB}) -endif() if(WITH_XPTI) target_link_libraries(xpulib ${XPU_XPTI_LIB}) From 4461e7f0d28e8b18003dbe79c1eea0ea2b774ef9 Mon Sep 17 00:00:00 2001 From: runzhech Date: Tue, 12 Dec 2023 02:24:51 +0000 Subject: [PATCH 09/14] refresh ci From 70d7f5894c88656f6947f7986d48722b202591d0 Mon Sep 17 00:00:00 2001 From: runzhech Date: Tue, 12 Dec 2023 02:24:51 +0000 Subject: [PATCH 10/14] refresh ci --- cmake/external/xpu.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/external/xpu.cmake b/cmake/external/xpu.cmake index a5851e646e29a0..2ad5856375300c 100644 --- a/cmake/external/xpu.cmake +++ b/cmake/external/xpu.cmake @@ -223,7 +223,7 @@ if(WITH_XPU_PLUGIN) endif() target_link_libraries(xpulib ${XPU_API_LIB} ${XPU_RT_LIB} ${XPU_BKCL_LIB} - ${XPU_XFT_LIB}) + ${XPU_XFT_LIB}) if(WITH_XPTI) target_link_libraries(xpulib ${XPU_XPTI_LIB}) From bcd96ed217b070c566a511cb20c853038da1e654 Mon Sep 17 00:00:00 2001 From: runzhech Date: Tue, 12 Dec 2023 02:24:51 +0000 Subject: [PATCH 11/14] refresh ci --- cmake/external/xpu.cmake | 1 - tools/xpu/pack_paddle_depence.sh | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/cmake/external/xpu.cmake b/cmake/external/xpu.cmake index 2ad5856375300c..7c197fa020b382 100644 --- a/cmake/external/xpu.cmake +++ b/cmake/external/xpu.cmake @@ -207,7 +207,6 @@ if(WITH_XPU_XHPC) set(XPU_XFA_INC_DIR "${XPU_INC_DIR}/xhpc/xfa") include_directories(${XPU_XFA_INC_DIR}) - endif() if(WITH_XPTI) diff --git a/tools/xpu/pack_paddle_depence.sh b/tools/xpu/pack_paddle_depence.sh index 52e836df36b257..2df7c98cbf48ab 100644 --- a/tools/xpu/pack_paddle_depence.sh +++ b/tools/xpu/pack_paddle_depence.sh @@ -61,9 +61,7 @@ if ! [ -z ${XHPC_URL} ]; then cp -r ${XHPC_DIR_NAME}/xfa/include/* xpu/include/xhpc/xfa cp -r ${XHPC_DIR_NAME}/xfa/so/* xpu/lib/ -fi - -if [ -z ${XHPC_URL} ]; then +else cp -r $XDNN_DIR_NAME/include/xpu/* xpu/include/xpu/ cp -r $XDNN_DIR_NAME/so/* xpu/lib/ fi From 14af5b781a758ad7b9388280b0ce4b1e40665292 Mon Sep 17 00:00:00 2001 From: runzhech Date: Tue, 12 Dec 2023 02:24:51 +0000 Subject: [PATCH 12/14] refresh ci --- python/env_dict.py.in | 5 +++++ python/setup.py.in | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/python/env_dict.py.in b/python/env_dict.py.in index 58900192743e47..ca157737661803 100644 --- a/python/env_dict.py.in +++ b/python/env_dict.py.in @@ -66,6 +66,11 @@ env_dict={ 'WITH_XPU_XFT':'@WITH_XPU_XFT@', 'XPU_XFT_LIB':'@XPU_XFT_LIB@', 'XPU_XFT_LIB_NAME':'@XPU_XFT_LIB_NAME@', + 'WITH_XPU_XHPC':'@WITH_XPU_XHPC@', + 'XPU_XBLAS_LIB':'@XPU_XBLAS_LIB@', + 'XPU_XBLAS_LIB_NAME':'@XPU_XBLAS_LIB_NAME@', + 'XPU_XFA_LIB':'@XPU_XFA_LIB@', + 'XPU_XFA_LIB_NAME':'@XPU_XFA_LIB_NAME@', 'THIRD_PARTY_PATH':'@THIRD_PARTY_PATH@', 'SETUP_LOG_FILE':'@SETUP_LOG_FILE@', 'WITH_STRIP':'@WITH_STRIP@', diff --git a/python/setup.py.in b/python/setup.py.in index ad87011315b592..9b602aa726129c 100644 --- a/python/setup.py.in +++ b/python/setup.py.in @@ -722,6 +722,12 @@ if '${WITH_XPTI}' == 'ON': shutil.copy('${XPU_XPTI_LIB}', libs_path) package_data['paddle.libs']+=['${XPU_XPTI_LIB_NAME}'] +if '${WITH_XPU_XHPC}' == 'ON': + shutil.copy('${XPU_XBLAS_LIB}', libs_path) + package_data['paddle.libs'] += ['${XPU_XBLAS_LIB_NAME}'] + shutil.copy('${XPU_XFA_LIB}', libs_path) + package_data['paddle.libs'] += ['${XPU_XFA_LIB_NAME}'] + # remove unused paddle/libs/__init__.py if os.path.isfile(libs_path+'/__init__.py'): os.remove(libs_path+'/__init__.py') From 669c441d0b5f05ee60aac9f04906b52a0ad50a24 Mon Sep 17 00:00:00 2001 From: runzhech Date: Wed, 13 Dec 2023 08:53:18 +0000 Subject: [PATCH 13/14] [XPU] add xpu xhpc version info into version.show() --- python/setup.py.in | 33 ++++++++++++++++++++++++++++++++- setup.py | 9 +++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/python/setup.py.in b/python/setup.py.in index f79cdc7ff028b0..38e58561baaa58 100644 --- a/python/setup.py.in +++ b/python/setup.py.in @@ -88,6 +88,12 @@ def get_xpu_xccl_version(): else: return 'False' +def get_xpu_xhpc_version(): + if '@WITH_XPU_XHPC@' == 'ON': + return '@XPU_XHPC_BASE_DATE@' + else: + return 'False' + def is_taged(): try: cmd = ['git', 'describe', '--exact-match', '--tags', 'HEAD', '2>/dev/null'] @@ -118,12 +124,13 @@ cuda_version = '%(cuda)s' cudnn_version = '%(cudnn)s' xpu_version = '%(xpu)s' xpu_xccl_version = '%(xpu_xccl)s' +xpu_xhpc_version = '%(xpu_xhpc)s' istaged = %(istaged)s commit = '%(commit)s' with_mkl = '%(with_mkl)s' cinn_version = '%(cinn)s' -__all__ = ['cuda', 'cudnn', 'show', 'xpu', 'xpu_xccl'] +__all__ = ['cuda', 'cudnn', 'show', 'xpu', 'xpu_xccl', 'xpu_xhpc'] def show(): """Get the version of paddle if `paddle` package if tagged. Otherwise, output the corresponding commit id. @@ -150,6 +157,8 @@ def show(): xpu_xccl: the xpu xccl version of package. It will return `False` if non-XPU version paddle package is installed + xpu_xhpc: the xpu xhpc version of package. It will return `False` if non-XPU version paddle package is installed + cinn: the cinn version of package. It will return `False` if paddle package is not compiled with CINN Examples: @@ -169,6 +178,7 @@ def show(): cudnn: '7.6.5' xpu: '20230114' xpu_xccl: '1.0.7' + xpu_xhpc: '20231208' cinn: False >>> # doctest: -SKIP @@ -180,6 +190,7 @@ def show(): cudnn: '7.6.5' xpu: '20230114' xpu_xccl: '1.0.7' + xpu_xhpc: '20231208' cinn: False >>> # doctest: -SKIP @@ -196,6 +207,7 @@ def show(): print('cudnn:', cudnn_version) print('xpu:', xpu_version) print('xpu_xccl:', xpu_xccl_version) + print('xpu_xhpc:', xpu_xhpc_version) print('cinn:', cinn_version) def mkl(): @@ -273,6 +285,24 @@ def xpu_xccl(): """ return xpu_xccl_version +def xpu_xhpc(): + """Get xpu xhpc version of paddle package. + + Returns: + string: Return the version information of xpu xhpc. If paddle package is non-XPU version, it will return False. + + Examples: + .. code-block:: python + + >>> import paddle + + >>> paddle.version.xpu_xhpc() + >>> # doctest: +SKIP('Different environments yield different output.') + '20231208' + + """ + return xpu_xhpc_version + def cinn(): """Get CINN version of paddle package. @@ -312,6 +342,7 @@ def cinn(): 'cudnn': get_cudnn_version(), 'xpu': get_xpu_version(), 'xpu_xccl': get_xpu_xccl_version(), + 'xpu_xhpc': get_xpu_xhpc_version(), 'commit': commit, 'istaged': is_taged(), 'with_mkl': '@WITH_MKL@', diff --git a/setup.py b/setup.py index 4bc720257c9356..34cca9481e5814 100644 --- a/setup.py +++ b/setup.py @@ -399,6 +399,14 @@ def get_xpu_xccl_version(): return 'False' +def get_xpu_xhpc_version(): + with_xpu_xhpc = env_dict.get("WITH_XPU_XHPC") + if with_xpu_xhpc == 'ON': + return env_dict.get("XPU_XHPC_BASE_DATE") + else: + return 'False' + + def is_taged(): try: cmd = [ @@ -640,6 +648,7 @@ def cinn(): 'cudnn': get_cudnn_version(), 'xpu': get_xpu_version(), 'xpu_xccl': get_xpu_xccl_version(), + 'xpu_xhpc': get_xpu_xhpc_version(), 'commit': commit, 'istaged': is_taged(), 'with_mkl': env_dict.get("WITH_MKL"), From 1d57d583ac721812c9f545ed97626910772be678 Mon Sep 17 00:00:00 2001 From: runzhech Date: Wed, 13 Dec 2023 08:53:18 +0000 Subject: [PATCH 14/14] [XPU] add xpu xhpc version info into version.show() --- python/setup.py.in | 33 ++++++++++++++++++++++++++++++++- setup.py | 35 ++++++++++++++++++++++++++++++++++- 2 files changed, 66 insertions(+), 2 deletions(-) diff --git a/python/setup.py.in b/python/setup.py.in index f79cdc7ff028b0..38e58561baaa58 100644 --- a/python/setup.py.in +++ b/python/setup.py.in @@ -88,6 +88,12 @@ def get_xpu_xccl_version(): else: return 'False' +def get_xpu_xhpc_version(): + if '@WITH_XPU_XHPC@' == 'ON': + return '@XPU_XHPC_BASE_DATE@' + else: + return 'False' + def is_taged(): try: cmd = ['git', 'describe', '--exact-match', '--tags', 'HEAD', '2>/dev/null'] @@ -118,12 +124,13 @@ cuda_version = '%(cuda)s' cudnn_version = '%(cudnn)s' xpu_version = '%(xpu)s' xpu_xccl_version = '%(xpu_xccl)s' +xpu_xhpc_version = '%(xpu_xhpc)s' istaged = %(istaged)s commit = '%(commit)s' with_mkl = '%(with_mkl)s' cinn_version = '%(cinn)s' -__all__ = ['cuda', 'cudnn', 'show', 'xpu', 'xpu_xccl'] +__all__ = ['cuda', 'cudnn', 'show', 'xpu', 'xpu_xccl', 'xpu_xhpc'] def show(): """Get the version of paddle if `paddle` package if tagged. Otherwise, output the corresponding commit id. @@ -150,6 +157,8 @@ def show(): xpu_xccl: the xpu xccl version of package. It will return `False` if non-XPU version paddle package is installed + xpu_xhpc: the xpu xhpc version of package. It will return `False` if non-XPU version paddle package is installed + cinn: the cinn version of package. It will return `False` if paddle package is not compiled with CINN Examples: @@ -169,6 +178,7 @@ def show(): cudnn: '7.6.5' xpu: '20230114' xpu_xccl: '1.0.7' + xpu_xhpc: '20231208' cinn: False >>> # doctest: -SKIP @@ -180,6 +190,7 @@ def show(): cudnn: '7.6.5' xpu: '20230114' xpu_xccl: '1.0.7' + xpu_xhpc: '20231208' cinn: False >>> # doctest: -SKIP @@ -196,6 +207,7 @@ def show(): print('cudnn:', cudnn_version) print('xpu:', xpu_version) print('xpu_xccl:', xpu_xccl_version) + print('xpu_xhpc:', xpu_xhpc_version) print('cinn:', cinn_version) def mkl(): @@ -273,6 +285,24 @@ def xpu_xccl(): """ return xpu_xccl_version +def xpu_xhpc(): + """Get xpu xhpc version of paddle package. + + Returns: + string: Return the version information of xpu xhpc. If paddle package is non-XPU version, it will return False. + + Examples: + .. code-block:: python + + >>> import paddle + + >>> paddle.version.xpu_xhpc() + >>> # doctest: +SKIP('Different environments yield different output.') + '20231208' + + """ + return xpu_xhpc_version + def cinn(): """Get CINN version of paddle package. @@ -312,6 +342,7 @@ def cinn(): 'cudnn': get_cudnn_version(), 'xpu': get_xpu_version(), 'xpu_xccl': get_xpu_xccl_version(), + 'xpu_xhpc': get_xpu_xhpc_version(), 'commit': commit, 'istaged': is_taged(), 'with_mkl': '@WITH_MKL@', diff --git a/setup.py b/setup.py index 4bc720257c9356..47b1cab1473e22 100644 --- a/setup.py +++ b/setup.py @@ -399,6 +399,14 @@ def get_xpu_xccl_version(): return 'False' +def get_xpu_xhpc_version(): + with_xpu_xhpc = env_dict.get("WITH_XPU_XHPC") + if with_xpu_xhpc == 'ON': + return env_dict.get("XPU_XHPC_BASE_DATE") + else: + return 'False' + + def is_taged(): try: cmd = [ @@ -445,12 +453,13 @@ def write_version_py(filename='paddle/version/__init__.py'): cudnn_version = '%(cudnn)s' xpu_version = '%(xpu)s' xpu_xccl_version = '%(xpu_xccl)s' +xpu_xhpc_version = '%(xpu_xhpc)s' istaged = %(istaged)s commit = '%(commit)s' with_mkl = '%(with_mkl)s' cinn_version = '%(cinn)s' -__all__ = ['cuda', 'cudnn', 'show', 'xpu', 'xpu_xccl'] +__all__ = ['cuda', 'cudnn', 'show', 'xpu', 'xpu_xccl', 'xpu_xhpc] def show(): """Get the version of paddle if `paddle` package if tagged. Otherwise, output the corresponding commit id. @@ -477,6 +486,8 @@ def show(): xpu_xccl: the xpu xccl version of package. It will return `False` if non-XPU version paddle package is installed + xpu_xhpc: the xpu xhpc version of package. It will return `False` if non-XPU version paddle package is installed + cinn: the cinn version of package. It will return `False` if paddle package is not compiled with CINN Examples: @@ -496,6 +507,7 @@ def show(): cudnn: '7.6.5' xpu: '20230114' xpu_xccl: '1.0.7' + xpu_xhpc: '20231208' cinn: False >>> # doctest: -SKIP @@ -507,6 +519,7 @@ def show(): cudnn: '7.6.5' xpu: '20230114' xpu_xccl: '1.0.7' + xpu_xhpc: '20231208' cinn: False >>> # doctest: -SKIP """ @@ -522,6 +535,7 @@ def show(): print('cudnn:', cudnn_version) print('xpu:', xpu_version) print('xpu_xccl:', xpu_xccl_version) + print('xpu_xhpc:', xpu_xhpc_version) print('cinn:', cinn_version) def mkl(): @@ -599,6 +613,24 @@ def xpu_xccl(): """ return xpu_xccl_version +def xpu_xhpc(): + """Get xpu xhpc version of paddle package. + + Returns: + string: Return the version information of xpu xhpc. If paddle package is non-XPU version, it will return False. + + Examples: + .. code-block:: python + + >>> import paddle + + >>> paddle.version.xpu_xhpc() + >>> # doctest: +SKIP('Different environments yield different output.') + '20231208' + + """ + return xpu_xhpc_version + def cinn(): """Get CINN version of paddle package. @@ -640,6 +672,7 @@ def cinn(): 'cudnn': get_cudnn_version(), 'xpu': get_xpu_version(), 'xpu_xccl': get_xpu_xccl_version(), + 'xpu_xhpc': get_xpu_xhpc_version(), 'commit': commit, 'istaged': is_taged(), 'with_mkl': env_dict.get("WITH_MKL"),