Skip to content

Commit

Permalink
Prec on windows exclude check_added_ut (#31372)
Browse files Browse the repository at this point in the history
* add precision test for windows ci exclude check_added_ut

* fix error

* added PRECISION_TEST parameters

* fix format error
  • Loading branch information
XieYunshen authored Mar 9, 2021
1 parent 634a12b commit 390cebe
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
2 changes: 1 addition & 1 deletion paddle/scripts/paddle_build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
31 changes: 30 additions & 1 deletion tools/windows/run_unittests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 390cebe

Please sign in to comment.