-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
### Description Pre built QNN Android package ### Future Work 1. Setting up CI with Browserstack- onnxruntime_tests and Android test 2. ESRP Release to Maven
- Loading branch information
1 parent
709368e
commit dd2ea84
Showing
6 changed files
with
134 additions
and
19 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,10 @@ def publishDir = System.properties['publishDir'] | |
def minSdkVer = System.properties['minSdkVer'] | ||
def targetSdkVer = System.properties['targetSdkVer'] | ||
boolean enableTrainingApis = (System.properties['ENABLE_TRAINING_APIS'] ?: "0") == "1" | ||
// Expected format for qnnVersion: major.minor.patch (e.g., 2.26.0) | ||
// QNN package version does not follow Semantic Versioning (SemVer) format. | ||
// For non qnn builds, qnnVersion will be null | ||
def qnnVersion = System.properties['qnnVersion'] | ||
|
||
// Since Android requires a higher numbers indicating more recent versions | ||
// This function assume ORT version number will be in formart of A.B.C such as 1.7.0 | ||
|
@@ -26,14 +30,22 @@ project.version = rootProject.file('../VERSION_NUMBER').text.trim() | |
project.group = "com.microsoft.onnxruntime" | ||
|
||
def tmpArtifactId = enableTrainingApis ? project.name + "-training" : project.name | ||
def mavenArtifactId = tmpArtifactId + '-android' | ||
def mavenArtifactId = tmpArtifactId + '-android' + (qnnVersion != null ? '-qnn' : '') | ||
|
||
//should the mavenArtifactId be read from the packageName variable as | ||
//that's how it's used in the build_aar_copy_artifacts.sh while copying the artifacts | ||
|
||
def defaultDescription = 'ONNX Runtime is a performance-focused inference engine for ONNX (Open Neural Network ' + | ||
'Exchange) models. This package contains the Android (aar) build of ONNX Runtime. It includes support for all ' + | ||
'types and operators, for ONNX format models. All standard ONNX models can be executed with this package.' | ||
def trainingDescription = 'The onnxruntime-training android package is designed to efficiently train and infer a ' + | ||
'wide range of ONNX models on edge devices, such as mobile phones, tablets, and other portable devices with ' + | ||
'a focus on minimizing resource usage and maximizing accuracy.' + | ||
'See https://github.com/microsoft/onnxruntime-training-examples/tree/master/on_device_training for more details.' | ||
def qnnDescription = 'ONNX Runtime is a performance-focused inference engine for ONNX (Open Neural Network ' + | ||
'Exchange) models. This package contains the Android (aar) build of ONNX Runtime with the QNN Execution Provider.' + | ||
'It includes support for all types and operators, for ONNX format models. All standard ONNX models can be executed' + | ||
'with this package.' | ||
|
||
buildscript { | ||
repositories { | ||
|
@@ -137,8 +149,9 @@ publishing { | |
artifact sourcesJar | ||
|
||
pom { | ||
name = enableTrainingApis ? 'onnxruntime-training' : 'onnx-runtime' | ||
description = enableTrainingApis ? trainingDescription : defaultDescription | ||
name = qnnVersion != null ? 'onnxruntime-qnn' : (enableTrainingApis ? 'onnxruntime-training' : 'onnx-runtime') | ||
description = qnnVersion != null ? qnnDescription : (enableTrainingApis ? trainingDescription : defaultDescription) | ||
|
||
url = 'https://microsoft.github.io/onnxruntime/' | ||
licenses { | ||
license { | ||
|
@@ -162,6 +175,16 @@ publishing { | |
email = '[email protected]' | ||
} | ||
} | ||
|
||
if (qnnVersion != null) { | ||
println "Modifying the POM XML to include QNN dependency" | ||
withXml { | ||
def dependencynode = asNode().appendNode('dependencies').appendNode('dependency') | ||
dependencynode.appendNode('groupId', 'com.qualcomm.qti') | ||
dependencynode.appendNode('artifactId', 'qnn-runtime') | ||
dependencynode.appendNode('version', qnnVersion) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
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
19 changes: 19 additions & 0 deletions
19
tools/ci_build/github/android/default_qnn_aar_build_settings.json
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,19 @@ | ||
{ | ||
"build_abis": [ | ||
"arm64-v8a" | ||
], | ||
"android_min_sdk_version": 21, | ||
"android_target_sdk_version": 24, | ||
"build_params": [ | ||
"--enable_lto", | ||
"--android", | ||
"--parallel", | ||
"--cmake_generator=Ninja", | ||
"--build_java", | ||
"--build_shared_lib", | ||
"--use_qnn", | ||
"--cmake_extra_defines=onnxruntime_BUILD_UNIT_TESTS=OFF", | ||
"--skip_tests" | ||
|
||
] | ||
} |
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