Runtime test with mixed backends (#5125)
author이한종/On-Device Lab(SR)/Engineer/삼성전자 <hanjoung.lee@samsung.com>
Fri, 3 May 2019 06:51:34 +0000 (15:51 +0900)
committer오형석/On-Device Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Fri, 3 May 2019 06:51:34 +0000 (15:51 +0900)
* Runtime test with mixed backends

Initial version of runtime test with mixed backends (Fixed backend
assignment)

Signed-off-by: Hanjoung Lee <hanjoung.lee@samsung.com>
* Remove logging

* Fix typo comments and add TODO

scripts/standalone/test_arm_neurun_acl_cl.sh
scripts/standalone/test_arm_neurun_mixed.sh [new file with mode: 0755]

index 6fb9b10..c2beebe 100755 (executable)
@@ -28,4 +28,8 @@ source ./tests/scripts/test_driver.sh \
         --ldlibrarypath="$ROOT_PATH/Product/out/lib" \
         --reportdir="$ROOT_PATH/report/acl_cl" .
 
+# NOTE Temporary call for mixed test
+# TODO Remove this once revising nnfw_ci repo
+./scripts/standalone/test_arm_neurun_mixed.sh
+
 popd > /dev/null
diff --git a/scripts/standalone/test_arm_neurun_mixed.sh b/scripts/standalone/test_arm_neurun_mixed.sh
new file mode 100755 (executable)
index 0000000..8915f11
--- /dev/null
@@ -0,0 +1,43 @@
+#!/bin/bash
+
+[[ "${BASH_SOURCE[0]}" != "${0}" ]] && echo "Please don't source ${BASH_SOURCE[0]}, execute it" && return
+
+CURRENT_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+ROOT_PATH="$CURRENT_PATH/../../"
+
+# Model download server setting
+if [[ -z $MODELFILE_SERVER ]]; then
+  echo "Need model file server setting"
+  exit 1
+fi
+
+set -e
+
+pushd $ROOT_PATH > /dev/null
+
+export EXECUTOR=Linear
+
+# NOTE Fixed backend assignment by type of operation
+# TODO Enhance this with randomized test
+BACKENDS=(cpu acl_cl acl_neon)
+unset OP_BACKEND_ALLOPS
+export OP_BACKEND_Conv2DNode=cpu
+export OP_BACKEND_MaxPool2DNode=acl_cl
+export OP_BACKEND_AvgPool2DNode=acl_neon
+
+# Get the intersect of framework test list files(each backend has a lsit)
+TESTLIST_PREFIX="tests/scripts/neurun_frameworktest_list.armv7l"
+cat $TESTLIST_PREFIX.${BACKENDS[0]}.txt | sort > $TESTLIST_PREFIX.intersect.txt
+for BACKEND in $BACKENDS; do
+    comm -12 <(sort $TESTLIST_PREFIX.intersect.txt) <(sort $TESTLIST_PREFIX.$BACKEND.txt) > $TESTLIST_PREFIX.intersect.next.txt
+    mv $TESTLIST_PREFIX.intersect.next.txt $TESTLIST_PREFIX.intersect.txt
+done
+
+# Run the test
+cp -v ./Product/out/unittest/nnapi_gtest.skip.armv7l-linux ./Product/out/unittest/nnapi_gtest.skip
+source ./tests/scripts/test_driver.sh \
+        --frameworktest_list_file=$TESTLIST_PREFIX.intersect.txt \
+        --ldlibrarypath="$ROOT_PATH/Product/out/lib/neurun:$ROOT_PATH/Product/out/lib" \
+        --reportdir="$ROOT_PATH/report/mixed" .
+
+popd > /dev/null