aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--automated/linux/ml-bench/tvm-bench.sh41
-rw-r--r--automated/linux/ml-bench/tvm-bench.yaml23
2 files changed, 64 insertions, 0 deletions
diff --git a/automated/linux/ml-bench/tvm-bench.sh b/automated/linux/ml-bench/tvm-bench.sh
new file mode 100644
index 0000000..c63228f
--- /dev/null
+++ b/automated/linux/ml-bench/tvm-bench.sh
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+# shellcheck disable=SC1091
+
+. ../../lib/sh-test-lib
+OUTPUT="$(pwd)/output"
+
+usage() {
+ echo "Usage: $0 [-s <true|false>]" 1>&2
+ exit 1
+}
+
+#default values
+TVM_WHEEL='https://github.com/tlc-pack/tlcpack/releases/download/v0.7.dev1/tlcpack-0.7.dev1-cp38-cp38-manylinux2010_x86_64.whl'
+TVM_BENCH='https://github.com/tom-gall/tvm-bench.git'
+SKIP_INSTALL=false
+
+while getopts "s:a:t:" o; do
+ case "$o" in
+ a) TVM_WHEEL="${OPTARG}" ;;
+ t) TVM_BENCH="${OPTARG}" ;;
+ s) SKIP_INSTALL="{$OPTARG}" ;;
+ *) usage ;;
+ esac
+done
+# f) TF_BENCH="${OPTARG}" ;;
+# d) TVM_INSTALL="${OPTARG}" ;;
+! check_root && error_msg "You need to be root to run this script."
+create_out_dir "${OUTPUT}"
+
+pkgs="wget ntp python3 python3-pip git"
+install_deps "${pkgs}" "${SKIP_INSTALL}"
+if [ -n "${TVM_BENCH}" ]; then
+ git clone "${TVM_BENCH}"
+ if [ -n "${TVM_WHEEL}" ]; then
+ wget "${TVM_WHEEL}"
+ pip3 install "tlcpack*.whl"
+ fi
+ cd tvm-bench || exit
+ python3 mobilenet-v1.0.5-acl-float.py
+fi
diff --git a/automated/linux/ml-bench/tvm-bench.yaml b/automated/linux/ml-bench/tvm-bench.yaml
new file mode 100644
index 0000000..17cd023
--- /dev/null
+++ b/automated/linux/ml-bench/tvm-bench.yaml
@@ -0,0 +1,23 @@
+metadata:
+ format: Lava-Test Test Definition 1.0
+ name: tvm-benchmark
+ description: "Part of ml-bench, tvm-bench tests various ml benchmarks using tvm."
+ maintainer:
+ - theodore.grey@linaro.org
+ os:
+ - debian
+ scope:
+ - functional
+ devices:
+ - synquacer
+ - dragonboard-845c
+ - hi960-hikey
+ - stm32mp1
+params:
+ TVM_WHEEL: 'https://github.com/tlc-pack/tlcpack/releases/download/v0.7.dev1/tlcpack-0.7.dev1-cp38-cp38-manylinux2010_x86_64.whl'
+ TVM_BENCH: 'https://github.com/tom-gall/tvm-bench.git'
+ SKIP_INSTALL: false
+run:
+ steps:
+ - cd ./automated/linux/ml-bench/
+ - ./tvm-bench.sh -s "${SKIP_INSTALL}" -a "${TVM_WHEEL}" -t "${TVM_BENCH}"