Skip to content

Commit 7384b78

Browse files
committed
Merge branch 'main' into distribute-jobs-to-private-pools
2 parents 2e76fc5 + 0479dcd commit 7384b78

File tree

230 files changed

+9635
-1846
lines changed

Some content is hidden

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

230 files changed

+9635
-1846
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
a3942627f5ac048e06b4b1d703b0a6a53bf6da5b
1+
eea657ddbdeb1118943a92fb73c289985c3ee1ba
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ab43fe4bdf5ccd82897f0e982c451a0127bd175e
1+
6fc0ad22f0a07b6f38d138861c56a765d5a9bb02

.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-qnn-sdk.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ set_up_aot() {
3333
-DEXECUTORCH_BUILD_DEVTOOLS=ON \
3434
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
3535
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
36+
-DEXECUTORCH_BUILD_EXTENSION_EXTENSION_LLM=ON \
37+
-DEXECUTORCH_BUILD_EXTENSION_EXTENSION_LLM_RUNNER=ON \
3638
-DEXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR=ON \
3739
-DEXECUTORCH_BUILD_EXTENSION_TENSOR=ON \
3840
-DEXECUTORCH_ENABLE_EVENT_TRACER=ON \

.ci/scripts/setup-emscripten.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@
77

88
set -ex
99

10+
# need version >= 17
11+
install_node() {
12+
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
13+
source "$HOME/.nvm/nvm.sh"
14+
nvm install 22
15+
}
16+
1017
install_emscripten() {
1118
git clone https://github.com/emscripten-core/emsdk.git
1219
pushd emsdk || return
@@ -16,4 +23,5 @@ install_emscripten() {
1623
popd || return
1724
}
1825

26+
install_node
1927
install_emscripten

.ci/scripts/test_llama.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ cmake_install_executorch_libraries() {
150150
echo "Installing libexecutorch.a, libextension_module.so, libportable_ops_lib.a"
151151
rm -rf cmake-out
152152
retry cmake --preset llm \
153+
-DBUILD_TESTING=OFF \
153154
-DCMAKE_INSTALL_PREFIX=cmake-out \
154155
-DCMAKE_BUILD_TYPE="$CMAKE_BUILD_TYPE" \
155156
-DEXECUTORCH_BUILD_QNN="$QNN" \

.ci/scripts/test_llama_torchao_lowbit.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ cmake -DPYTHON_EXECUTABLE=python \
2929
-DEXECUTORCH_ENABLE_LOGGING=1 \
3030
-DCMAKE_BUILD_TYPE=Release \
3131
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
32+
-DEXECUTORCH_BUILD_EXTENSION_LLM=ON \
33+
-DEXECUTORCH_BUILD_EXTENSION_LLM_RUNNER=ON \
3234
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
3335
-DEXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR=ON \
3436
-DEXECUTORCH_BUILD_EXTENSION_TENSOR=ON \

.ci/scripts/test_llava.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ EXECUTORCH_COMMON_CMAKE_ARGS=" \
3838
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
3939
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
4040
-DEXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR=ON \
41+
-DEXECUTORCH_BUILD_EXTENSION_LLM=ON \
42+
-DEXECUTORCH_BUILD_EXTENSION_LLM_RUNNER=ON \
4143
-DEXECUTORCH_BUILD_EXTENSION_TENSOR=ON \
4244
-DEXECUTORCH_BUILD_KERNELS_LLM=ON \
4345
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \

.ci/scripts/test_model.sh

Lines changed: 40 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,22 @@ test_model_with_qnn() {
188188
EXPORT_SCRIPT=edsr
189189
# Additional deps for edsr
190190
pip install piq
191+
elif [[ "${MODEL_NAME}" == "cvt" ]]; then
192+
EXPORT_SCRIPT=cvt
193+
elif [[ "${MODEL_NAME}" == "dit" ]]; then
194+
EXPORT_SCRIPT=dit
195+
elif [[ "${MODEL_NAME}" == "efficientnet" ]]; then
196+
EXPORT_SCRIPT=efficientnet
197+
elif [[ "${MODEL_NAME}" == "focalnet" ]]; then
198+
EXPORT_SCRIPT=focalnet
199+
elif [[ "${MODEL_NAME}" == "mobilevit_v1" ]]; then
200+
EXPORT_SCRIPT=mobilevit_v1
201+
elif [[ "${MODEL_NAME}" == "mobilevit_v2" ]]; then
202+
EXPORT_SCRIPT=mobilevit_v2
203+
elif [[ "${MODEL_NAME}" == "pvt" ]]; then
204+
EXPORT_SCRIPT=pvt
205+
elif [[ "${MODEL_NAME}" == "swin" ]]; then
206+
EXPORT_SCRIPT=swin_transformer
191207
elif [[ "${MODEL_NAME}" == "albert" ]]; then
192208
EXPORT_SCRIPT=albert
193209
elif [[ "${MODEL_NAME}" == "bert" ]]; then
@@ -196,6 +212,8 @@ test_model_with_qnn() {
196212
EXPORT_SCRIPT=distilbert
197213
elif [[ "${MODEL_NAME}" == "eurobert" ]]; then
198214
EXPORT_SCRIPT=eurobert
215+
elif [[ "${MODEL_NAME}" == "roberta" ]]; then
216+
EXPORT_SCRIPT=roberta
199217
else
200218
echo "Unsupported model $MODEL_NAME"
201219
exit 1
@@ -210,10 +228,13 @@ test_model_with_qnn() {
210228
"dl3"|"mv3"|"mv2"|"ic4"|"ic3"|"vit"|"mb"|"w2l")
211229
SCRIPT_FOLDER=scripts
212230
;;
213-
"albert"|"bert"|"distilbert")
231+
"cvt"|"dit"|"focalnet"|"mobilevit_v2"|"pvt"|"swin")
232+
SCRIPT_FOLDER=oss_scripts
233+
;;
234+
"albert"|"bert"|"distilbert"|"roberta"|"efficientnet"|"mobilevit_v1")
214235
pip install evaluate
215236
SCRIPT_FOLDER=oss_scripts
216-
# Bert models running in 16bit will encounter op validation fail on some operations,
237+
# 16bit models will encounter op validation fail on some operations,
217238
# which requires CHIPSET >= SM8550.
218239
QNN_CHIPSET=SM8550
219240
;;
@@ -232,21 +253,24 @@ test_model_with_qnn() {
232253
# @param should_test If true, build and test the model using the coreml_executor_runner.
233254
test_model_with_coreml() {
234255
local should_test="$1"
256+
local test_with_pybindings="$2"
257+
local dtype="$3"
235258

236259
if [[ "${BUILD_TOOL}" != "cmake" ]]; then
237260
echo "coreml only supports cmake."
238261
exit 1
239262
fi
240263

241-
DTYPE=float16
264+
RUN_WITH_PYBINDINGS=""
265+
if [[ "${test_with_pybindings}" == true ]]; then
266+
echo \"Running with pybindings\"
267+
export RUN_WITH_PYBINDINGS="--run_with_pybindings"
268+
fi
242269

243-
"${PYTHON_EXECUTABLE}" -m examples.apple.coreml.scripts.export --model_name="${MODEL_NAME}" --compute_precision "${DTYPE}" --use_partitioner
270+
"${PYTHON_EXECUTABLE}" -m examples.apple.coreml.scripts.export --model_name="${MODEL_NAME}" --compute_precision ${dtype} --use_partitioner ${RUN_WITH_PYBINDINGS}
244271
EXPORTED_MODEL=$(find "." -type f -name "${MODEL_NAME}*.pte" -print -quit)
245272

246273
if [ -n "$EXPORTED_MODEL" ]; then
247-
EXPORTED_MODEL_WITH_DTYPE="${EXPORTED_MODEL%.pte}_${DTYPE}.pte"
248-
mv "$EXPORTED_MODEL" "$EXPORTED_MODEL_WITH_DTYPE"
249-
EXPORTED_MODEL="$EXPORTED_MODEL_WITH_DTYPE"
250274
echo "OK exported model: $EXPORTED_MODEL"
251275
else
252276
echo "[error] failed to export model: no .pte file found"
@@ -303,7 +327,15 @@ elif [[ "${BACKEND}" == *"coreml"* ]]; then
303327
if [[ "${BACKEND}" == *"test"* ]]; then
304328
should_test_coreml=true
305329
fi
306-
test_model_with_coreml "${should_test_coreml}"
330+
test_with_pybindings=false
331+
if [[ "${BACKEND}" == *"pybind"* ]]; then
332+
test_with_pybindings=true
333+
fi
334+
dtype=float16
335+
if [[ "${BACKEND}" == *"float32"* ]]; then
336+
dtype=float32
337+
fi
338+
test_model_with_coreml "${should_test_coreml}" "${test_with_pybindings}" "${dtype}"
307339
if [[ $? -eq 0 ]]; then
308340
prepare_artifacts_upload
309341
fi

0 commit comments

Comments
 (0)