-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[QNN EP] Add QNN EP UDO support #25076
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
base: main
Are you sure you want to change the base?
Conversation
/azp run Linux QNN CI Pipeline,Win_TRT_Minimal_CUDA_Test_CI,Windows ARM64 QNN CI Pipeline,Windows GPU Doc Gen CI Pipeline,Windows x64 QNN CI Pipeline |
Azure Pipelines successfully started running 5 pipeline(s). |
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.
Pull Request Overview
Adds support for loading and registering user-defined op packages (UDO) in the QNN execution provider via a new op_packages
configuration option.
- Extended test runners and CLI tools to parse and validate an
op_packages
argument. - Implemented
ParseOpPackages
, integrated it intoQNNExecutionProvider
andQnnBackendManager
, and invoked a newLoadOpPackage()
step. - Introduced
UDOBuilder
and updated the builder factory to register custom UDO-based operators.
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
onnxruntime/test/perftest/ort_test_session.cc | Added op_packages to the session config keys and validated its value. |
onnxruntime/test/perftest/command_args_parser.cc | Updated help text to document the op_packages CLI option. |
onnxruntime/test/onnx/main.cc | Enhanced usage output to include op_packages description. |
onnxruntime/core/providers/qnn/qnn_execution_provider.cc | Added ParseOpPackages helper and integrated it into provider initialization. |
onnxruntime/core/providers/qnn/builder/qnn_utils.cc | Clarified printing of 64-bit scalar types to note UDO support. |
onnxruntime/core/providers/qnn/builder/qnn_backend_manager.h | Extended QnnBackendManagerConfig and manager class to store op_packages . |
onnxruntime/core/providers/qnn/builder/qnn_backend_manager.cc | Implemented LoadOpPackage() logic and invoked it in SetupBackend() . |
onnxruntime/core/providers/qnn/builder/opbuilder/udo_builder.cc | Added UDOBuilder for UDO operator construction. |
onnxruntime/core/providers/qnn/builder/opbuilder/base_op_builder.h | Enabled scalar handling for int64_t (64-bit) types for UDO. |
onnxruntime/core/providers/qnn/builder/op_builder_factory.h | Introduced APIs to register UDO builders in the factory. |
onnxruntime/core/providers/qnn/builder/op_builder_factory.cc | Registered the global OpBuilderRegistrations instance for UDO. |
Comments suppressed due to low confidence (3)
onnxruntime/core/providers/qnn/builder/qnn_backend_manager.cc:324
- Missing #include at the top of the file; std::filesystem::path requires the header.
std::filesystem::path op_package_path = op_package[1];
onnxruntime/core/providers/qnn/builder/qnn_backend_manager.cc:382
- Typo in variable name 'op_package_for_registeration' and related log messages; should be 'op_package_for_registration'.
std::string op_package_for_registeration = op_package_path.stem().string();
onnxruntime/core/providers/qnn/qnn_execution_provider.cc:182
- No unit tests currently cover
ParseOpPackages
; adding tests for valid and invalid package strings would help prevent regressions.
static void ParseOpPackages(const std::string& op_packages_string, std::vector<std::vector<std::string>>& op_packages) {
Need to add new provider options "op_packages" here:
Please also list all the valid value for target. Also need to update the doc under gh-pages branch once the PR get merged: |
onnxruntime/core/providers/qnn/builder/opbuilder/udo_builder.cc
Outdated
Show resolved
Hide resolved
done
This might need discussion since on Windows it has signing issue, and most of users may not be able to use this feature. |
/azp run Linux QNN CI Pipeline,Win_TRT_Minimal_CUDA_Test_CI,Windows ARM64 QNN CI Pipeline,Windows GPU Doc Gen CI Pipeline,Windows x64 QNN CI Pipeline |
Azure Pipelines successfully started running 5 pipeline(s). |
Description
Add UDO support in QNN
Example usage:
./onnx_test_runner -v -e qnn -j 1 -i "backend_path|./libQnnCpu.so op_packages|<op_type>:<op_package_path>:<interface_symbol_name>[:<target>],<op_type2>:<op_package_path2>:<interface_symbol_nam2e>[:<target2>]" <models>
Motivation and Context
Add QNN EP UDO support.
For more information, ref op packages