Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 18 additions & 10 deletions .github/workflows/android-release-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,11 @@ on:
type: choice
options:
- "xnnpack"
- "vulkan+xnnpack"
- "vulkan"
- "qnn"
schedule:
- cron: 0 10 * * *

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
check-if-aar-exists:
name: check-if-aar-exists
Expand All @@ -34,12 +30,13 @@ jobs:
shell: bash
run: |
VERSION="${{ inputs.version }}"
FLAVOR="${{ inputs.flavor }}"
if [ -z "$VERSION" ]; then
echo "No version name specified. Will create a snapshot AAR"
exit 0
fi
if curl -I "https://ossci-android.s3.amazonaws.com/executorch/release/${VERSION}/executorch.aar" | grep "200 OK"; then
echo "AAR already exists at https://ossci-android.s3.amazonaws.com/executorch/release/${VERSION}/executorch.aar"
if curl -I "https://ossci-android.s3.amazonaws.com/executorch/release/${VERSION}-${FLAVOR}/executorch.aar" | grep "200 OK"; then
echo "AAR already exists at https://ossci-android.s3.amazonaws.com/executorch/release/${VERSION}-${FLAVOR}/executorch.aar"
echo "Will skip build/upload"
exit 1
fi
Expand Down Expand Up @@ -93,7 +90,14 @@ jobs:
fi

FLAVOR="${{ inputs.flavor }}"
if [[ "$FLAVOR" == "vulkan+xnnpack" || -z "$FLAVOR" ]]; then
if [ ! -z "$FLAVOR" ]; then
GRADLE_ARGS+=" -Dflavor=${FLAVOR}"
fi

if [[ "$FLAVOR" == "vulkan" || -z "$FLAVOR" ]]; then
curl -O https://sdk.lunarg.com/sdk/download/1.4.321.1/linux/vulkansdk-linux-x86_64-1.4.321.1.tar.xz
tar xf vulkansdk-linux-x86_64-1.4.321.1.tar.xz -C /tmp
export PATH="/tmp/1.4.321.1/x86_64/bin:$PATH"
export EXECUTORCH_BUILD_VULKAN=ON
fi

Expand Down Expand Up @@ -145,8 +149,12 @@ jobs:
pip install awscli==1.32.18
AWS_CMD="aws s3 cp"
VERSION="${{ inputs.version }}"
FLAVOR="${{ inputs.flavor }}"
if [ -z "$VERSION" ]; then
VERSION="snapshot-$(date +"%Y%m%d")"
fi
${AWS_CMD} executorch.aar s3://ossci-android/executorch/release/${VERSION}/executorch.aar --acl public-read
${AWS_CMD} executorch.aar.sha256sums s3://ossci-android/executorch/release/${VERSION}/executorch.aar.sha256sums --acl public-read
if [ -z "$FLAVOR" ]; then
FLAVOR="xnnpack"
fi
${AWS_CMD} executorch.aar s3://ossci-android/executorch/release/${VERSION}-${FLAVOR}/executorch.aar --acl public-read
${AWS_CMD} executorch.aar.sha256sums s3://ossci-android/executorch/release/${VERSION}-${FLAVOR}/executorch.aar.sha256sums --acl public-read
25 changes: 10 additions & 15 deletions backends/vulkan/cmake/ShaderLibrary.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,17 @@ if(NOT EXECUTORCH_ROOT)
message("WARNING: EXECUTORCH_ROOT is not set! A failure is likely imminent.")
endif()

if(ANDROID)
if(NOT ANDROID_NDK)
message(FATAL_ERROR "ANDROID_NDK not set")
endif()

if(NOT GLSLC_PATH)
set(GLSLC_PATH
"${ANDROID_NDK}/shader-tools/${ANDROID_NDK_HOST_SYSTEM_NAME}/glslc"
)
endif()
else()
find_program(GLSLC_PATH glslc PATHS $ENV{PATH})
find_program(GLSLC_PATH glslc PATHS $ENV{PATH})

if(NOT GLSLC_PATH)
message(FATAL_ERROR "USE_VULKAN glslc not found")
endif()
if(NOT GLSLC_PATH)
message(
FATAL_ERROR
"glslc from the Vulkan SDK must be installed to build the Vulkan backend. "
"Please install the Vulkan SDK 1.4.321.0 or newer from "
"https://vulkan.lunarg.com/sdk/home and ensure that the glslc binary is in your PATH. "
"Note that the glslc distributed with the Android NDK is not compatible since it "
"does not support the GL_EXT_integer_dot_product extension. "
)
endif()

# Required to enable linking with --whole-archive
Expand Down
3 changes: 2 additions & 1 deletion extension/android/executorch_android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ plugins {

def qnnVersion = System.properties['qnnVersion']
def execuTorchVersion = System.properties['execuTorchVersion']
def flavor = System.properties['flavor']

android {
namespace = "org.pytorch.executorch"
Expand Down Expand Up @@ -69,7 +70,7 @@ mavenPublishing {
publishToMavenCentral()
signAllPublications()

coordinates("org.pytorch", "executorch-android" + (qnnVersion ? "-qnn" : ""), execuTorchVersion ? execuTorchVersion : "0.7.0-SNAPSHOT")
coordinates("org.pytorch", "executorch-android" + (flavor ? "-" + flavor : ""), execuTorchVersion ? execuTorchVersion : "1.0.0-SNAPSHOT")

pom {
name = "ExecuTorch Android"
Expand Down
Loading