Skip to content

Commit edea817

Browse files
Merge branch 'main' into stdsv5
2 parents 7928d35 + 0c8879e commit edea817

File tree

351 files changed

+12335
-3162
lines changed

Some content is hidden

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

351 files changed

+12335
-3162
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/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/build_llama_android.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ install_executorch_and_backend_lib() {
1919
echo "Installing executorch and xnnpack backend"
2020
clean_executorch_install_folders
2121
mkdir cmake-android-out
22-
ANDROID_NDK=/opt/ndk
22+
ANDROID_NDK=${ANDROID_NDK:-/opt/ndk}
2323
BUCK2=buck2
2424
ANDROID_ABI=arm64-v8a
2525
cmake --preset llm \

.ci/scripts/setup-qnn-deps.sh

Lines changed: 2 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -7,47 +7,7 @@
77

88
set -ex
99

10-
verify_pkg_installed() {
11-
echo $(dpkg-query -W --showformat='${Status}\n' $1|grep "install ok installed")
12-
}
10+
source "$(dirname "${BASH_SOURCE[0]}")/../../backends/qualcomm/scripts/install_qnn_sdk.sh"
1311

14-
install_qnn() {
15-
echo "Start installing qnn."
16-
QNN_INSTALLATION_DIR=/tmp/qnn
17-
mkdir -p "${QNN_INSTALLATION_DIR}"
18-
19-
curl -Lo /tmp/v2.28.0.24.10.29.zip "https://softwarecenter.qualcomm.com/api/download/software/qualcomm_neural_processing_sdk/v2.28.0.241029.zip"
20-
echo "Finishing downloading qnn sdk."
21-
unzip -qo /tmp/v2.28.0.24.10.29.zip -d /tmp
22-
echo "Finishing unzip qnn sdk."
23-
24-
25-
# Print the content for manual verification
26-
ls -lah "/tmp/qairt"
27-
mv "/tmp/qairt"/* "${QNN_INSTALLATION_DIR}"
28-
echo "Finishing installing qnn '${QNN_INSTALLATION_DIR}' ."
29-
30-
ls -lah "${QNN_INSTALLATION_DIR}"
31-
}
32-
33-
setup_libc++() {
34-
clang_version=$1
35-
sudo apt-get update
36-
pkgs_to_check=("libc++-${clang_version}-dev")
37-
j=0
38-
while [ $j -lt ${#pkgs_to_check[*]} ]; do
39-
install_status=$(verify_pkg_installed ${pkgs_to_check[$j]})
40-
if [ "$install_status" == "" ]; then
41-
sudo apt-get install -y ${pkgs_to_check[$j]}
42-
if [[ $? -ne 0 ]]; then
43-
echo "ERROR: Failed to install required packages for libc++"
44-
exit 1
45-
fi
46-
fi
47-
j=$(( $j +1));
48-
done
49-
}
50-
51-
# This needs to match with the clang version from the Docker image
52-
setup_libc++ 12
12+
setup_libcpp 12
5313
install_qnn

.ci/scripts/test_ane_static_llama.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ pushd $EXECUTORCH_ROOT/examples/apple/coreml/llama
2828
# Download stories llama110m artifacts
2929
download_stories_model_artifacts
3030

31-
python export.py -n model.pte -p params.json -c stories110M.pt --seq_length 32 --max_seq_length 64 --dtype fp16 --coreml-quantize c4w
31+
python export.py -n model.pte -p params.json -c stories110M.pt --seq_length 32 --max_seq_length 64 --dtype fp16 --coreml-quantize c4w --embedding-quantize 4,32
3232

3333
popd

.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: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -232,21 +232,24 @@ test_model_with_qnn() {
232232
# @param should_test If true, build and test the model using the coreml_executor_runner.
233233
test_model_with_coreml() {
234234
local should_test="$1"
235+
local test_with_pybindings="$2"
236+
local dtype="$3"
235237

236238
if [[ "${BUILD_TOOL}" != "cmake" ]]; then
237239
echo "coreml only supports cmake."
238240
exit 1
239241
fi
240242

241-
DTYPE=float16
243+
RUN_WITH_PYBINDINGS=""
244+
if [[ "${test_with_pybindings}" == true ]]; then
245+
echo \"Running with pybindings\"
246+
export RUN_WITH_PYBINDINGS="--run_with_pybindings"
247+
fi
242248

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

246252
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"
250253
echo "OK exported model: $EXPORTED_MODEL"
251254
else
252255
echo "[error] failed to export model: no .pte file found"
@@ -303,7 +306,15 @@ elif [[ "${BACKEND}" == *"coreml"* ]]; then
303306
if [[ "${BACKEND}" == *"test"* ]]; then
304307
should_test_coreml=true
305308
fi
306-
test_model_with_coreml "${should_test_coreml}"
309+
test_with_pybindings=false
310+
if [[ "${BACKEND}" == *"pybind"* ]]; then
311+
test_with_pybindings=true
312+
fi
313+
dtype=float16
314+
if [[ "${BACKEND}" == *"float32"* ]]; then
315+
dtype=float32
316+
fi
317+
test_model_with_coreml "${should_test_coreml}" "${test_with_pybindings}" "${dtype}"
307318
if [[ $? -eq 0 ]]; then
308319
prepare_artifacts_upload
309320
fi

0 commit comments

Comments
 (0)