Skip to content

Commit

Permalink
linux-gen: perf: add odp_ml_perf_run.sh
Browse files Browse the repository at this point in the history
Add ML performance test run for linux-gen. This runs some basic
performance tests using the conv.onnx model.

Signed-off-by: Jere Leppänen <[email protected]>
  • Loading branch information
JereLeppanen committed Nov 22, 2024
1 parent e0be154 commit 7737811
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
26 changes: 26 additions & 0 deletions platform/linux-generic/test/performance/Makefile.am
Original file line number Diff line number Diff line change
@@ -1 +1,27 @@
SUBDIRS = dmafwd

if WITH_ML
TESTS = odp_ml_perf_run.sh
EXTRA_DIST = odp_ml_perf_run.sh
endif

# If building out-of-tree, make check will not copy the scripts and data to the
# $(builddir) assuming that all commands are run locally. However this prevents
# running tests on a remote target using LOG_COMPILER.
# So copy all script and data files explicitly here.
all-local:
if [ "x$(srcdir)" != "x$(builddir)" ]; then \
for f in $(EXTRA_DIST); do \
if [ -e $(srcdir)/$$f ]; then \
mkdir -p $(builddir)/$$(dirname $$f); \
cp -f $(srcdir)/$$f $(builddir)/$$f; \
fi \
done \
fi

clean-local:
if [ "x$(srcdir)" != "x$(builddir)" ]; then \
for f in $(EXTRA_DIST); do \
rm -f $(builddir)/$$f; \
done \
fi
20 changes: 20 additions & 0 deletions platform/linux-generic/test/performance/odp_ml_perf_run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/sh -xe
#
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) 2024 Nokia

TEST_DIR="${TEST_DIR:-$(dirname $0)}"

cd $TEST_DIR
BIN_DIR=../../../../test/performance
MODEL_DIR=../../example/ml

run_conv() {
$BIN_DIR/odp_ml_perf${EXEEXT} -M $MODEL_DIR/conv.onnx \
-I $MODEL_DIR/conv-input.bin -R $MODEL_DIR/conv-output.bin $@
}

run_conv -m 0 -r 1000
run_conv -m 0 -r 1000 -l
run_conv -m 2 -l
run_conv -m 3 -l

0 comments on commit 7737811

Please sign in to comment.