Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PATCH v6] test: ml_perf: add ML performance test #2138

Merged
merged 2 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
1 change: 1 addition & 0 deletions test/performance/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ odp_l2fwd
odp_l2fwd_perf
odp_lock_perf
odp_mem_perf
odp_ml_perf
odp_packet_gen
odp_pktio_ordered
odp_pktio_perf
Expand Down
5 changes: 5 additions & 0 deletions test/performance/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ if LIBCONFIG
COMPILE_ONLY += odp_ipsecfwd
endif

if WITH_ML
COMPILE_ONLY += odp_ml_perf
odp_ml_perf_SOURCES = odp_ml_perf.c
endif

TESTSCRIPTS = odp_cpu_bench_run.sh \
odp_crypto_run.sh \
odp_dma_perf_run.sh \
Expand Down
Loading