Skip to content

Commit e14a700

Browse files
authored
Merge branch 'main' into add-dim-order-clone-transform
2 parents ffd1549 + 544cece commit e14a700

File tree

1,696 files changed

+103224
-32222
lines changed

Some content is hidden

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

1,696 files changed

+103224
-32222
lines changed

.Package.swift/kernels_torchao/dummy.swift

Whitespace-only changes.

.Package.swift/kernels_torchao_debug/dummy.swift

Whitespace-only changes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
a3942627f5ac048e06b4b1d703b0a6a53bf6da5b
1+
40b02a2dc61bbf901a2df91719f47c98d65368ec
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ab43fe4bdf5ccd82897f0e982c451a0127bd175e
1+
e7152ff8a6a929a0db7f3f4a72a5b6d471769cd3

.ci/docker/common/install_zephyr.sh

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88

99
set -ex
1010

11+
# shellcheck source=/dev/null
12+
source "$(dirname "${BASH_SOURCE[0]}")/utils.sh"
13+
1114
# Double check if the NDK version is set
1215
[ -n "${ZEPHYR_SDK}" ]
1316

@@ -77,16 +80,8 @@ install_prerequiresites() {
7780
chmod +x kitware-archive.sh && \
7881
./kitware-archive.sh && \
7982
rm -f kitware-archive.sh
80-
useradd -d /home/zephyruser -m -s /bin/bash zephyruser
81-
}
82-
83-
install_sdk() {
84-
wget https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.16.0/zephyr-sdk-0.16.0_linux-x86_64.tar.xz && \
85-
tar -xf zephyr-sdk-0.16.0_linux-x86_64.tar.xz && \
86-
rm -f zephyr-sdk-0.16.0_linux-x86_64.tar.xz && \
87-
cd zephyr-sdk-0.16.0/ && \
88-
./setup.sh -c -t arm-zephyr-eabi
83+
pip_install --no-cache-dir west
84+
pip_install pyelftools
8985
}
9086

9187
install_prerequiresites
92-
install_sdk

.ci/docker/ubuntu/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,9 @@ ARG ARM_SDK
8686

8787
ARG ZEPHYR_SDK
8888
COPY ./common/install_zephyr.sh install_zephyr.sh
89+
COPY ./common/utils.sh utils.sh
8990
RUN if [ -n "${ZEPHYR_SDK}" ]; then bash ./install_zephyr.sh; fi
90-
RUN rm install_zephyr.sh
91+
RUN rm install_zephyr.sh utils.sh
9192

9293
ARG QNN_SDK
9394

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ build_neuron_backend() {
1414
export NEURON_BUFFER_ALLOCATOR_LIB=${MEDIATEK_SDK_ROOT}/libneuron_buffer_allocator.so
1515
export EXECUTORCH_ROOT="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/../.." && pwd)"
1616

17-
1817
cd ${EXECUTORCH_ROOT}
1918
./backends/mediatek/scripts/mtk_build.sh
19+
./examples/mediatek/mtk_build_examples.sh
2020
}
2121

2222
build_neuron_backend

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@ set -o xtrace
1111

1212
build_qnn_backend() {
1313
echo "Start building qnn backend."
14-
export ANDROID_NDK_ROOT=${ANDROID_NDK_ROOT:-/opt/ndk}
15-
export QNN_SDK_ROOT=${QNN_SDK_ROOT:-/tmp/qnn/2.28.0.241029}
14+
# Source QNN configuration
15+
source "$(dirname "${BASH_SOURCE[0]}")/../../backends/qualcomm/scripts/install_qnn_sdk.sh"
16+
setup_android_ndk
17+
install_qnn
1618
export EXECUTORCH_ROOT="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/../.." && pwd)"
1719

