# Copyright (c) 2025 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. source $(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/utils.sh init function get_multi_card_ut_list_for_xpu() { input_file="${PADDLE_ROOT}/tools/xpu/multi_card_ut_xpu_kl3.local" if [ ! -f "$input_file" ]; then echo "input file not exist: $input_file" exit 102 fi multi_card_ut_list_for_xpu=$(sed 's/^/^/; s/$/$/' "$input_file" | paste -sd'|' -) echo "=========================================" echo "The following unittests are for xpu multi card:" echo ${multi_card_ut_list_for_xpu} echo "=========================================" } function parallel_test_base_xpu() { mkdir -p ${PADDLE_ROOT}/build cd ${PADDLE_ROOT}/build if [ ${WITH_TESTING:-ON} == "ON" ] ; then cat </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 echo "::endgroup" cp ${PADDLE_ROOT}/build/test/legacy_test/testsuite.py ${PADDLE_ROOT}/build/python cp -r ${PADDLE_ROOT}/build/test/white_list ${PADDLE_ROOT}/build/python ut_total_startTime_s=`date +%s` parallel_test_base_xpu ut_total_endTime_s=`date +%s` echo "TestCases Total Time: $[ $ut_total_endTime_s - $ut_total_startTime_s ]s" echo "ipipe_log_param_TestCases_Total_Time: $[ $ut_total_endTime_s - $ut_total_startTime_s ]s" >> ${PADDLE_ROOT}/build/build_summary.txt if [[ -f ${PADDLE_ROOT}/build/build_summary.txt ]];then echo "=====================build summary======================" cat ${PADDLE_ROOT}/build/build_summary.txt echo "========================================================" fi