From d4699bd6efeaf880a4fee40fa52cb1e93eb896d3 Mon Sep 17 00:00:00 2001 From: Ruibiao Chen Date: Wed, 13 Jul 2022 14:08:13 +0800 Subject: [PATCH] Enable test_tensordot (#42932) * Enable test_tesnsordot * Fix CI errors * Disable windows inference test * Fix typos * Fix typos * Fix CI errors * Remove disable_wingpu11_test --- python/paddle/fluid/tests/unittests/CMakeLists.txt | 4 +--- .../paddle/fluid/tests/unittests/test_tensordot.py | 10 +++++----- tools/windows/run_unittests.sh | 12 ++++-------- 3 files changed, 10 insertions(+), 16 deletions(-) diff --git a/python/paddle/fluid/tests/unittests/CMakeLists.txt b/python/paddle/fluid/tests/unittests/CMakeLists.txt index 606f39c5e3..28bd796efd 100755 --- a/python/paddle/fluid/tests/unittests/CMakeLists.txt +++ b/python/paddle/fluid/tests/unittests/CMakeLists.txt @@ -205,8 +205,6 @@ endif() # Temporally disable test_deprecated_decorator list(REMOVE_ITEM TEST_OPS test_deprecated_decorator) -list(REMOVE_ITEM TEST_OPS test_tensordot) - if(WIN32) list(REMOVE_ITEM TEST_OPS test_multiprocess_reader_exception) list(REMOVE_ITEM TEST_OPS test_trainer_desc) @@ -1419,7 +1417,7 @@ set_tests_properties(test_index_select_op PROPERTIES TIMEOUT 120) set_tests_properties(test_parallel_ssa_graph_inference_feed_partial_data PROPERTIES TIMEOUT 120) set_tests_properties(test_parallel_executor_crf PROPERTIES TIMEOUT 120) -#set_tests_properties(test_tensordot PROPERTIES TIMEOUT 200) +set_tests_properties(test_tensordot PROPERTIES TIMEOUT 200) set_tests_properties(test_imperative_save_load PROPERTIES TIMEOUT 120) set_tests_properties(test_partial_eager_deletion_transformer PROPERTIES TIMEOUT 120) diff --git a/python/paddle/fluid/tests/unittests/test_tensordot.py b/python/paddle/fluid/tests/unittests/test_tensordot.py index e5d563455e..bcba40090b 100644 --- a/python/paddle/fluid/tests/unittests/test_tensordot.py +++ b/python/paddle/fluid/tests/unittests/test_tensordot.py @@ -185,35 +185,35 @@ class TestTensordotAPIFloat64(TestTensordotAPI): self.dtype = np.float64 -class TestTensordotAPIBroadcastCase1(TestTensordotAPI): +class TestTensordotAPIBroadcastCase1(TestTensordotAPIFloat64): def set_input_shape(self): self.x_shape = [1, 1, 1, 5] self.y_shape = [1, 5, 1, 1] -class TestTensordotAPIBroadcastCase2(TestTensordotAPI): +class TestTensordotAPIBroadcastCase2(TestTensordotAPIFloat64): def set_input_shape(self): self.x_shape = [1, 5, 5, 5] self.y_shape = [1, 1, 1, 5] -class TestTensordotAPIBroadcastCase3(TestTensordotAPI): +class TestTensordotAPIBroadcastCase3(TestTensordotAPIFloat64): def set_input_shape(self): self.x_shape = [5, 5, 5, 1] self.y_shape = [5, 5, 1, 5] -class TestTensordotAPIBroadcastCase4(TestTensordotAPI): +class TestTensordotAPIBroadcastCase4(TestTensordotAPIFloat64): def set_input_shape(self): self.x_shape = [5, 5, 5, 1] self.y_shape = [1, 1, 1, 1] -class TestTensordotAPIBroadcastCase5(TestTensordotAPI): +class TestTensordotAPIBroadcastCase5(TestTensordotAPIFloat64): def set_input_shape(self): self.x_shape = [1, 1, 5, 5] diff --git a/tools/windows/run_unittests.sh b/tools/windows/run_unittests.sh index 7af1cd8139..34c3d4156a 100644 --- a/tools/windows/run_unittests.sh +++ b/tools/windows/run_unittests.sh @@ -72,12 +72,6 @@ disable_win_trt_test="^test_trt_convert_conv2d$|\ ^test_trt_convert_matmul$|\ ^test_trt_convert_scale$" -# /*=============Fixed Disabled Windows CUDA11.x MKL(PR-CI-Windows-Inference) unittests=================*/ -# TODO: fix these unittest that is bound to fail -disable_wingpu11_test="^test_autograd_functional_dynamic$|\ -^disable_wingpu_test$" - - # /*==========Fixed Disabled Windows CUDA11.x inference_api_test(PR-CI-Windows-Inference) unittests=============*/ disable_win_inference_test="^trt_quant_int8_yolov3_r50_test$|\ ^test_trt_dynamic_shape_ernie$|\ @@ -183,7 +177,9 @@ disable_win_inference_test="^trt_quant_int8_yolov3_r50_test$|\ ^test_unsqueeze2_eltwise_fuse_pass$|\ ^test_parallel_executor_seresnext_with_fuse_all_reduce_gpu$|\ ^test_parallel_executor_seresnext_with_reduce_gpu$|\ -^test_api_impl$" +^test_api_impl$|\ +^test_tensordot$|\ +^disable_wingpu_test$" # /*==========Fixed Disabled Windows CPU OPENBLAS((PR-CI-Windows-OPENBLAS)) unittests==============================*/ @@ -281,7 +277,7 @@ bash $PADDLE_ROOT/tools/check_added_ut_win.sh rm -rf $PADDLE_ROOT/tools/check_added_ut_win.sh if [ -f "$PADDLE_ROOT/added_ut" ];then added_uts=^$(awk BEGIN{RS=EOF}'{gsub(/\n/,"$|^");print}' $PADDLE_ROOT/added_ut)$ - ctest -R "(${added_uts})" -E "$disable_wingpu11_test" --output-on-failure -C Release --repeat-until-fail 3;added_ut_error=$? + ctest -R "(${added_uts})" -E "${disable_win_inference_test}" --output-on-failure -C Release --repeat-until-fail 3;added_ut_error=$? rm -f $PADDLE_ROOT/added_ut if [ "$added_ut_error" != 0 ];then echo "========================================" -- GitLab