From 91cdd29539ceadb2a2772c7bf2c9905619f47fd5 Mon Sep 17 00:00:00 2001 From: risemeup1 <62429225+risemeup1@users.noreply.github.com> Date: Sun, 25 Dec 2022 16:11:17 +0800 Subject: [PATCH] support cinn ci (#48931) * support cinn ci * modify .whl dir * support CINN * support cinn * support kunlun200 and kunlun200test * support cinn * fix tests in kunlun200 * fix bug that can't find libxpu.so.1 * test --- paddle/scripts/paddle_build.sh | 8 ++++++-- setup.py | 15 +++++---------- 2 files changed, 11 insertions(+), 12 deletions(-) mode change 100755 => 100644 paddle/scripts/paddle_build.sh diff --git a/paddle/scripts/paddle_build.sh b/paddle/scripts/paddle_build.sh old mode 100755 new mode 100644 index e54039c85f0..73e38514296 --- a/paddle/scripts/paddle_build.sh +++ b/paddle/scripts/paddle_build.sh @@ -2871,9 +2871,12 @@ function parallel_test() { mkdir -p ${PADDLE_ROOT}/build cd ${PADDLE_ROOT}/build pip install hypothesis - if [ -d "${PADDLE_ROOT}/build/python/dist/" ]; then + if ls ${PADDLE_ROOT}/build/python/dist/*whl >/dev/null 2>&1; then pip install ${PADDLE_ROOT}/build/python/dist/*whl fi + if ls ${PADDLE_ROOT}/dist/*whl >/dev/null 2>&1; then + pip install ${PADDLE_ROOT}/dist/*whl + fi cp ${PADDLE_ROOT}/build/python/paddle/fluid/tests/unittests/testsuite.py ${PADDLE_ROOT}/build/python cp -r ${PADDLE_ROOT}/build/python/paddle/fluid/tests/unittests/white_list ${PADDLE_ROOT}/build/python ut_total_startTime_s=`date +%s` @@ -3465,6 +3468,7 @@ function check_coverage_build() { set -x } function run_setup(){ + rm -rf ${PADDLE_ROOT}/build # Build script will not fail if *.deb does not exist rm *.deb 2>/dev/null || true @@ -3666,7 +3670,7 @@ function main() { init case $CMD in build_only) - cmake_gen_and_build ${PYTHON_ABI:-""} ${parallel_number} + run_setup ${PYTHON_ABI:-""} bdist_wheel ;; build_pr_dev) build_pr_and_develop diff --git a/setup.py b/setup.py index 3c7e5464a81..e2e1e9dc2d2 100644 --- a/setup.py +++ b/setup.py @@ -857,13 +857,8 @@ def get_package_data_and_package_dir(): + '/cinn/runtime/cuda/cinn_cuda_runtime_source.cuh', libs_path, ) - shutil.copy( - env_dict.get("CINN_INCLUDE_DIR") + '/cinn/runtime/cuda/float16.h', - libs_path, - ) package_data['paddle.libs'] += ['libcinnapi.so'] package_data['paddle.libs'] += ['cinn_cuda_runtime_source.cuh'] - package_data['paddle.libs'] += ['float16.h'] if env_dict.get("CMAKE_BUILD_TYPE") == 'Release' and os.name != 'nt': command = ( "patchelf --set-rpath '$ORIGIN/' %s/" % libs_path @@ -948,11 +943,11 @@ def get_package_data_and_package_dir(): "command: %s" % command, ) shutil.copy(env_dict.get("XPU_API_LIB"), libs_path) - shutil.copy(env_dict.get("XPU_RT_LIB"), libs_path) - package_data['paddle.libs'] += [ - env_dict.get("XPU_API_LIB_NAME"), - env_dict.get("XPU_RT_LIB_NAME"), - ] + package_data['paddle.libs'] += [env_dict.get("XPU_API_LIB_NAME")] + xpu_rt_lib_list = glob.glob(env_dict.get("XPU_RT_LIB") + '*') + for xpu_rt_lib_file in xpu_rt_lib_list: + shutil.copy(xpu_rt_lib_file, libs_path) + package_data['paddle.libs'] += [os.path.basename(xpu_rt_lib_file)] if env_dict.get("WITH_XPU_BKCL") == 'ON': shutil.copy(env_dict.get("XPU_BKCL_LIB"), libs_path) -- GitLab