Skip to content

Commit ca9780d

Browse files
authored
Merge branch 'main' into export-D78762534
2 parents 07435d3 + 574e109 commit ca9780d

File tree

223 files changed

+8167
-1967
lines changed

Some content is hidden

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

223 files changed

+8167
-1967
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/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: 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

.ci/scripts/test_qnn_static_llama.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ exit_code1=$?
4141
$PYTHON_EXECUTABLE backends/qualcomm/tests/test_qnn_delegate.py -k TestExampleLLMScript.test_llama_stories_110m --model SM8650 --build_folder build-x86/ --executorch_root . --artifact_dir . --llama_artifacts . --enable_x86_64
4242
exit_code2=$?
4343

44+
# Check BC
45+
bash backends/qualcomm/bc/test_qnn_static_llama_bc.sh
46+
exit_code3=$?
47+
4448
# Check the exit codes and print messages
4549
if [ $exit_code1 -ne 0 ]; then
4650
echo "Static Llama compile only with weight sharing test failed. $exit_code1."
@@ -50,8 +54,12 @@ if [ $exit_code2 -ne 0 ]; then
5054
echo "Static Llama accuracy test failed. $exit_code2."
5155
fi
5256

57+
if [ $exit_code3 -ne 0 ]; then
58+
echo "Static Llama BACKWARD COMPATIBILITY test failed. $exit_code3."
59+
fi
60+
5361
# Return failure if either program failed
54-
if [ $exit_code1 -ne 0 ] || [ $exit_code2 -ne 0 ]; then
62+
if [ $exit_code1 -ne 0 ] || [ $exit_code2 -ne 0 ] || [ $exit_code3 -ne 0 ]; then
5563
exit 1
5664
else
5765
exit 0

.github/workflows/android-perf.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,8 +355,8 @@ jobs:
355355
"--recipe" "xnnpack"
356356
"--use_custom_sdpa"
357357
"--use_custom_kv_cache"
358-
"--qlinear"
359-
"--qembedding"
358+
"--qlinear" "8da4w"
359+
"--qembedding" "8w"
360360
"--output_dir" ".."
361361
)
362362

0 commit comments

Comments
 (0)