1820
parallelism=$(( $(nproc) - 1 ))
@@ -33,6 +35,8 @@ set_up_aot() {
3335
-DEXECUTORCH_BUILD_DEVTOOLS=ON \
3436
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
3537
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
38+
-DEXECUTORCH_BUILD_EXTENSION_EXTENSION_LLM=ON \
39+
-DEXECUTORCH_BUILD_EXTENSION_EXTENSION_LLM_RUNNER=ON \
3640
-DEXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR=ON \
3741
-DEXECUTORCH_BUILD_EXTENSION_TENSOR=ON \
3842
-DEXECUTORCH_ENABLE_EVENT_TRACER=ON \

.ci/scripts/gather_benchmark_configs.py

Lines changed: 98 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,65 @@
1616
from examples.models import MODEL_NAME_TO_MODEL
1717

1818

19-
# Device pools for AWS Device Farm
19+
DEVICE_POOLS_REGEX = re.compile(r"(?P<device_name>[^\+]+)\+(?P<variant>[^\+]+)")
20+
# Device pools for AWS Device Farm. Initially, I choose to distribute models to these pool
21+
# round-robin for simplicity. For public pool, only one per device type is needed because
22+
# AWS will scale the number of devices there for us. However, for private pool, we need to
23+
# manually maintain multiple pools of the same device to evenly distribute models there.
24+
# The pool ARNs are extracted from the output of the following command:
25+
# aws devicefarm list-device-pools \
26+
# --arn arn:aws:devicefarm:us-west-2:308535385114:project:02a2cf0f-6d9b-45ee-ba1a-a086587469e6 \
27+
# --region us-west-2
2028
DEVICE_POOLS = {
21-
"apple_iphone_15": "arn:aws:devicefarm:us-west-2:308535385114:devicepool:02a2cf0f-6d9b-45ee-ba1a-a086587469e6/3b5acd2e-92e2-4778-b651-7726bafe129d",
22-
"apple_iphone_15+ios_18": "arn:aws:devicefarm:us-west-2:308535385114:devicepool:02a2cf0f-6d9b-45ee-ba1a-a086587469e6/12c8b15c-8d03-4e07-950d-0a627e7595b4",
23-
"samsung_galaxy_s22": "arn:aws:devicefarm:us-west-2:308535385114:devicepool:02a2cf0f-6d9b-45ee-ba1a-a086587469e6/e59f866a-30aa-4aa1-87b7-4510e5820dfa",
24-
"samsung_galaxy_s22_private": "arn:aws:devicefarm:us-west-2:308535385114:devicepool:02a2cf0f-6d9b-45ee-ba1a-a086587469e6/ea6b049d-1508-4233-9a56-5d9eacbe1078",
25-
"samsung_galaxy_s24": "arn:aws:devicefarm:us-west-2:308535385114:devicepool:02a2cf0f-6d9b-45ee-ba1a-a086587469e6/98f8788c-2e25-4a3c-8bb2-0d1e8897c0db",
26-
"google_pixel_8_pro": "arn:aws:devicefarm:us-west-2:308535385114:devicepool:02a2cf0f-6d9b-45ee-ba1a-a086587469e6/d65096ab-900b-4521-be8b-a3619b69236a",
27-
"google_pixel_3_private_rooted": "arn:aws:devicefarm:us-west-2:308535385114:devicepool:02a2cf0f-6d9b-45ee-ba1a-a086587469e6/98d23ca8-ea9e-4fb7-b725-d402017b198d",
28-
"apple_iphone_15_private": "arn:aws:devicefarm:us-west-2:308535385114:devicepool:02a2cf0f-6d9b-45ee-ba1a-a086587469e6/55929353-2f28-4ee5-bdff-d1a95f58cb28",
29+
"apple_iphone_15": {
30+
"public": [
31+
"arn:aws:devicefarm:us-west-2:308535385114:devicepool:02a2cf0f-6d9b-45ee-ba1a-a086587469e6/3b5acd2e-92e2-4778-b651-7726bafe129d",
32+
],
33+
"ios_18_public": [
34+
"arn:aws:devicefarm:us-west-2:308535385114:devicepool:02a2cf0f-6d9b-45ee-ba1a-a086587469e6/12c8b15c-8d03-4e07-950d-0a627e7595b4",
35+
],
36+
"private": [
37+
"arn:aws:devicefarm:us-west-2:308535385114:devicepool:02a2cf0f-6d9b-45ee-ba1a-a086587469e6/55929353-2f28-4ee5-bdff-d1a95f58cb28",
38+
],
39+
"plus_private": [
40+
"arn:aws:devicefarm:us-west-2:308535385114:devicepool:02a2cf0f-6d9b-45ee-ba1a-a086587469e6/767bfb3e-a00e-4d92-998b-4eafdcf7213b",
41+
],
42+
"pro_private": [
43+
"arn:aws:devicefarm:us-west-2:308535385114:devicepool:02a2cf0f-6d9b-45ee-ba1a-a086587469e6/1394f34c-2981-4c55-aaa2-246871ac713b",
44+
"arn:aws:devicefarm:us-west-2:308535385114:devicepool:02a2cf0f-6d9b-45ee-ba1a-a086587469e6/099e8def-4609-4383-8787-76b88e500c1d",
45+
"arn:aws:devicefarm:us-west-2:308535385114:devicepool:02a2cf0f-6d9b-45ee-ba1a-a086587469e6/d6707270-b009-479e-a83a-7bdb255f9de5",
46+
],
47+
},
48+
"samsung_galaxy_s22": {
49+
"public": [
50+
"arn:aws:devicefarm:us-west-2:308535385114:devicepool:02a2cf0f-6d9b-45ee-ba1a-a086587469e6/e59f866a-30aa-4aa1-87b7-4510e5820dfa",
51+
],
52+
"private": [
53+
"arn:aws:devicefarm:us-west-2:308535385114:devicepool:02a2cf0f-6d9b-45ee-ba1a-a086587469e6/ea6b049d-1508-4233-9a56-5d9eacbe1078",
54+
"arn:aws:devicefarm:us-west-2:308535385114:devicepool:02a2cf0f-6d9b-45ee-ba1a-a086587469e6/1fa924a1-5aff-475b-8f4d-f7c6d8de4fe9",
55+
],
56+
"ultra_private": [
57+
"arn:aws:devicefarm:us-west-2:308535385114:devicepool:02a2cf0f-6d9b-45ee-ba1a-a086587469e6/5f79d72e-e229-4f9c-962f-5d37196fcfe7",
58+
],
59+
},
60+
"samsung_galaxy_s24": {
61+
"public": [
62+
"arn:aws:devicefarm:us-west-2:308535385114:devicepool:02a2cf0f-6d9b-45ee-ba1a-a086587469e6/98f8788c-2e25-4a3c-8bb2-0d1e8897c0db",
63+
],
64+
"ultra_private": [
65+
"arn:aws:devicefarm:us-west-2:308535385114:devicepool:02a2cf0f-6d9b-45ee-ba1a-a086587469e6/5f79d72e-e229-4f9c-962f-5d37196fcfe7",
66+
],
67+
},
68+
"google_pixel_8": {
69+
"pro_public": [
70+
"arn:aws:devicefarm:us-west-2:308535385114:devicepool:02a2cf0f-6d9b-45ee-ba1a-a086587469e6/d65096ab-900b-4521-be8b-a3619b69236a",
71+
],
72+
},
73+
"google_pixel_3": {
74+
"rooted_private": [
75+
"arn:aws:devicefarm:us-west-2:308535385114:devicepool:02a2cf0f-6d9b-45ee-ba1a-a086587469e6/98d23ca8-ea9e-4fb7-b725-d402017b198d",
76+
],
77+
},
2978
}
3079

3180
# Predefined benchmark configurations
@@ -318,25 +367,56 @@ def get_benchmark_configs() -> Dict[str, Dict]: # noqa: C901
318367

319368
# Add configurations for each valid device
320369
for device in devices:
370+
# Parse the device name
371+
m = re.match(DEVICE_POOLS_REGEX, device)
372+
if not m:
373+
logging.warning(
374+
f"Invalid device name: {device} is not in DEVICE_NAME+VARIANT format. Skipping."
375+
)
376+
continue
377+
378+
device_name = m.group("device_name")
379+
variant = m.group("variant")
380+
381+
if device_name not in DEVICE_POOLS:
382+
logging.warning(f"Unsupported device '{device}'. Skipping.")
383+
continue
384+
385+
if variant not in DEVICE_POOLS[device_name]:
386+
logging.warning(
387+
f"Unsupported {device}'s variant '{variant}'. Skipping."
388+
)
389+
continue
390+
391+
device_pool_count = len(DEVICE_POOLS[device_name][variant])
392+
if not device_pool_count:
393+
logging.warning(
394+
f"No device pool defined for {device}'s variant '{variant}'. Skipping."
395+
)
396+
continue
397+
398+
device_pool_index = 0
321399
for config in configs:
322-
if config == "llama3_coreml_ane" and not device.endswith("+ios_18"):
323-
device = f"{device}+ios_18"
400+
if config == "llama3_coreml_ane" and "ios_18" not in variant:
401+
variant = "ios_18_public"
324402
logging.info(
325-
f"Benchmark config '{config}' only works on iOS 18+, auto-upgraded device pool to '{device}'"
403+
f"Benchmark config '{config}' only works on iOS 18+, auto-upgraded device variant to '{variant}'"
326404
)
327405

328-
if device not in DEVICE_POOLS:
329-
logging.warning(f"Unsupported device '{device}'. Skipping.")
330-
continue
331-
332406
record = {
333407
"model": model_name,
334408
"config": config,
335-
"device_name": device,
336-
"device_arn": DEVICE_POOLS[device],
409+
"device_name": device_name,
410+
"variant": variant,
411+
"device_arn": DEVICE_POOLS[device_name][variant][
412+
device_pool_index % device_pool_count
413+
],
337414
}
338415
benchmark_configs["include"].append(record)
339416

417+
# Distribute configs to pools of the same device round-robin
418+
device_pool_index += 1
419+
340420
set_output("benchmark_configs", json.dumps(benchmark_configs))
341421

342422

.ci/scripts/setup-conda.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ set -ex
99

1010
install_conda() {
1111
pushd .ci/docker || return
12-
${CONDA_INSTALL} -y --file conda-env-ci.txt
12+
${CONDA_INSTALL} -c conda-forge -y --file conda-env-ci.txt
1313
popd || return
1414
}
1515

0 commit comments

Comments
 (0)