Skip to content

Commit 228dc0b

Browse files
authored
Merge branch 'main' into support-dynamically-quantized-convolutions
2 parents 064671b + 3410cfe commit 228dc0b

File tree

577 files changed

+15711
-5556
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

577 files changed

+15711
-5556
lines changed

.ci/docker/requirements-ci.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ parameterized==0.9.0
1717

1818
# Doc build requirements, same as https://github.com/pytorch/pytorch/blob/main/.ci/docker/requirements-docs.txt
1919
sphinx==5.3.0
20+
sphinx-reredirects==0.1.4
2021
sphinx-gallery==0.14.0
2122
breathe==4.34.0
2223
exhale==0.2.3

.ci/scripts/build_android_instrumentation.sh

Lines changed: 0 additions & 21 deletions
This file was deleted.

.ci/scripts/gather_benchmark_configs.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"samsung_galaxy_s22": "arn:aws:devicefarm:us-west-2:308535385114:devicepool:02a2cf0f-6d9b-45ee-ba1a-a086587469e6/e59f866a-30aa-4aa1-87b7-4510e5820dfa",
2424
"samsung_galaxy_s24": "arn:aws:devicefarm:us-west-2:308535385114:devicepool:02a2cf0f-6d9b-45ee-ba1a-a086587469e6/98f8788c-2e25-4a3c-8bb2-0d1e8897c0db",
2525
"google_pixel_8_pro": "arn:aws:devicefarm:us-west-2:308535385114:devicepool:02a2cf0f-6d9b-45ee-ba1a-a086587469e6/d65096ab-900b-4521-be8b-a3619b69236a",
26+
"google_pixel_3_private_rooted": "arn:aws:devicefarm:us-west-2:308535385114:devicepool:02a2cf0f-6d9b-45ee-ba1a-a086587469e6/98d23ca8-ea9e-4fb7-b725-d402017b198d",
2627
}
2728

2829
# Predefined benchmark configurations

.ci/scripts/test_ios_ci.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
set -e
99

10-
APP_PATH="examples/demo-apps/apple_ios/ExecuTorchDemo/ExecuTorchDemo"
10+
APP_PATH="executorch-examples/apple/ExecuTorchDemo/ExecuTorchDemo"
1111
MODEL_NAME="mv3"
1212
SIMULATOR_NAME="executorch"
1313

@@ -34,6 +34,10 @@ say() {
3434
echo -e "\033[1m\n\t** $1 **\n\033[0m"
3535
}
3636

37+
say "Cloning the Demo App"
38+
39+
git clone --depth 1 https://github.com/pytorch-labs/executorch-examples.git
40+
3741
say "Installing CoreML Backend Requirements"
3842

3943
./backends/apple/coreml/scripts/install_requirements.sh

