From 390cebee1517de3d58ccccbd9fce2775b839e505 Mon Sep 17 00:00:00 2001 From: YUNSHEN XIE <1084314248@qq.com> Date: Tue, 9 Mar 2021 19:22:30 +0800 Subject: [PATCH] Prec on windows exclude check_added_ut (#31372) * add precision test for windows ci exclude check_added_ut * fix error * added PRECISION_TEST parameters * fix format error --- paddle/scripts/paddle_build.bat | 2 +- tools/windows/run_unittests.sh | 31 ++++++++++++++++++++++++++++++- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/paddle/scripts/paddle_build.bat b/paddle/scripts/paddle_build.bat index 5d095e99c3..07de8ff6c2 100644 --- a/paddle/scripts/paddle_build.bat +++ b/paddle/scripts/paddle_build.bat @@ -493,7 +493,7 @@ setlocal enabledelayedexpansion :: for /F %%# in ('cmd /C nvidia-smi -L ^|find "GPU" /C') do set CUDA_DEVICE_COUNT=%%# set CUDA_DEVICE_COUNT=1 -%cache_dir%\tools\busybox64.exe bash %work_dir%\tools\windows\run_unittests.sh %NIGHTLY_MODE% +%cache_dir%\tools\busybox64.exe bash %work_dir%\tools\windows\run_unittests.sh %NIGHTLY_MODE% %PRECISION_TEST% goto:eof diff --git a/tools/windows/run_unittests.sh b/tools/windows/run_unittests.sh index 6365423d8a..71b5e65214 100644 --- a/tools/windows/run_unittests.sh +++ b/tools/windows/run_unittests.sh @@ -15,8 +15,9 @@ set -e set +x NIGHTLY_MODE=$1 +PRECISION_TEST=$2 -PADDLE_ROOT="$(cd "$PWD/../" && pwd )" +export PADDLE_ROOT="$(cd "$PWD/../" && pwd )" if [ ${NIGHTLY_MODE:-OFF} == "ON" ]; then nightly_label="" else @@ -210,6 +211,34 @@ export CUDA_VISIBLE_DEVICES=0 UT_list=$(ctest -N | awk -F ': ' '{print $2}' | sed '/^$/d' | sed '$d') num=$(ctest -N | awk -F ': ' '{print $2}' | sed '/^$/d' | sed '$d' | wc -l) echo "Windows 1 card TestCases count is $num" +if [ ${PRECISION_TEST:-OFF} == "ON" ]; then + python ${PADDLE_ROOT}/tools/get_pr_ut.py + if [[ -f "ut_list" ]]; then + set +x + echo "PREC length: "`wc -l ut_list` + precision_cases=`cat ut_list` + set -x + fi +fi + +if [ ${PRECISION_TEST:-OFF} == "ON" ] && [[ "$precision_cases" != "" ]];then + UT_list_prec='' + re=$(cat ut_list|awk -F ' ' '{print }' | awk 'BEGIN{ all_str=""}{if (all_str==""){all_str=$1}else{all_str=all_str"$|^"$1}} END{print "^"all_str"$"}') + for case in $UT_list; do + flag=$(echo $case|grep -oE $re) + if [ -n "$flag" ];then + if [ -z "$UT_list_prec" ];then + UT_list_prec=$case + else + UT_list_prec=$UT_list_prec'\n'$case + fi + else + echo $case "won't run in PRECISION_TEST mode." + fi + done + UT_list=$UT_list_prec +fi + output=$(python ${PADDLE_ROOT}/tools/parallel_UT_rule.py "${UT_list}") eight_parallel_job=$(echo $output | cut -d ";" -f 1) tetrad_parallel_jog=$(echo $output | cut -d ";" -f 2) -- GitLab