-
Notifications
You must be signed in to change notification settings - Fork 586
New feature: OnnxPredict algorithm #1488
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
Open
xaviliz
wants to merge
61
commits into
MTG:master
Choose a base branch
from
xaviliz:feat/onnx-predict
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+925
−7
Open
Changes from 41 commits
Commits
Show all changes
61 commits
Select commit
Hold shift + click to select a range
98994c6
Add initial script for building onnx-runtime.
xaviliz 4e92dc0
Modify wscript for onnx flag.
xaviliz d673012
Define algos for onnx-runtime and create --with-onnx flag.
xaviliz 4246f5b
Support --with-onnx
xaviliz 9720e28
Rename library to be detected by pkg-config
xaviliz d60385e
Add initial onnxpredict.cpp files.
xaviliz 3bb07a9
Provide a constructor and solve some errors.
xaviliz 90da5d4
Fix status errors.
xaviliz 7d357be
Update ONNX Runtime versioning
xaviliz 56da948
Support for MacOS building at arm64
xaviliz d9c8a49
Support for multi IO models
xaviliz d136388
Except OnnxPredict algorithm to use pool in cpp
xaviliz f46d481
First onnx runtime unittest with effnet model
xaviliz 4798b8b
Merge branch 'master' into feat/onnx-predict
xaviliz bce71f9
Add support for building onnxruntime in Linux.
xaviliz 28da0a9
Save onnxruntime files after building
xaviliz 0da9800
Copy all dynamic library files
xaviliz 88787a2
Fix stem in audio path
xaviliz 1ee0fe6
Clean and update the parameter declaration
xaviliz 83ed01d
Small clean
xaviliz 5a300fc
Fix issue in the EssentiaExceptions for name parsing.
xaviliz 4f7955c
Add TestIONameParser()
xaviliz 29d0e2b
Adapt testEmptyModelName() unittest
xaviliz 2655a03
Add testInvalidParams() as unitest
xaviliz 2c42e91
Update effnetdiscogs-bsdynamic-1.onnx location
xaviliz c766952
Throw EssentiaException for empty model names.
xaviliz 35b0228
Updated test/models submodule
xaviliz 4302cb9
Updated test/audio submodule
xaviliz 9a09d95
Polish ORT building command for MacOS
xaviliz b552601
Initial support for multi input models
xaviliz a5268cc
Add testIdentityModel()
xaviliz e21cca1
Fix issues with multi input data models
xaviliz 64a86cb
Small clean
xaviliz e206845
Assert testInference() with input and output shapes
xaviliz d246e28
Add testComputeWithoutConfiguration() unittest
xaviliz 86c64eb
Add testIgnoreInvalidReconfiguration() as unittest
xaviliz 459652e
Add testInvalidSqueezeConfiguration() as unittest
xaviliz 30abf8a
Add testConfigure() as unittest
xaviliz 6fa1780
Add testConfigure() as unittest
xaviliz 46727b7
Fix issue in testIgnoreInvalidReconfiguration() for Linux
xaviliz 7193415
Clean and small change
xaviliz 509b991
Remove MacOS support
xaviliz 00c09ee
Clean debug output
xaviliz 6dc8f55
Skip saving the optimized graph
xaviliz 881fe48
Set to 0 the intraop number of threads
xaviliz cac1cb4
Improve setTensorInfos() for readablity
xaviliz 6b971f6
Raise an exception if no input is provided
xaviliz 1f8f0fb
Small clean
xaviliz 679b2fb
Fix testInference() unitest after declaring inputs as mandatory param…
xaviliz 31b7964
Small change
xaviliz e2c6c2a
Excepts when no outputs are defined
xaviliz f86fd52
Clean unused checkers for inputs and outputs
xaviliz 59ae04e
Replace std::cout by E_INFO()
xaviliz 108ee4c
Add onnxruntime library in the Debian building pipeline.
xaviliz 442bae5
Configure GPU providers dynamically
xaviliz 580a62c
Handle parallel computational providers with macros to avoid errors w…
xaviliz 382dd17
Support for resetting Ort::Session and Ort::SessionOption
xaviliz 8e137b3
Check input and output nodes before any computating
xaviliz 37e6912
Reset Ort::Session and Ort::SessionOptions for each configure()
xaviliz 1cdcb2b
Create Ort::Env once per application and reuse it for all sessions
xaviliz 74a585b
Add deviceId parameter to specify gpu id for inferencing when CUDA, M…
xaviliz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,68 @@ | ||
| #!/usr/bin/env bash | ||
| set -e | ||
| . ../build_config.sh | ||
|
|
||
| rm -rf tmp | ||
| mkdir tmp | ||
| cd tmp | ||
|
|
||
| # Prerequisites: python>=3.10 | ||
| # cmake>=3.28 | ||
|
|
||
| echo "Building onnxruntime $LIBONNXRUNTIME_VERSION" | ||
|
|
||
| curl -SLO "https://github.com/microsoft/onnxruntime/archive/refs/tags/v$LIBONNXRUNTIME_VERSION.tar.gz" | ||
|
|
||
| tar -xf v$LIBONNXRUNTIME_VERSION.tar.gz | ||
| cd onnxruntime-$LIBONNXRUNTIME_VERSION | ||
|
|
||
| python3 -m pip install cmake | ||
|
|
||
| # Build the dynamic library for Linux or MacOS | ||
| # build for Intel and Apple silicon CPUs --> "x86_64;arm64" | ||
|
|
||
| CMAKE_EXTRA_DEFINES="FETCHCONTENT_TRY_FIND_PACKAGE_MODE=NEVER CMAKE_INSTALL_PREFIX=${PREFIX}" | ||
| OS=$(uname -s) | ||
| CONFIG=Release | ||
|
|
||
| if [ "$OS" = "Darwin" ]; then | ||
| DIR_OS="MacOS" | ||
| CMAKE_EXTRA_DEFINES+=' CMAKE_OSX_ARCHITECTURES=arm64' | ||
| SUFFIX="${LIBONNXRUNTIME_VERSION}.dylib*" | ||
|
|
||
| ./build.sh \ | ||
| --config $CONFIG \ | ||
| --build_shared_lib \ | ||
| --parallel \ | ||
| --skip_submodule_sync \ | ||
| --skip_tests \ | ||
| --cmake_extra_defines $CMAKE_EXTRA_DEFINES | ||
| else | ||
| DIR_OS="Linux" | ||
| SUFFIX="so*" | ||
|
|
||
| ./build.sh \ | ||
| --config $CONFIG \ | ||
| --build_shared_lib \ | ||
| --parallel \ | ||
| --compile_no_warning_as_error \ | ||
| --skip_submodule_sync \ | ||
| --allow_running_as_root \ | ||
| --skip_tests \ | ||
| --cmake_extra_defines $CMAKE_EXTRA_DEFINES | ||
| fi | ||
|
|
||
| # copying onnxruntime files | ||
| mkdir -p "${PREFIX}"/lib/pkgconfig/ | ||
| mkdir -p "${PREFIX}"/include/onnxruntime/ | ||
|
|
||
| cp build/$DIR_OS/$CONFIG/libonnxruntime.pc ${PREFIX}/lib/pkgconfig/ | ||
| cp -r build/$DIR_OS/$CONFIG/libonnxruntime.$SUFFIX ${PREFIX}/lib/ | ||
|
|
||
| cp include/onnxruntime/core/session/onnxruntime_cxx_inline.h ${PREFIX}/include/onnxruntime/ | ||
| cp include/onnxruntime/core/session/onnxruntime_float16.h ${PREFIX}/include/onnxruntime/ | ||
| cp include/onnxruntime/core/session/onnxruntime_c_api.h ${PREFIX}/include/onnxruntime/ | ||
| cp include/onnxruntime/core/session/onnxruntime_cxx_api.h ${PREFIX}/include/onnxruntime/ | ||
|
|
||
| cd ../.. | ||
| rm -fr tmp | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xaviliz, since we are inside debian_3rdparty, should we remove or move somewhere else the MacOS support?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's true. I kept it for testing purpouses. Let me clean it a bit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It has been tested on Linux.