From f82b5732bf76a8521234e48489007d16a664047b Mon Sep 17 00:00:00 2001 From: Hansong Zhang Date: Thu, 10 Apr 2025 13:57:31 -0700 Subject: [PATCH 1/4] Try to build QNN AAR --- .github/workflows/android-release-artifacts.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/android-release-artifacts.yml b/.github/workflows/android-release-artifacts.yml index 2503bf2214b..cc4f95b3630 100644 --- a/.github/workflows/android-release-artifacts.yml +++ b/.github/workflows/android-release-artifacts.yml @@ -11,6 +11,11 @@ on: description: Upload the AAR to maven staging repository required: false type: boolean + flavor: + type: choice + options: + - "xnnpack" + - "qnn+xnnpack" concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -35,8 +40,8 @@ jobs: build-aar: name: build-aar needs: check-if-aar-exists + uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main if: ${{ !github.event.pull_request.head.repo.fork }} - uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@release/2.7 secrets: inherit permissions: id-token: write @@ -69,6 +74,15 @@ jobs: echo -n "$SECRET_EXECUTORCH_MAVEN_SIGNING_GPG_KEY_CONTENTS" | base64 -d > /tmp/secring.gpg + FLAVOR="${{ inputs.flavor}}" + + if [[ "${FLAVOR}" == "qnn+xnnpack"]; then + PYTHON_EXECUTABLE=python bash .ci/scripts/setup-qnn-deps.sh + PYTHON_EXECUTABLE=python bash .ci/scripts/build-qnn-sdk.sh + export EXECUTORCH_BUILD_QNN=ON + export QNN_SDK_ROOT=/tmp/qnn/2.28.0.241029 + fi + # Build AAR Package mkdir aar-out export BUILD_AAR_DIR=aar-out From fe47f3a40ceaee9e203145cc94dc6749e9c4a311 Mon Sep 17 00:00:00 2001 From: Hansong Zhang Date: Thu, 10 Apr 2025 13:58:28 -0700 Subject: [PATCH 2/4] Update android-release-artifacts.yml --- .github/workflows/android-release-artifacts.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/android-release-artifacts.yml b/.github/workflows/android-release-artifacts.yml index cc4f95b3630..00282c25cfc 100644 --- a/.github/workflows/android-release-artifacts.yml +++ b/.github/workflows/android-release-artifacts.yml @@ -81,6 +81,7 @@ jobs: PYTHON_EXECUTABLE=python bash .ci/scripts/build-qnn-sdk.sh export EXECUTORCH_BUILD_QNN=ON export QNN_SDK_ROOT=/tmp/qnn/2.28.0.241029 + export ANDROID_ABIS=arm64-v8a fi # Build AAR Package From 888b765663eb7818829e510a4b22609467b09e96 Mon Sep 17 00:00:00 2001 From: Hansong Zhang Date: Thu, 10 Apr 2025 14:02:36 -0700 Subject: [PATCH 3/4] Update --- .github/workflows/android-release-artifacts.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/android-release-artifacts.yml b/.github/workflows/android-release-artifacts.yml index 00282c25cfc..7a0dbb56edf 100644 --- a/.github/workflows/android-release-artifacts.yml +++ b/.github/workflows/android-release-artifacts.yml @@ -40,8 +40,8 @@ jobs: build-aar: name: build-aar needs: check-if-aar-exists - uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main if: ${{ !github.event.pull_request.head.repo.fork }} + uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@release/2.7 secrets: inherit permissions: id-token: write From 20ec3ac6df71afcf30daf143aed35b8c90e71281 Mon Sep 17 00:00:00 2001 From: Hansong Zhang Date: Thu, 10 Apr 2025 14:15:27 -0700 Subject: [PATCH 4/4] fix --- .github/workflows/android-release-artifacts.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/android-release-artifacts.yml b/.github/workflows/android-release-artifacts.yml index 7a0dbb56edf..b35bb6859e7 100644 --- a/.github/workflows/android-release-artifacts.yml +++ b/.github/workflows/android-release-artifacts.yml @@ -74,9 +74,9 @@ jobs: echo -n "$SECRET_EXECUTORCH_MAVEN_SIGNING_GPG_KEY_CONTENTS" | base64 -d > /tmp/secring.gpg - FLAVOR="${{ inputs.flavor}}" + FLAVOR="${{ inputs.flavor }}" - if [[ "${FLAVOR}" == "qnn+xnnpack"]; then + if [[ "$FLAVOR" == "qnn+xnnpack" ]]; then PYTHON_EXECUTABLE=python bash .ci/scripts/setup-qnn-deps.sh PYTHON_EXECUTABLE=python bash .ci/scripts/build-qnn-sdk.sh export EXECUTORCH_BUILD_QNN=ON