Run benchmark for all tflite model under tests/framework (#3402)
author이상규/동작제어Lab(SR)/Principal Engineer/삼성전자 <sg5.lee@samsung.com>
Wed, 31 Oct 2018 05:50:48 +0000 (14:50 +0900)
committer오형석/동작제어Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Wed, 31 Oct 2018 05:50:48 +0000 (14:50 +0900)
Related: #3397 #3264

Previously, run_benchmark_op.sh runs the tests in `benchmark_op_models.txt`.
- No one maintains the list.
- It contains only a few tests.
- If the location or folder name is changed, the list should be updated.

Now, run_benchmark_op.sh runs all tests under `tests/frameworks`.
- No one need to update whenever a new model is added/removed, location is changed....

This PR also removes

- option  `--frameworktest_list_file` option from `run_benchmark_op.sh`.
- benchmark_op_list.txt

Signed-off-by: Sanggyu Lee <sg5.lee@samsung.com>
tools/test_driver/benchmark_op_list.txt [deleted file]
tools/test_driver/run_benchmark_op.sh
tools/test_driver/test_driver.sh

diff --git a/tools/test_driver/benchmark_op_list.txt b/tools/test_driver/benchmark_op_list.txt
deleted file mode 100644 (file)
index 166ddb7..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-add/4D
-average_pool_2d/avgpool1
-average_pool_2d/avgpool1
-concat/concat1
-conv_2d/convolution1
-conv_2d/convolution2
-div/broadcast
-max_pool_2d/maxpool1
-max_pool_2d/maxpool2
-resize_bilinear
-softmax
index c08e93b..54c4a9c 100755 (executable)
@@ -58,9 +58,6 @@ do
             MODEL_CACHE_ROOT_PATH=$TEST_LIST_PATH/cache
             MODEL_TEST_ROOT_PATH=$TEST_LIST_PATH/tests
             ;;
-        --frameworktest_list_file=*)
-            FRAMEWORKTEST_LIST_FILE=${i#*=}
-            ;;
     esac
     shift
 done
@@ -95,12 +92,25 @@ function print_result_of_benchmark_test()
 
 function get_benchmark_op_list()
 {
-    if [ ! -z "$FRAMEWORKTEST_LIST_FILE" ]; then
-        BENCHMARK_MODEL_LIST=$(cat "${FRAMEWORKTEST_LIST_FILE}")
-    else
-        BENCHMARK_MODEL_LIST=$(cat "${PURE_ACL_RT_ENV_FILE}")
+    local TEST_DIRS="$@"
+    local TESTS_TO_RUN=""
+
+    if [[ $# -eq 0 ]]; then
+        TEST_DIRS="."
     fi
-    echo "BENCHMARK_MODEL_LIST=> $BENCHMARK_MODEL_LIST"  
+
+    shift $#
+
+    pushd $MODEL_TEST_ROOT_PATH > /dev/null
+    for DIR in $TEST_DIRS; do
+        if [ -d "$DIR" ]; then
+            TESTS_FOUND=$(find "$DIR" -type f -name 'config.sh' -exec dirname {} \;| sed 's|^./||' | sort)
+            TESTS_TO_RUN="$TESTS_TO_RUN $TESTS_FOUND"
+        fi
+    done
+    popd > /dev/null
+
+    BENCHMARK_MODEL_LIST=$(echo "${TESTS_TO_RUN}")
 }
 
 function run_benchmark_test()
@@ -118,13 +128,6 @@ function run_benchmark_test()
         STATUS="enabled"
         source $MODEL_TEST_ROOT_PATH/$MODEL/config.sh
 
-        LOWER_STATUS="$(echo $STATUS | awk '{print tolower($0)}')"
-        if [ "$LOWER_STATUS" == "disabled" ]; then
-            echo ""
-            echo "Skip $MODEL"
-            continue
-        fi
-
         echo "Benchmark test with `basename $DRIVER_BIN` & `echo $MODEL`"
         echo $MODEL >> $BENCHMARK_MODELS_FILE
 
index 72be65d..077d126 100755 (executable)
@@ -282,8 +282,7 @@ if [ "$BENCHMARK_OP_ON" == "true" ]; then
         --runtestsh=$RUN_TEST_SH \
         --driverbin=$DRIVER_BIN \
         --reportdir=$REPORT_DIR/benchmark_op \
-        --modelfilepath=$ARTIFACT_PATH/tests/framework \
-        --frameworktest_list_file=${FRAMEWORKTEST_LIST_FILE:-}
+        --modelfilepath=$ARTIFACT_PATH/tests/framework
 fi
 
 # Run benchmark/acl/benchmark_googlenet, mobilenet and inception_v3