.ci/scripts/test_llava.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ run_and_verify() {
154154
EXPECTED_PREFIX="ASSISTANT: image captures a basketball game in progress, with several players on the court. One of the players is dribbling the ball, while the others are in various"
155155
else
156156
# set the expected prefix to be the same as prompt because there's a bug in sdpa_with_kv_cache that causes <unk> tokens.
157-
EXPECTED_PREFIX="ASSISTANT:"
157+
EXPECTED_PREFIX="ASSISTANT: image"
158158
fi
159159
if [[ "${RESULT}" == *"${EXPECTED_PREFIX}"* ]]; then
160160
echo "Expected result prefix: ${EXPECTED_PREFIX}"

.github/release.yml

Lines changed: 43 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,57 +15,82 @@ changelog:
1515
- title: ARM
1616
labels:
1717
- "release notes: arm"
18+
- "module: arm"
19+
- "partner: arm"
1820
- title: NXP
19-
labels:
21+
labels:
2022
- "release notes: nxp"
23+
- "module: nxp"
2124
- title: Exir
22-
labels:
25+
labels:
2326
- "release notes: exir"
27+
- "module: exir"
2428
- title: Misc
25-
labels:
29+
labels:
2630
- "release notes: misc"
2731
- title: Apple
28-
labels:
32+
labels:
2933
- "release notes: apple"
34+
- "module: coreml"
35+
- "module: mps"
36+
- title: Android
37+
labels:
38+
- "module: android"
39+
- title: IOS
40+
labels:
41+
- "module: ios"
3042
- title: Build
31-
labels:
43+
labels:
3244
- "release notes: build"
3345
- title: Vulkan
34-
labels:
46+
labels:
3547
- "release notes: vulkan"
48+
- "module: vulkan"
3649
- title: Cadence
37-
labels:
50+
labels:
3851
- "release notes: cadence"
52+
- "module: cadence"
3953
- title: Runtime
40-
labels:
54+
labels:
4155
- "release notes: runtime"
56+
- "module: runtime"
4257
- title: XNNPACK
43-
labels:
58+
labels:
4459
- "release notes: xnnpack"
60+
- "module: xnnpack"
4561
- title: Devtools
46-
labels:
62+
labels:
4763
- "release notes: devtools"
64+
- "module: devtools"
4865
- title: Examples
49-
labels:
66+
labels:
5067
- "release notes: examples"
68+
- title: LLM
69+
labels:
70+
- "module: llm"
5171
- title: Mediatek
52-
labels:
72+
labels:
5373
- "release notes: mediatek"
74+
- "partner: mediatek"
5475
- title: Openvino
55-
labels:
76+
labels:
5677
- "release notes: openvino"
5778
- title: Qualcomm
58-
labels:
79+
labels:
5980
- "release notes: qualcomm"
81+
- "partner: qualcomm"
82+
- "module: qnn"
6083
- title: Training
61-
labels:
84+
labels:
6285
- "release notes: training"
86+
- "module: training"
6387
- title: Quantization
64-
labels:
88+
labels:
6589
- "release notes: quantization"
6690
- title: Ops & kernels
67-
labels:
68-
- "release notes: ops & kernels"
91+
labels:
92+
- "release notes: ops & kernels"
93+
- "module: kernels"
6994
- title: Other Changes
7095
labels:
7196
- "*"

.github/workflows/_android.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,18 @@ jobs:
1414
with:
1515
runner: linux.2xlarge
1616
docker-image: executorch-ubuntu-22.04-clang12-android
17-
submodules: 'true'
17+
submodules: 'recursive'
1818
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
1919
timeout: 90
2020
upload-artifact: android-apps
2121
upload-artifact-to-s3: true
2222
script: |
2323
set -eux
2424
25+
# Use sccache for NDK compiler as well
26+
export CMAKE_CXX_COMPILER_LAUNCHER=sccache
27+
export CMAKE_C_COMPILER_LAUNCHER=sccache
28+
2529
# The generic Linux job chooses to use base env, not the one setup by the image
2630
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
2731
conda activate "${CONDA_ENV}"
@@ -36,8 +40,9 @@ jobs:
3640
cp ${BUILD_AAR_DIR}/executorch.aar $ARTIFACTS_DIR_NAME
3741
3842
mkdir -p ${ARTIFACTS_DIR_NAME}/library_test_dir
39-
bash .ci/scripts/build_android_instrumentation.sh
40-
cp ${BUILD_AAR_DIR}/executorch_android/build/outputs/apk/androidTest/debug/executorch_android-debug-androidTest.apk "${ARTIFACTS_DIR_NAME}/library_test_dir"
43+
bash extension/android/executorch_android/android_test_setup.sh
44+
(cd extension/android; ANDROID_HOME="${ANDROID_SDK:-/opt/android/sdk}" ./gradlew :executorch_android:assembleAndroidTest)
45+
cp extension/android/executorch_android/build/outputs/apk/androidTest/debug/executorch_android-debug-androidTest.apk "${ARTIFACTS_DIR_NAME}/library_test_dir"
4146
4247
mkdir -p ${ARTIFACTS_DIR_NAME}/fp32-xnnpack-custom
4348
bash examples/models/llama/install_requirements.sh
@@ -130,7 +135,8 @@ jobs:
130135
# https://github.com/ReactiveCircus/android-emulator-runner. The max number
131136
# of cores we can set is 6, any higher number will be reduced to 6.
132137
cores: 6
133-
ram-size: 12288M
138+
ram-size: 16384M
139+
heap-size: 12288M
134140
force-avd-creation: false
135141
disable-animations: true
136142
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: android-perf (private devices)
2+
3+
on:
4+
schedule:
5+
- cron: 0 0,4,8,12,16,20 * * *
6+
pull_request:
7+
paths:
8+
- .github/workflows/android-perf-private-device-experiment.yml
9+
push:
10+
branches:
11+
- main
12+
paths:
13+
- .github/workflows/android-perf-private-device-experiment.yml
14+
# Note: GitHub has an upper limit of 10 inputs
15+
workflow_dispatch:
16+
inputs:
17+
models:
18+
description: Models to be benchmarked
19+
required: false
20+
type: string
21+
default: mv3,meta-llama/Llama-3.2-1B-Instruct-SpinQuant_INT4_EO8,meta-llama/Llama-3.2-1B-Instruct-QLORA_INT4_EO8
22+
devices:
23+
description: Target devices to run benchmark
24+
required: false
25+
type: string
26+
default: google_pixel_3_private_rooted
27+
benchmark_configs:
28+
description: The list of configs used the benchmark
29+
required: false
30+
type: string
31+
workflow_call:
32+
inputs:
33+
models:
34+
description: Models to be benchmarked
35+
required: false
36+
type: string
37+
default: mv3,meta-llama/Llama-3.2-1B-Instruct-SpinQuant_INT4_EO8,meta-llama/Llama-3.2-1B-Instruct-QLORA_INT4_EO8
38+
devices:
39+
description: Target devices to run benchmark
40+
required: false
41+
type: string
42+
default: google_pixel_3_private_rooted
43+
benchmark_configs:
44+
description: The list of configs used the benchmark
45+
required: false
46+
type: string
47+
48+
concurrency:
49+
group: android-perf-private-devices-${{ github.event.pull_request.number || github.ref_name }}-${{ github.ref_type == 'branch' && github.sha }}-${{ github.event_name == 'workflow_dispatch' }}-${{ github.event_name == 'schedule' }}
50+
cancel-in-progress: true
51+
52+
jobs:
53+
android:
54+
uses: ./.github/workflows/android-perf.yml
55+
secrets: inherit
56+
permissions:
57+
id-token: write
58+
contents: read
59+
with:
60+
models: ${{ inputs.models || 'mv3,meta-llama/Llama-3.2-1B-Instruct-SpinQuant_INT4_EO8,meta-llama/Llama-3.2-1B-Instruct-QLORA_INT4_EO8' }}
61+
devices: google_pixel_3_private_rooted
62+
benchmark_configs: ${{ inputs.benchmark_configs }}

.github/workflows/android-perf.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,14 +345,18 @@ jobs:
345345
with:
346346
runner: linux.2xlarge
347347
docker-image: executorch-ubuntu-22.04-clang12-android
348-
submodules: 'true'
348+
submodules: 'recursive'
349349
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
350350
timeout: 90
351351
upload-artifact: android-apps
352352
upload-artifact-to-s3: true
353353
script: |
354354
set -eux
355355
356+
# Use sccache for NDK compiler as well
357+
export CMAKE_CXX_COMPILER_LAUNCHER=sccache
358+
export CMAKE_C_COMPILER_LAUNCHER=sccache
359+
356360
# The generic Linux job chooses to use base env, not the one setup by the image
357361
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
358362
conda activate "${CONDA_ENV}"
@@ -392,7 +396,7 @@ jobs:
392396
fail-fast: false
393397
with:
394398
# Due to scheduling a job may be pushed beyond the default 60m threshold
395-
timeout: 120
399+
timeout: 240
396400
device-type: android
397401
runner: linux.2xlarge
398402
test-infra-ref: ''

.github/workflows/android-release-artifacts.yml

Lines changed: 42 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ on:
77
description: Version name to be uploaded for AAR release
88
required: false
99
type: string
10+
upload_to_maven:
11+
description: Upload the AAR to maven staging repository
12+
required: false
13+
type: boolean
14+
schedule:
15+
- cron: 0 10 * * *
1016

1117
concurrency:
1218
group: ${{ github.workflow }}-${{ github.ref }}
@@ -22,6 +28,10 @@ jobs:
2228
shell: bash
2329
run: |
2430
VERSION="${{ inputs.version }}"
31+
if [ -z "$VERSION" ]; then
32+
echo "No version name specified. Will create a snapshot AAR"
33+
exit 0
34+
fi
2535
if curl -I "https://ossci-android.s3.amazonaws.com/executorch/release/${VERSION}/executorch.aar" | grep "200 OK"; then
2636
echo "AAR already exists at https://ossci-android.s3.amazonaws.com/executorch/release/${VERSION}/executorch.aar"
2737
echo "Will skip build/upload"
@@ -31,27 +41,45 @@ jobs:
3141
build-aar:
3242
name: build-aar
3343
needs: check-if-aar-exists
34-
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
44+
if: ${{ !github.event.pull_request.head.repo.fork }}
45+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@release/2.7
46+
secrets: inherit
3547
permissions:
3648
id-token: write
3749
contents: read
3850
with:
39-
runner: linux.2xlarge
51+
secrets-env: EXECUTORCH_MAVEN_SIGNING_KEYID EXECUTORCH_MAVEN_SIGNING_PASSWORD EXECUTORCH_MAVEN_CENTRAL_PASSWORD EXECUTORCH_MAVEN_CENTRAL_USERNAME EXECUTORCH_MAVEN_SIGNING_GPG_KEY_CONTENTS
52+
# As this job has access to Maven credential, run this on a fresh ephemeral runner
53+
runner: ephemeral.linux.2xlarge
4054
docker-image: executorch-ubuntu-22.04-clang12-android
41-
submodules: 'true'
55+
submodules: 'recursive'
4256
ref: ${{ github.sha }}
4357
timeout: 90
4458
upload-artifact: android-apps
4559
upload-artifact-to-s3: true
4660
script: |
4761
set -eux
4862
63+
# Use sccache for NDK compiler as well
64+
export CMAKE_CXX_COMPILER_LAUNCHER=sccache
65+
export CMAKE_C_COMPILER_LAUNCHER=sccache
66+
4967
# The generic Linux job chooses to use base env, not the one setup by the image
5068
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
5169
conda activate "${CONDA_ENV}"
5270
PYTHON_EXECUTABLE=python bash .ci/scripts/setup-linux.sh --build-tool buck2
5371
export ARTIFACTS_DIR_NAME=artifacts-to-be-uploaded
5472
73+
mkdir -p ~/.gradle
74+
touch ~/.gradle/gradle.properties
75+
echo "signing.keyId=${SECRET_EXECUTORCH_MAVEN_SIGNING_KEYID}" >> ~/.gradle/gradle.properties
76+
echo "signing.password=${SECRET_EXECUTORCH_MAVEN_SIGNING_PASSWORD}" >> ~/.gradle/gradle.properties
77+
echo "mavenCentralUsername=${SECRET_EXECUTORCH_MAVEN_CENTRAL_USERNAME}" >> ~/.gradle/gradle.properties
78+
echo "mavenCentralPassword=${SECRET_EXECUTORCH_MAVEN_CENTRAL_PASSWORD}" >> ~/.gradle/gradle.properties
79+
echo "signing.secretKeyRingFile=/tmp/secring.gpg" >> ~/.gradle/gradle.properties
80+
81+
echo -n "$SECRET_EXECUTORCH_MAVEN_SIGNING_GPG_KEY_CONTENTS" | base64 -d > /tmp/secring.gpg
82+
5583
# Build AAR Package
5684
mkdir aar-out
5785
export BUILD_AAR_DIR=aar-out
@@ -61,6 +89,12 @@ jobs:
6189
6290
shasum -a 256 "${ARTIFACTS_DIR_NAME}/executorch.aar"
6391
92+
# Publish to maven staging
93+
UPLOAD_TO_MAVEN="${{ inputs.upload_to_maven }}"
94+
if [[ "$UPLOAD_TO_MAVEN" == "true" ]]; then
95+
(cd aar-out; ANDROID_HOME="${ANDROID_SDK:-/opt/android/sdk}" ./gradlew :executorch_android:publishToMavenCentral)
96+
fi
97+
6498
upload-release-aar:
6599
name: upload-release-aar
66100
needs: build-aar
@@ -84,6 +118,8 @@ jobs:
84118
pip install awscli==1.32.18
85119
AWS_CMD="aws s3 cp"
86120
VERSION="${{ inputs.version }}"
87-
VERSION_NAME="${VERSION:-temp_snapshot}"
88-
${AWS_CMD} executorch.aar s3://ossci-android/executorch/release/${VERSION_NAME}/executorch.aar --acl public-read
89-
${AWS_CMD} executorch.aar.sha256sums s3://ossci-android/executorch/release/${VERSION_NAME}/executorch.aar.sha256sums --acl public-read
121+
if [ -z "$VERSION" ]; then
122+
VERSION="snapshot-$(date +"%Y%m%d")"
123+
fi
124+
${AWS_CMD} executorch.aar s3://ossci-android/executorch/release/${VERSION}/executorch.aar --acl public-read
125+
${AWS_CMD} executorch.aar.sha256sums s3://ossci-android/executorch/release/${VERSION}/executorch.aar.sha256sums --acl public-read

0 commit comments

Comments
 (0)