onnxruntime/tools/ci_build/github/azure-pipelines/templates
Adrian Lizarraga 3b4c7df4e9
[QNN EP] Make QNN EP a shared library (#23120)
### Description
- Makes QNN EP a shared library **by default** when building with
`--use_qnn` or `--use_qnn shared_lib`. Generates the following build
artifacts:
- **Windows**: `onnxruntime_providers_qnn.dll` and
`onnxruntime_providers_shared.dll`
- **Linux**: `libonnxruntime_providers_qnn.so` and
`libonnxruntime_providers_shared.so`
  - **Android**: Not supported. Must build QNN EP as a static library.
- Allows QNN EP to still be built as a static library with `--use_qnn
static_lib`. This is primarily for the Android QNN AAR package.
- Unit tests run for both the static and shared QNN EP builds.

### Detailed changes
- Updates Java bindings to support both shared and static QNN EP builds.
- Provider bridge API:
- Adds logging sink ETW to the provider bridge. Allows EPs to register
ETW callbacks for ORT logging.
- Adds a variety of methods for onnxruntime objects that are needed by
QNN EP.
- QNN EP:
- Adds `ort_api.h` and `ort_api.cc` that encapsulates the API provided
by ORT in a manner that allows the EP to be built as either a shared or
static library.
- Adds custom function to transpose weights for Conv and Gemm (instead
of adding util to provider bridge API).
- Adds custom function to quantize data for LeakyRelu (instead of adding
util to provider bridge API).
  - Adds custom ETW tracing for QNN profiling events:
    - shared library: defines its own TraceLogging provider handle
- static library: uses ORT's TraceLogging provider handle and existing
telemetry provider.
- ORT-QNN Packages:
- **Python**: Pipelines build QNN EP as a shared library by default.
User can build a local python wheel with QNN EP as a static library by
passing `--use_qnn static_lib`.
- **NuGet**: Pipelines build QNN EP as a shared library by default.
`build.py` currently enforces QNN EP to be built as a shared library.
Can add support for building a QNN NuGet package with static later if
deemed necessary.
- **Android**: Pipelines build QNN EP as a **static library**.
`build.py` enforces QNN EP to be built as a static library. Packaging
multiple shared libraries into an Android AAR package is not currently
supported due to the added need to also distribute a shared libcpp.so
library.

### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->
2025-01-22 12:11:00 -08:00
..
jobs Update Qnn SDK default version to 2.30 (#23411) 2025-01-17 22:36:35 -08:00
stages [mobile] Fix for mac-ios-packaging pipeline (#22879) 2024-11-19 09:27:51 -08:00
android-binary-size-check-stage.yml Update onnxruntime binary size checks ci pipeline's docker image (#23405) 2025-01-17 15:29:17 -08:00
android-dump-logs-from-steps.yml
android-java-api-aar-test.yml Change MacOS-13 to ubuntu on for android-java-api-aar-test.yml. (#23444) 2025-01-21 17:07:20 -08:00
android-java-api-aar.yml Update Qnn SDK default version to 2.30 (#23411) 2025-01-17 22:36:35 -08:00
build-linux-wasm-step.yml
c-api-artifacts-package-and-publish-steps-posix.yml
c-api-artifacts-package-and-publish-steps-windows.yml
c-api-cpu.yml Change MacOS-13 to ubuntu on for android-java-api-aar-test.yml. (#23444) 2025-01-21 17:07:20 -08:00
c-api-linux-cpu.yml Update onnxruntime binary size checks ci pipeline's docker image (#23405) 2025-01-17 15:29:17 -08:00
check-cache-stats.yml
check_test_result.yml
clean-agent-build-directory-step.yml Remove PostBuildCleanup (#23233) 2024-12-31 13:12:33 -08:00
common-variables.yml [TensorRT EP] support TensorRT 10.7-GA (#23011) 2024-12-19 10:39:15 -08:00
compliance.yml
component-governance-component-detection-steps.yml
download-deps.yml Update xnnpack, cpuinfo and pthreadpool (#23362) 2025-01-15 09:42:15 -08:00
esrp_nuget.yml
explicitly-defined-final-tasks.yml Remove PostBuildCleanup (#23233) 2024-12-31 13:12:33 -08:00
final-jar-testing.yml Remove PostBuildCleanup (#23233) 2024-12-31 13:12:33 -08:00
flex-downloadPipelineArtifact.yml
get-docker-image-steps.yml
jar-esrp-dll.yml
jar-maven-signing-linux.yml Fix Maven Sha256 Checksum Issue (#22600) 2024-10-25 08:13:02 -07:00
jar-maven-signing-win.yml Fix Maven Sha256 Checksum Issue (#22600) 2024-10-25 08:13:02 -07:00
java-api-artifacts-package-and-publish-steps-posix.yml
linux-build-step-with-cache.yml
linux-ci.yml
linux-cpu-packaging-pipeline.yml Update the Docker image version (#22907) 2024-11-21 19:38:39 +08:00
linux-wasm-ci.yml [WebGPU] allow build WebGPU EP for WebAssembly (#23364) 2025-01-16 10:52:17 -08:00
linux-web-init-and-check.yml
mac-build-step-with-cache.yml
mac-cpu-packaging-pipeline.yml Deprecate macos-12 (#23017) 2024-12-05 14:07:21 +08:00
mac-cpu-packaging-steps.yml
mac-cpu-packing-jobs.yml Update all JDK version to 17 (#22786) 2024-11-12 11:42:18 -08:00
mac-esrp-dylib.yml
make_java_win_binaries.yml
nodejs-artifacts-package-and-publish-steps-posix.yml
nodejs-artifacts-package-and-publish-steps-windows.yml
ondevice-training-cpu-packaging-pipeline.yml Change MacOS-13 to ubuntu on for android-java-api-aar-test.yml. (#23444) 2025-01-21 17:07:20 -08:00
publish-nuget-steps.yml Remove PostBuildCleanup (#23233) 2024-12-31 13:12:33 -08:00
py-linux-qnn.yml Update Qnn SDK default version to 2.30 (#23411) 2025-01-17 22:36:35 -08:00
py-linux.yml Remove PostBuildCleanup (#23233) 2024-12-31 13:12:33 -08:00
py-package-smoking-test.yml Remove PostBuildCleanup (#23233) 2024-12-31 13:12:33 -08:00
py-packaging-linux-test-cpu.yml Remove PostBuildCleanup (#23233) 2024-12-31 13:12:33 -08:00
py-packaging-linux-test-cuda.yml Remove PostBuildCleanup (#23233) 2024-12-31 13:12:33 -08:00
py-packaging-training-cuda-stage.yml
py-win-arm64-qnn.yml [QNN EP] Make QNN EP a shared library (#23120) 2025-01-22 12:11:00 -08:00
py-win-arm64ec-qnn.yml [QNN EP] Make QNN EP a shared library (#23120) 2025-01-22 12:11:00 -08:00
py-win-x64-qnn.yml [QNN EP] Make QNN EP a shared library (#23120) 2025-01-22 12:11:00 -08:00
qnn-ep-win.yml [QNN EP] Make QNN EP a shared library (#23120) 2025-01-22 12:11:00 -08:00
react-native-ci.yml Moving RN_CI Android Testing to Linux (#23422) 2025-01-21 11:55:29 -08:00
rocm.yml
run-docker-build-steps.yml
set-nightly-build-option-variable-step.yml
set-python-manylinux-variables-step.yml Add python 3.13 support (#22380) 2024-10-14 18:07:54 -07:00
set-version-number-variables-step.yml
telemetry-steps.yml
upload-code-coverage-data.yml
use-android-emulator.yml
use-android-ndk.yml Update NDK (#23280) 2025-01-08 13:57:23 -08:00
use-xcode-version.yml
validate-package.yml update pipline python version from 3.8 to 3.12 (#22517) 2024-10-21 07:50:31 -07:00
web-browserstack-ci.yml Remove PostBuildCleanup (#23233) 2024-12-31 13:12:33 -08:00
web-ci.yml [WebGPU] allow build WebGPU EP for WebAssembly (#23364) 2025-01-16 10:52:17 -08:00
win-ci.yml Remove PostBuildCleanup (#23233) 2024-12-31 13:12:33 -08:00
win-esrp-dll.yml Add DoEsrp Check for Signature Verification (#22570) 2024-10-24 16:55:36 +08:00
win-wasm-ci.yml Remove PostBuildCleanup (#23233) 2024-12-31 13:12:33 -08:00
win-web-ci.yml Remove PostBuildCleanup (#23233) 2024-12-31 13:12:33 -08:00
win-web-multi-browsers.yml Remove PostBuildCleanup (#23233) 2024-12-31 13:12:33 -08:00
windowsai-steps.yml Fix Pipeline Timeout Issue (#22901) 2024-11-20 17:18:50 +01:00
with-container-registry-steps.yml