From 7b1bb874041aa1c1470ddac2c4c91585b69dc343 Mon Sep 17 00:00:00 2001 From: Sing_chan <51314274+betterpig@users.noreply.github.com> Date: Mon, 6 Dec 2021 15:17:52 +0800 Subject: [PATCH] test inference_api_test when run in windows-inference ci (#37710) * test inference_api_test when run in windows-inference ci * test if test failed the code run correctly * put the failed test back --- .../ir/inference/test_trt_pool_op.py | 6 ++-- tools/windows/run_unittests.sh | 34 ++++++++++++++++--- 2 files changed, 32 insertions(+), 8 deletions(-) diff --git a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_pool_op.py b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_pool_op.py index 3d317446f00f3..26ad45db7a18d 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/test_trt_pool_op.py +++ b/python/paddle/fluid/tests/unittests/ir/inference/test_trt_pool_op.py @@ -27,9 +27,9 @@ class TensorRTPoolTest(InferencePassTest): def setUp(self): self.bs = 1 - self.channel = 3 - self.height = 8 - self.width = 8 + self.channel = 2 + self.height = 2 + self.width = 2 self.pool_size = 2 self.pool_type = 'max' self.pool_stride = 1 diff --git a/tools/windows/run_unittests.sh b/tools/windows/run_unittests.sh index a6aac30a37449..4d62a9a88e1f5 100644 --- a/tools/windows/run_unittests.sh +++ b/tools/windows/run_unittests.sh @@ -53,10 +53,6 @@ if [ -f "$PADDLE_ROOT/added_ut" ];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 set -e @@ -107,7 +103,6 @@ disable_win_trt_test="^test_trt_convert_conv2d$|\ ^test_trt_convert_emb_eltwise_layernorm$|\ ^test_trt_convert_pool2d$|\ ^test_trt_conv3d_op$|\ -^test_trt_matmul_quant_dequant$|\ ^test_trt_subgraph_pass$|\ ^test_trt_convert_dropout$|\ ^test_trt_convert_hard_sigmoid$|\ @@ -121,6 +116,16 @@ disable_win_trt_test="^test_trt_convert_conv2d$|\ ^test_trt_convert_matmul$|\ ^test_trt_convert_scale$" +# /*==================Fixed Disabled Windows GPU inference_api_test unittests==============================*/ +disable_win_inference_api_test="^test_analyzer_capi_exp_pd_config$|\ +^trt_quant_int8_yolov3_r50_test$|\ +^test_trt_dynamic_shape_ernie$|\ +^test_trt_dynamic_shape_ernie_fp16_ser_deser$|\ +^lite_resnet50_test$|\ +^test_trt_dynamic_shape_transformer_prune$|\ +^lite_mul_model_test$|\ +^paddle_infer_api_copy_tensor_tester$" + # /*============================================================================*/ # /*==================Fixed Disabled Windows CPU OPENBLAS unittests==============================*/ @@ -180,6 +185,7 @@ long_time_test="^test_gru_op$|\ ^test_transformer$|\ ^test_imperative_auto_mixed_precision$|\ ^test_imperative_optimizer_v2$|\ +^test_trt_matmul_quant_dequant$|\ ^test_strided_slice_op$" if [ ${WITH_GPU:-OFF} == "ON" ];then @@ -331,6 +337,24 @@ function show_ut_retry_result() { set +e export FLAGS_call_stack_level=2 + +if nvcc --version | grep 11.2; then + echo "Only test added_ut and inference_api_test temporarily when running in CI-Windows-inference of CUDA 11.2." + export CUDA_VISIBLE_DEVICES=0 + tmpfile=$tmp_dir/$RANDOM + inference_api_test=^$(ls "paddle/fluid/inference/tests/api" | sed -n 's/\.exe$//pg' | awk BEGIN{RS=EOF}'{gsub(/\n/,"$|^");print}' | sed 's/|\^$//g') + (ctest -R "$inference_api_test" -E "$disable_win_inference_api_test" --output-on-failure -C Release -j 2 | tee $tmpfile ) & + wait; + collect_failed_tests + set -e + rm -f $tmp_dir/* + if [[ "$failed_test_lists" != "" ]]; then + unittests_retry + show_ut_retry_result + fi + exit 0; +fi + if [ "${WITH_GPU:-OFF}" == "ON" ];then run_unittest_gpu $cpu_parallel_job 10 run_unittest_gpu $tetrad_parallel_job 4