diff --git a/paddle/scripts/paddle_build.bat b/paddle/scripts/paddle_build.bat index 5d095e99c3d1f4029f87b877b001f8bd41e703ce..07de8ff6c2f7e3e2293435a846e59a9240a187c8 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 6365423d8a36098f0062d4e3c4da649219587b4a..71b5e65214fba8a0b033745cd28dde8ce3ddc109 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)