forked from OpenDataPlane/odp-dpdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
linux-dpdk: example: ml: include in build
Include linux-dpdk/example/ml in build. It was removed in a recent revert along with the onnx model based examples. The conv example is skipped in make check, unless the model file is manually provided. Signed-off-by: Jere Leppänen <[email protected]>
- Loading branch information
1 parent
03af119
commit f46244f
Showing
7 changed files
with
88 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
SUBDIRS = | ||
|
||
if WITH_ML | ||
SUBDIRS += ml | ||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
conv.bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
include $(top_srcdir)/example/Makefile.inc | ||
|
||
EXTRA_DIST = \ | ||
odp_ml_run_conv.sh \ | ||
conv.onnx \ | ||
conv_gen.py \ | ||
conv_gen.sh \ | ||
conv-input.bin \ | ||
conv-output.bin | ||
|
||
if test_example | ||
TESTS = odp_ml_run_conv.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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/sh -ex | ||
# | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
# Copyright (c) 2024 Nokia | ||
|
||
# | ||
# This script requires the onnx python module. The mrvl-mlc and mlModel tools | ||
# are expected to be in PATH. These tools are x86-64 binaries, so this script | ||
# must be run on an x86-64 machine. However, the model can only be run on a | ||
# machine equipped with the Marvell machine learning inference processor (MLIP). | ||
# | ||
|
||
python ./conv_gen.py | ||
mrvl-mlc conv.onnx conv --num_tiles=1 --batch=1 | ||
mv bin_conv/conv.bin . | ||
rm -rf bin_conv compiler_dir profile | ||
mlModel -M -m conv.bin |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/sh | ||
# | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
# Copyright (c) 2024 Nokia | ||
|
||
TEST_DIR="${TEST_DIR:-$(dirname $0)}" | ||
MODEL_FILE=$TEST_DIR/conv.bin | ||
|
||
# exit codes expected by automake for skipped tests | ||
TEST_SKIPPED=77 | ||
|
||
# Skip test if model file is not found. The model file is compiled separately. | ||
# See platform/linux-dpdk/example/ml/conv_gen.sh. | ||
|
||
if [ ! -e "$MODEL_FILE" ]; then | ||
echo "SKIP: ML model file ($MODEL_FILE) not found" | ||
exit $TEST_SKIPPED | ||
fi | ||
|
||
../../../../example/ml/odp_ml_run${EXEEXT} \ | ||
-m $MODEL_FILE -i conv-input.bin -r conv-output.bin -q 1 -d 1 | ||
|
||
if [ $? -ne 0 ] ; then | ||
echo Test FAILED | ||
exit 1 | ||
fi | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters