From f12cb756401dca38195503db3203cf043a2a3611 Mon Sep 17 00:00:00 2001 From: zhangchunle Date: Mon, 20 Jun 2022 10:59:42 +0800 Subject: [PATCH] test=windows_ci (#43374) --- tools/windows/run_unittests.sh | 107 ++++++++++++++++++++++++++------- 1 file changed, 86 insertions(+), 21 deletions(-) diff --git a/tools/windows/run_unittests.sh b/tools/windows/run_unittests.sh index bedd44c06d5..a1826220095 100644 --- a/tools/windows/run_unittests.sh +++ b/tools/windows/run_unittests.sh @@ -204,21 +204,10 @@ if [ ${WITH_GPU:-OFF} == "ON" ];then echo "Windows 1 card TestCases count is $num" if [ ${PRECISION_TEST:-OFF} == "ON" ]; then python ${PADDLE_ROOT}/tools/get_pr_ut.py || echo "Failed to obtain ut_list !" - if [[ -f "ut_list" ]]; then - echo "PREC length: "`wc -l ut_list` - precision_cases=`cat ut_list` - if [[ "$precision_cases" != "" ]];then - python ${PADDLE_ROOT}/tools/windows/get_prec_ut_list.py - fi - fi fi - - # sys.argv[1] may exceed max_arg_length when busybox run parallel_UT_rule in windows - output=$(python ${PADDLE_ROOT}/tools/parallel_UT_rule.py) - cpu_parallel_job=$(echo $output | cut -d ";" -f 1) - tetrad_parallel_job=$(echo $output | cut -d ";" -f 2) - two_parallel_job=$(echo $output | cut -d ";" -f 3) - non_parallel_job=$(echo $output | cut -d ";" -f 4) + + python ${PADDLE_ROOT}/tools/group_case_for_parallel.py ${PADDLE_ROOT} + fi failed_test_lists='' @@ -268,7 +257,7 @@ function unittests_retry(){ wintest_error=1 retry_time=3 exec_times=0 - exec_retry_threshold=10 + exec_retry_threshold=30 retry_unittests=$(echo "${failed_test_lists}" | grep -oEi "\-.+\(" | sed 's/(//' | sed 's/- //' ) need_retry_ut_counts=$(echo "$retry_unittests" |awk -F ' ' '{print }'| sed '/^$/d' | wc -l) retry_unittests_regular=$(echo "$retry_unittests" |awk -F ' ' '{print }' | awk 'BEGIN{ all_str=""}{if (all_str==""){all_str=$1}else{all_str=all_str"$|^"$1}} END{print "^"all_str"$"}') @@ -306,7 +295,7 @@ function unittests_retry(){ exec_times=$(echo $exec_times | awk '{print $0+1}') done else - # There are more than 10 failed unit tests, so no unit test retry + # There are more than 30 failed unit tests, so no unit test retry is_retry_execuate=1 fi rm -f $tmp_dir/* @@ -316,7 +305,7 @@ function show_ut_retry_result() { if [[ "$is_retry_execuate" != "0" ]];then failed_test_lists_ult=`echo "${failed_test_lists}"` echo "=========================================" - echo "There are more than 10 failed unit tests, so no unit test retry!!!" + echo "There are more than 30 failed unit tests, so no unit test retry!!!" echo "=========================================" echo "${failed_test_lists_ult}" exit 8; @@ -364,10 +353,86 @@ if nvcc --version | grep 11.2; then fi if [ "${WITH_GPU:-OFF}" == "ON" ];then - run_unittest_gpu $cpu_parallel_job 10 - run_unittest_gpu $tetrad_parallel_job 4 - run_unittest_gpu $two_parallel_job 2 - run_unittest_gpu $non_parallel_job + + single_ut_mem_0_startTime_s=`date +%s` + while read line + do + run_unittest_gpu "$line" 16 + done < $PADDLE_ROOT/tools/single_card_tests_mem0_new + single_ut_mem_0_endTime_s=`date +%s` + single_ut_mem_0_Time_s=`expr $single_ut_mem_0_endTime_s - $single_ut_mem_0_startTime_s` + echo "ipipe_log_param_1_mem_0_TestCases_Total_Time: $single_ut_mem_0_Time_s s" + + single_ut_startTime_s=`date +%s` + while read line + do + num=`echo $line | awk -F"$" '{print NF-1}'` + para_num=`expr $num / 3` + if [ $para_num -eq 0 ]; then + para_num=4 + fi + run_unittest_gpu "$line" $para_num + done < $PADDLE_ROOT/tools/single_card_tests_new + single_ut_endTime_s=`date +%s` + single_ut_Time_s=`expr $single_ut_endTime_s - $single_ut_startTime_s` + echo "ipipe_log_param_1_TestCases_Total_Time: $single_ut_Time_s s" + + multiple_ut_mem_0_startTime_s=`date +%s` + while read line + do + run_unittest_gpu "$line" 10 + done < $PADDLE_ROOT/tools/multiple_card_tests_mem0_new + multiple_ut_mem_0_endTime_s=`date +%s` + multiple_ut_mem_0_Time_s=`expr $multiple_ut_mem_0_endTime_s - $multiple_ut_mem_0_startTime_s` + echo "ipipe_log_param_2_mem0_TestCases_Total_Time: $multiple_ut_mem_0_Time_s s" + + multiple_ut_startTime_s=`date +%s` + while read line + do + num=`echo $line | awk -F"$" '{print NF-1}'` + para_num=`expr $num / 3` + if [ $para_num -eq 0 ]; then + para_num=4 + fi + run_unittest_gpu "$line" $para_num + + done < $PADDLE_ROOT/tools/multiple_card_tests_new + multiple_ut_endTime_s=`date +%s` + multiple_ut_Time_s=`expr $multiple_ut_endTime_s - $multiple_ut_startTime_s` + echo "ipipe_log_param_2_TestCases_Total_Time: $multiple_ut_Time_s s" + + + exclusive_ut_mem_0_startTime_s=`date +%s` + while read line + do + run_unittest_gpu "$line" 10 + done < $PADDLE_ROOT/tools/exclusive_card_tests_mem0_new + exclusive_ut_mem_0_endTime_s=`date +%s` + exclusive_ut_mem_0_Time_s=`expr $exclusive_ut_mem_0_endTime_s - $exclusive_ut_mem_0_startTime_s` + echo "ipipe_log_param_-1_mem0_TestCases_Total_Time: $exclusive_ut_mem_0_Time_s s" + + exclusive_ut_startTime_s=`date +%s` + while read line + do + num=`echo $line | awk -F"$" '{print NF-1}'` + para_num=`expr $num / 3` + if [ $para_num -eq 0 ]; then + para_num=4 + fi + run_unittest_gpu "$line" $para_num + done < $PADDLE_ROOT/tools/exclusive_card_tests_new + exclusive_ut_endTime_s=`date +%s` + exclusive_ut_Time_s=`expr $exclusive_ut_endTime_s - $exclusive_ut_startTime_s` + echo "ipipe_log_param_-1_TestCases_Total_Time: $exclusive_ut_Time_s s" + + noparallel_ut_startTime_s=`date +%s` + while read line + do + run_unittest_gpu "$line" 3 + done < $PADDLE_ROOT/tools/no_parallel_case_file + noparallel_ut_endTime_s=`date +%s` + noparallel_ut_Time_s=`expr $noparallel_ut_endTime_s - $noparallel_ut_startTime_s` + echo "ipipe_log_param_noparallel_TestCases_Total_Time: $noparallel_ut_Time_s s" else run_unittest_cpu fi -- GitLab