From: 이상규/동작제어Lab(SR)/Principal Engineer/삼성전자 Date: Wed, 31 Oct 2018 05:50:48 +0000 (+0900) Subject: Run benchmark for all tflite model under tests/framework (#3402) X-Git-Tag: 0.3~496 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c3b68296401e04814ea991bea2201b380db33193;p=platform%2Fcore%2Fml%2Fnnfw.git Run benchmark for all tflite model under tests/framework (#3402) 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 --- diff --git a/tools/test_driver/benchmark_op_list.txt b/tools/test_driver/benchmark_op_list.txt deleted file mode 100644 index 166ddb7..0000000 --- a/tools/test_driver/benchmark_op_list.txt +++ /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 diff --git a/tools/test_driver/run_benchmark_op.sh b/tools/test_driver/run_benchmark_op.sh index c08e93b..54c4a9c 100755 --- a/tools/test_driver/run_benchmark_op.sh +++ b/tools/test_driver/run_benchmark_op.sh @@ -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 diff --git a/tools/test_driver/test_driver.sh b/tools/test_driver/test_driver.sh index 72be65d..077d126 100755 --- a/tools/test_driver/test_driver.sh +++ b/tools/test_driver/test_driver.sh @@ -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