From 7d91974c91b427d12e40a644518993a22dc0b1a3 Mon Sep 17 00:00:00 2001 From: Wilber Date: Thu, 25 Feb 2021 21:03:12 +0800 Subject: [PATCH] enable lite ut. (#30890) --- cmake/third_party.cmake | 1 + paddle/fluid/inference/tests/api/CMakeLists.txt | 16 +++++++--------- .../inference/tests/api/lite_resnet50_test.cc | 1 + paddle/fluid/operators/lite/CMakeLists.txt | 3 +-- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/cmake/third_party.cmake b/cmake/third_party.cmake index d576a299b86..44ebf4e89b7 100644 --- a/cmake/third_party.cmake +++ b/cmake/third_party.cmake @@ -311,6 +311,7 @@ if(WITH_DGC) endif() if (WITH_LITE) + message(STATUS "Compile Paddle with Lite Engine.") include(external/lite) endif (WITH_LITE) diff --git a/paddle/fluid/inference/tests/api/CMakeLists.txt b/paddle/fluid/inference/tests/api/CMakeLists.txt index bb8faf30fdd..92f9c20a369 100644 --- a/paddle/fluid/inference/tests/api/CMakeLists.txt +++ b/paddle/fluid/inference/tests/api/CMakeLists.txt @@ -599,13 +599,12 @@ endif() set(LITE_MODEL_INSTALL_DIR "${INFERENCE_DEMO_INSTALL_DIR}/lite") download_data(${LITE_MODEL_INSTALL_DIR} "mul_model_fp32.tgz") -#TODO(wilber): tmp disable ut. -#inference_analysis_test(lite_mul_model_test SRCS lite_mul_model_test.cc -# EXTRA_DEPS ${INFERENCE_EXTRA_DEPS} -# ARGS --infer_model=${LITE_MODEL_INSTALL_DIR}) -#inference_analysis_test(lite_resnet50_test SRCS lite_resnet50_test.cc -# EXTRA_DEPS ${INFERENCE_EXTRA_DEPS} -# ARGS --infer_model=${RESNET50_MODEL_DIR}) +inference_analysis_test(lite_mul_model_test SRCS lite_mul_model_test.cc + EXTRA_DEPS ${INFERENCE_EXTRA_DEPS} + ARGS --infer_model=${LITE_MODEL_INSTALL_DIR}) +inference_analysis_test(lite_resnet50_test SRCS lite_resnet50_test.cc + EXTRA_DEPS ${INFERENCE_EXTRA_DEPS} + ARGS --infer_model=${RESNET50_MODEL_DIR}) inference_analysis_test(test_analyzer_capi SRCS analyzer_capi_tester.cc EXTRA_DEPS ${INFERENCE_EXTRA_DEPS} paddle_inference_c @@ -657,8 +656,7 @@ if(WITH_MKLDNN) set_tests_properties(test_analyzer_int8_mobilenetv1 PROPERTIES TIMEOUT 120) endif() -#TODO(wilber): tmp disable ut -#set_tests_properties(lite_resnet50_test PROPERTIES TIMEOUT 120) +set_tests_properties(lite_resnet50_test PROPERTIES TIMEOUT 120) set_tests_properties(test_analyzer_mobilenet_transpose PROPERTIES TIMEOUT 120) set_tests_properties(test_analyzer_resnet50 PROPERTIES TIMEOUT 120) set_tests_properties(test_analyzer_ner PROPERTIES TIMEOUT 120) diff --git a/paddle/fluid/inference/tests/api/lite_resnet50_test.cc b/paddle/fluid/inference/tests/api/lite_resnet50_test.cc index 99c2c2f6f3d..59bbaa2b78f 100644 --- a/paddle/fluid/inference/tests/api/lite_resnet50_test.cc +++ b/paddle/fluid/inference/tests/api/lite_resnet50_test.cc @@ -81,6 +81,7 @@ TEST(Predictor, use_gpu) { config.EnableLiteEngine(PrecisionType::kFloat32); auto predictor = CreatePredictor(config); + const int batch = 1; const int channel = 3; const int height = 318; diff --git a/paddle/fluid/operators/lite/CMakeLists.txt b/paddle/fluid/operators/lite/CMakeLists.txt index 96ccdd1f179..5bb78925908 100644 --- a/paddle/fluid/operators/lite/CMakeLists.txt +++ b/paddle/fluid/operators/lite/CMakeLists.txt @@ -1,3 +1,2 @@ op_library(lite_engine_op DEPS lite_engine lite_tensor_utils) -# TODO(wilber): fix the ut. -#cc_test(test_lite_engine_op SRCS lite_engine_op_test.cc DEPS lite_engine_op analysis) +cc_test(test_lite_engine_op SRCS lite_engine_op_test.cc DEPS lite_engine_op analysis) -- GitLab