未验证 提交 3dbabc4d 编写于 作者: S Sing_chan 提交者: GitHub

modify for wincheck-inference case (#37292)

* for pure fp16

* opt topk

* modify for wincheck-inference case

* modify according to zhouwei's comment

* modify according to zhouwei's comment 2nd time
Co-authored-by: Nzhangkaihuo <zhangkaihuo@baidu.com>
上级 11b17c88
......@@ -256,11 +256,14 @@ set WITH_GPU=ON
set WITH_AVX=ON
set MSVC_STATIC_CRT=ON
set ON_INFER=ON
set WITH_TESTING=ON
set WITH_TENSORRT=ON
set WITH_INFERENCE_API_TEST=ON
call :cmake || goto cmake_error
call :build || goto build_error
call :test_whl_pacakage || goto test_whl_pacakage_error
:: call :test_unit || goto test_unit_error
call :test_unit || goto test_unit_error
::call :test_inference || goto test_inference_error
:: call :check_change_of_unittest || goto check_change_of_unittest_error
goto:success
......
......@@ -1227,8 +1227,8 @@ set +x
is_nightly='' # indicate whether the case will only run at night
get_quickly_disable_ut||disable_ut_quickly='' # indicate whether the case was in quickly disable list
UT_list=$(ctest -N | awk -F ': ' '{print $2}' | sed '/^$/d' | sed '$d')
output=$(python ${PADDLE_ROOT}/tools/parallel_UT_rule.py "${UT_list}")
ctest -N | awk -F ': ' '{print $2}' | sed '/^$/d' | sed '$d' > all_ut_list
output=$(python ${PADDLE_ROOT}/tools/parallel_UT_rule.py)
high_parallel_job=$(echo $output | cut -d ";" -f 1)
secondary_high_parallel_job=$(echo $output | cut -d ";" -f 2)
third_high_parallel_job=$(echo $output | cut -d ";" -f 3)
......
......@@ -2205,7 +2205,12 @@ def main():
lowest_high_parallel_job = '^job$'
non_parallel_job = '^job$'
test_cases = sys.argv[1]
# sys.argv[1] may exceed max_arg_length when busybox run parallel_UT_rule in windows
BUILD_DIR = os.getcwd()
file_path = os.path.join(BUILD_DIR, 'all_ut_list')
with open(file_path, 'r') as f:
test_cases = f.read()
test_cases = test_cases.split("\n")
if platform.system() == 'Windows':
......
......@@ -14,6 +14,8 @@
"""To get a list of prec ut """
import sys
import os
import platform
def get_prec_ut_list(all_test_cases, prec_test_cases):
......@@ -24,7 +26,7 @@ def get_prec_ut_list(all_test_cases, prec_test_cases):
prec_test_cases_list_new = [item.rstrip() for item in prec_test_cases_list]
if len(prec_test_cases) == 0:
return "\n".join(all_test_cases_list)
return
case_to_run = ['test_prec_ut']
for case in all_test_cases_list_new:
......@@ -32,14 +34,20 @@ def get_prec_ut_list(all_test_cases, prec_test_cases):
case_to_run.append(case)
else:
print("{} will not run in PRECISION_TEST mode.".format(case))
for case in case_to_run:
print(case)
with open(file_path, 'w') as f:
f.write('\n'.join(case_to_run))
if __name__ == '__main__':
# get prec cases lists
with open('ut_list', 'r') as f:
prec_test_cases = f.read()
all_test_cases = sys.argv[1]
# sys.argv[1] may exceed max_arg_length when busybox run parallel_UT_rule in windows
BUILD_DIR = os.getcwd()
file_path = os.path.join(BUILD_DIR, 'all_ut_list')
with open(file_path, 'r') as f:
all_test_cases = f.read()
#prec_test_cases = sys.argv[2]
get_prec_ut_list(all_test_cases, prec_test_cases)
......@@ -157,7 +157,7 @@ long_time_test="^test_gru_op$|\
if [ ${WITH_GPU:-OFF} == "ON" ];then
export CUDA_VISIBLE_DEVICES=0
UT_list=$(ctest -N | awk -F ': ' '{print $2}' | sed '/^$/d' | sed '$d')
ctest -N | awk -F ': ' '{print $2}' | sed '/^$/d' | sed '$d' > all_ut_list
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
......@@ -165,19 +165,14 @@ if [ ${WITH_GPU:-OFF} == "ON" ];then
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
set +e
if [ ${PRECISION_TEST:-OFF} == "ON" ] && [[ "$precision_cases" != "" ]];then
UT_list_res=$(python ${PADDLE_ROOT}/tools/windows/get_prec_ut_list.py "$UT_list" )
UT_list_prec=$(echo "${UT_list_res}" | grep -v 'PRECISION_TEST')
echo "${UT_list_res}" | grep 'PRECISION_TEST'
UT_list=$UT_list_prec
fi
set -e
output=$(python ${PADDLE_ROOT}/tools/parallel_UT_rule.py "${UT_list}")
# 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)
......@@ -319,6 +314,10 @@ if [ "${WITH_GPU:-OFF}" == "ON" ];then
echo "========================================"
exit 8;
fi
if nvcc --version | grep 11.2; then
echo "Only test added_ut temporarily when running in CI-Windows-inference of CUDA 11.2."
exit 0;
fi
fi
run_unittest_gpu $cpu_parallel_job 10
run_unittest_gpu $tetrad_parallel_job 4
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册