forked from Samsung/ONE
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_ubuntu_runtime_mixed.sh
executable file
·63 lines (53 loc) · 2.4 KB
/
test_ubuntu_runtime_mixed.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/bash
set -eo pipefail
source "$(dirname "${BASH_SOURCE[0]}")/common.sh"
CheckTestPrepared
# TODO Get argument for mix configuration
: ${TEST_ARCH:=$(uname -m | tr '[:upper:]' '[:lower:]')}
TEST_OS="linux"
# nnfw_api_gtest
# NOTE: This test is run here as it does not depend on BACKEND or EXECUTOR
# This test requires test model installation
pushd ${ROOT_PATH} > /dev/null
echo ""
echo "==== Run standalone unittest begin ===="
echo ""
Product/out/test/onert-test unittest --unittestdir=Product/out/unittest_standalone
echo ""
echo "==== Run standalone unittest end ===="
echo ""
# Test custom op
pushd ${ROOT_PATH} > /dev/null
./Product/out/test/FillFrom_runner
popd > /dev/null
# NOTE Fixed backend assignment by type of operation
# TODO Enhance this with randomized test
BACKENDS=(acl_cl acl_neon cpu)
# Get the intersect of framework test list files
TESTLIST_PREFIX="Product/out/test/list/tflite_comparator.${TEST_ARCH}"
SKIPLIST_PREFIX="Product/out/unittest/nnapi_gtest.skip.${TEST_ARCH}-${TEST_OS}"
sort $TESTLIST_PREFIX.${BACKENDS[0]}.list > $TESTLIST_PREFIX.intersect.list
sort $SKIPLIST_PREFIX.${BACKENDS[0]} > $SKIPLIST_PREFIX.union
for BACKEND in "${BACKENDS[@]:1}"; do
comm -12 <(sort $TESTLIST_PREFIX.intersect.list) <(sort $TESTLIST_PREFIX.$BACKEND.list) > $TESTLIST_PREFIX.intersect.next.list
comm <(sort $SKIPLIST_PREFIX.union) <(sort $SKIPLIST_PREFIX.$BACKEND) | tr -d "[:blank:]" > $SKIPLIST_PREFIX.union.next
mv $TESTLIST_PREFIX.intersect.next.list $TESTLIST_PREFIX.intersect.list
mv $SKIPLIST_PREFIX.union.next $SKIPLIST_PREFIX.union
done
popd > /dev/null
# Fail on NCHW layout (acl_cl, acl_neon)
# TODO Fix bug
echo "GeneratedTests.*weights_as_inputs*" >> $SKIPLIST_PREFIX.union
echo "GeneratedTests.logical_or_broadcast_4D_2D_nnfw" >> $SKIPLIST_PREFIX.union
echo "GeneratedTests.mean" >> $SKIPLIST_PREFIX.union
echo "GeneratedTests.add_broadcast_4D_2D_after_nops_float_nnfw" >> $SKIPLIST_PREFIX.union
echo "GeneratedTests.argmax_*" >> $SKIPLIST_PREFIX.union
echo "GeneratedTests.squeeze_relaxed" >> $SKIPLIST_PREFIX.union
# Run the test
export OP_BACKEND_Conv2D="cpu"
export OP_BACKEND_Pool2D="acl_cl"
export OP_BACKEND_FullyConnected="acl_neon"
export ACL_LAYOUT="NCHW"
export RUY_THREADS=4
NNAPIGTest "acl_cl;acl_neon;cpu" "Product/out/unittest/nnapi_gtest.skip.${TEST_ARCH}-${TEST_OS}.union" "report/mixed"
TFLiteModelVerification "acl_cl;acl_neon;cpu" "${TESTLIST_PREFIX}.intersect.list" "report/mixed"