New feature: OnnxPredict algorithm#1488
Open
xaviliz wants to merge 70 commits into
Open
Conversation
…hen cuda, metal or open_ml are not compiled in onnxruntime library
…ETAL or OPEN_ML providers are found
… level in ORT.
- Declared as a new string parameter with choices: {disable_all,basic,extended,all}, by default “extended”.
- https://onnxruntime.ai/docs/performance/model-optimizations/graph-optimizations.html#levels
- Set graph optimization level in ORT Session.
- `test_default_optimization_level()`: Check that the default optimization level is 'extended'. - `test_set_valid_optimization_levels()`: Check that valid optimization levels can be set without errors. - `test_set_invalid_optimization_level()`: Check that invalid optimization levels raise an error.
- CUDA tensors now use Ort::MemoryInfo::CreateCuda to allocate GPU memory. - Metal and CoreML providers continue to use CPU tensors; data is managed internally by the provider. - Execution provider is auto-selected based on availability and _deviceId.
Contributor
Author
|
Thank you @palonso, all changes/suggestions have been addressed. Before merging it would be nice to:
|
- Add CUDA flags to build ORT in Linux - Copy dynamic library with CUDA providers in the PREFIX - Add ORT flags to optimize building and library.
- Define HAVE_ONNXRUNTIME_CUDA variable in wscript to automatically
check if CUDA library is available
- Avoid loading CORE_ML headers from OSX when HAVE_ONNSRUNTIME_COREML
is not on.
- Switch to CUDA provider when HAVE_ONNXRUNTIME_CUDA is active.
- Remove specific CUDA Memory info snippet.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
New feature: OnnxPredict algorithm
Feature
It makes additional changes in Essentia library to build ONNX Runtime Inferencing library from the source and to implement a new algorithm
OnnxPredictfor running ONNX models (.onnx) with multiple IO.Implementation
onnxruntimedynamic library.OnnxPredictto run ONNX models in Essentia.test_onnxpredict.pyPrerequisites
python >= 3.10cmake >= 3.28Testing
How to Test
Tested in
onnxruntime-v1.22.1:python 3.13.4andcmake 4.0.2python 3.10.18andcmake 4.1.0How to build ONNX Runtime
After installing Essentia dependencies in a virtual environment, install
cmakeThen we can run the building script:
cd packaging/debian_3rdparty bash build_onnx.shHow to build OnnxPredict
In MacOS:
In Linux:
python3 waf configure --fft=KISS --include-algos=OnnxPredict,Windowing,Spectrum,MelBands,UnaryOperator,TriangularBands,FFT,Magnitude,NoiseAdder,RealAccumulator,FileOutputProxy,FrameCutter --static-dependencies --with-onnx --lightweight= --with-python --pkg-config-path /usr/share/pkgconfig --std=c++14 python3 waf -v && python3 waf installHow to unittest