Skip to content

Commit 3d24418

Browse files
authored
Merge branch 'main' into mean_dim_pass
2 parents 80c2de2 + ee752f0 commit 3d24418

File tree

497 files changed

+14000
-2551
lines changed

Some content is hidden

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

497 files changed

+14000
-2551
lines changed

.ci/docker/ci_commit_pins/pytorch.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
c42ac54d9e817bf0a0366eb78e6c8beba4d5eff5
1+
00e3eea170ce5db8ea9c62ce5e48f13886cd6d20

.ci/docker/ci_commit_pins/torchao.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0916b5b29b092afcbf2b898caae49abe80662bac

.ci/scripts/build-qnn-sdk.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
# LICENSE file in the root directory of this source tree.
77

88
set -eux
9+
set -o xtrace
910

1011
build_qnn_backend() {
1112
echo "Start building qnn backend."

.ci/scripts/test.sh

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,30 @@ test_model_with_qnn() {
156156
export PYTHONPATH=$EXECUTORCH_ROOT/..
157157

158158
if [[ "${MODEL_NAME}" == "dl3" ]]; then
159-
"${PYTHON_EXECUTABLE}" -m examples.qualcomm.scripts.deeplab_v3 -b ${CMAKE_OUTPUT_DIR} -m SM8550 --compile_only --download
160-
EXPORTED_MODEL=./deeplab_v3/dlv3_qnn.pte
159+
EXPORT_SCRIPT=deeplab_v3
160+
EXPORTED_MODEL_NAME=dlv3_qnn.pte
161+
elif [[ "${MODEL_NAME}" == "mv3" ]]; then
162+
EXPORT_SCRIPT=mobilenet_v3
163+
EXPORTED_MODEL_NAME=mv3_qnn.pte
164+
elif [[ "${MODEL_NAME}" == "mv2" ]]; then
165+
EXPORT_SCRIPT=mobilenet_v2
166+
EXPORTED_MODEL_NAME=mv2_qnn.pte
167+
elif [[ "${MODEL_NAME}" == "ic4" ]]; then
168+
EXPORT_SCRIPT=inception_v4
169+
EXPORTED_MODEL_NAME=ic4_qnn.pte
170+
elif [[ "${MODEL_NAME}" == "ic3" ]]; then
171+
EXPORT_SCRIPT=inception_v3
172+
EXPORTED_MODEL_NAME=ic3_qnn.pte
173+
elif [[ "${MODEL_NAME}" == "vit" ]]; then
174+
EXPORT_SCRIPT=torchvision_vit
175+
EXPORTED_MODEL_NAME=vit_qnn.pte
161176
fi
177+
178+
# Use SM8450 for S22, SM8550 for S23, and SM8560 for S24
179+
QNN_CHIPSET=SM8450
180+
181+
"${PYTHON_EXECUTABLE}" -m examples.qualcomm.scripts.${EXPORT_SCRIPT} -b ${CMAKE_OUTPUT_DIR} -m ${QNN_CHIPSET} --compile_only
182+
EXPORTED_MODEL=./${EXPORT_SCRIPT}/${EXPORTED_MODEL_NAME}
162183
}
163184

164185
if [[ "${BACKEND}" == "portable" ]]; then

.ci/scripts/test_llava.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ run_and_verify() {
9191
RESULT=$(cat result.txt)
9292
# set the expected prefix to be the same as prompt because there's a bug in sdpa_with_kv_cache that causes <unk> tokens.
9393
if [[ "$(uname)" == "Darwin" ]]; then
94-
EXPECTED_PREFIX="ASSISTANT: image captures a basketball game in progress on a basketball court. There are several players on the court, with one player in the foreground holding a basketball, and"
94+
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"
9595
else
9696
# set the expected prefix to be the same as prompt because there's a bug in sdpa_with_kv_cache that causes <unk> tokens.
9797
EXPECTED_PREFIX="ASSISTANT:"

.github/pytorch-probot.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# The schema is from https://github.com/pytorch/pytorch/blob/main/.github/pytorch-probot.yml
22
ciflow_push_tags:
3+
- ciflow/android
4+
- ciflow/apple
35
- ciflow/nightly
46
- ciflow/trunk
57
- ciflow/binaries

.github/workflows/android-perf.yml

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ on:
1515
description: Target devices to run benchmark
1616
required: false
1717
type: string
18-
default: samsung_galaxy_s2x
18+
default: samsung_galaxy_s22
1919
delegates:
2020
description: Backend delegates
2121
required: false
@@ -45,7 +45,7 @@ on:
4545
description: Target devices to run benchmark
4646
required: false
4747
type: string
48-
default: samsung_galaxy_s2x
48+
default: samsung_galaxy_s22
4949
delegates:
5050
description: Backend delegates
5151
required: false
@@ -84,9 +84,9 @@ jobs:
8484
# Separate default values from the workflow dispatch. To ensure defaults are accessible
8585
# during scheduled runs and to provide flexibility for different defaults between
8686
# on-demand and periodic benchmarking.
87-
CRON_DEFAULT_MODELS: "stories110M"
88-
CRON_DEFAULT_DEVICES: "samsung_galaxy_s2x"
89-
CRON_DEFAULT_DELEGATES: "xnnpack"
87+
CRON_DEFAULT_MODELS: "stories110M,dl3,mv3,mv2,ic4,ic3,vit"
88+
CRON_DEFAULT_DEVICES: "samsung_galaxy_s22"
89+
CRON_DEFAULT_DELEGATES: "xnnpack,qnn"
9090
run: |
9191
set -ex
9292
MODELS="${{ inputs.models }}"
@@ -104,7 +104,7 @@ jobs:
104104
105105
# Mapping devices to their corresponding device-pool-arn
106106
declare -A DEVICE_POOL_ARNS
107-
DEVICE_POOL_ARNS[samsung_galaxy_s2x]="arn:aws:devicefarm:us-west-2:308535385114:devicepool:02a2cf0f-6d9b-45ee-ba1a-a086587469e6/e59f866a-30aa-4aa1-87b7-4510e5820dfa"
107+
DEVICE_POOL_ARNS[samsung_galaxy_s22]="arn:aws:devicefarm:us-west-2:308535385114:devicepool:02a2cf0f-6d9b-45ee-ba1a-a086587469e6/e59f866a-30aa-4aa1-87b7-4510e5820dfa"
108108
109109
# Resolve device names with their corresponding ARNs
110110
if [[ ! $(echo "$DEVICES" | jq empty 2>/dev/null) ]]; then
@@ -162,6 +162,11 @@ jobs:
162162
# Test llama2
163163
if [[ ${{ matrix.delegate }} == "xnnpack" ]]; then
164164
DELEGATE_CONFIG="xnnpack+custom+qe"
165+
elif [[ ${{ matrix.delegate }} == "qnn" ]]; then
166+
DELEGATE_CONFIG="qnn"
167+
else
168+
echo "Unsupported delegate ${{ matrix.delegate }}"
169+
exit 1
165170
fi
166171
PYTHON_EXECUTABLE=python bash .ci/scripts/test_llama.sh "${{ matrix.model }}" "${BUILD_MODE}" "${DTYPE}" "${DELEGATE_CONFIG}" "${ARTIFACTS_DIR_NAME}"
167172
else
@@ -201,9 +206,6 @@ jobs:
201206
name: build-llm-demo
202207
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
203208
needs: set-parameters
204-
strategy:
205-
matrix:
206-
tokenizer: [bpe]
207209
with:
208210
runner: linux.2xlarge
209211
docker-image: executorch-ubuntu-22.04-clang12-android
@@ -222,7 +224,7 @@ jobs:
222224
223225
# TODO: This needs to be replaced with a generic loader .apk
224226
# Build LLM Demo for Android
225-
bash build/build_android_llm_demo.sh ${{ matrix.tokenizer }} ${ARTIFACTS_DIR_NAME}
227+
bash build/build_android_llm_demo.sh ${ARTIFACTS_DIR_NAME}
226228
227229
# Upload artifacts to S3. The artifacts are needed not only by the device farm but also TorchChat
228230
upload-android-apps:
@@ -278,9 +280,8 @@ jobs:
278280
# Unlike models there are limited numbers of build flavor for apps, and the model controls whether it should build with bpe/tiktoken tokenizer.
279281
# It's okay to build all possible apps with all possible flavors in job "build-llm-demo". However, in this job, once a model is given, there is only
280282
# one app+flavor that could load and run the model.
281-
# TODO: Hard code llm_demo_bpe for now in this job.
282-
android-app-archive: https://gha-artifacts.s3.amazonaws.com/${{ github.repository }}/${{ github.run_id }}/artifact/llm_demo_bpe/app-debug.apk
283-
android-test-archive: https://gha-artifacts.s3.amazonaws.com/${{ github.repository }}/${{ github.run_id }}/artifact/llm_demo_bpe/app-debug-androidTest.apk
283+
android-app-archive: https://gha-artifacts.s3.amazonaws.com/${{ github.repository }}/${{ github.run_id }}/artifact/llm_demo/app-debug.apk
284+
android-test-archive: https://gha-artifacts.s3.amazonaws.com/${{ github.repository }}/${{ github.run_id }}/artifact/llm_demo/app-debug-androidTest.apk
284285
# NB: Need to set the default spec here so that it works for periodic too
285286
test-spec: ${{ inputs.test_spec || 'https://ossci-android.s3.amazonaws.com/executorch/android-llm-device-farm-test-spec.yml' }}
286287
# Uploaded to S3 from the previous job

.github/workflows/android.yml

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ jobs:
2424
build-llm-demo:
2525
name: build-llm-demo
2626
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
27-
strategy:
28-
matrix:
29-
tokenizer: [bpe, tiktoken]
3027
with:
3128
runner: linux.2xlarge
3229
docker-image: executorch-ubuntu-22.04-clang12-android
@@ -44,7 +41,7 @@ jobs:
4441
export ARTIFACTS_DIR_NAME=artifacts-to-be-uploaded
4542
4643
# Build LLM Demo for Android
47-
bash build/build_android_llm_demo.sh ${{ matrix.tokenizer }} ${ARTIFACTS_DIR_NAME}
44+
bash build/build_android_llm_demo.sh ${ARTIFACTS_DIR_NAME}
4845
4946
# Upload artifacts to S3. The artifacts are needed not only by the device farm but also TorchChat
5047
upload-artifacts:
@@ -155,13 +152,6 @@ jobs:
155152
id-token: write
156153
contents: read
157154
uses: pytorch/test-infra/.github/workflows/mobile_job.yml@main
158-
strategy:
159-
matrix:
160-
# https://github.com/pytorch/executorch/blob/main/examples/demo-apps/android/LlamaDemo/README.md#alternative-2-build-from-local-machine
161-
# mentions that tiktoken is only for Llama3. So, we can export it later in another archive
162-
# like https://ossci-assets.s3.amazonaws.com/executorch-android-llama2-7b-0717.zip when this is
163-
# updated to run Llama3
164-
tokenizer: [bpe]
165155
with:
166156
device-type: android
167157
runner: linux.2xlarge
@@ -171,8 +161,8 @@ jobs:
171161
# This is the custom Android device pool that only includes Samsung Galaxy S2x
172162
device-pool-arn: arn:aws:devicefarm:us-west-2:308535385114:devicepool:02a2cf0f-6d9b-45ee-ba1a-a086587469e6/e59f866a-30aa-4aa1-87b7-4510e5820dfa
173163
# Uploaded to S3 from the previous job, the name of the app comes from the project itself
174-
android-app-archive: https://gha-artifacts.s3.amazonaws.com/${{ github.repository }}/${{ github.run_id }}/artifact/llm_demo_${{ matrix.tokenizer }}/app-debug.apk
175-
android-test-archive: https://gha-artifacts.s3.amazonaws.com/${{ github.repository }}/${{ github.run_id }}/artifact/llm_demo_${{ matrix.tokenizer }}/app-debug-androidTest.apk
164+
android-app-archive: https://gha-artifacts.s3.amazonaws.com/${{ github.repository }}/${{ github.run_id }}/artifact/llm_demo/app-debug.apk
165+
android-test-archive: https://gha-artifacts.s3.amazonaws.com/${{ github.repository }}/${{ github.run_id }}/artifact/llm_demo/app-debug-androidTest.apk
176166
test-spec: https://ossci-android.s3.amazonaws.com/executorch/android-llm-device-farm-test-spec.yml
177167
# Among the input, this is the biggest file, so it is cached on AWS to make the test faster. Note that the file is deleted by AWS after 30
178168
# days and the job will automatically re-upload the file when that happens.

0 commit comments

Comments
 (0)