forked from cad-audio/executorch
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into main_backup
- Loading branch information
Showing
2,107 changed files
with
552,318 additions
and
27,661 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
b556d31586845fb1e296a975d2b85d9d325205c9 | ||
aec9b2ab77389967ef39bb9c10662fd0fe3e185a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0916b5b29b092afcbf2b898caae49abe80662bac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/bin/bash | ||
# Copyright (c) Meta Platforms, Inc. and affiliates. | ||
# All rights reserved. | ||
# | ||
# This source code is licensed under the BSD-style license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
|
||
set -eux | ||
set -o xtrace | ||
|
||
build_qnn_backend() { | ||
echo "Start building qnn backend." | ||
export ANDROID_NDK_ROOT=/opt/ndk | ||
export QNN_SDK_ROOT=/tmp/qnn/2.25.0.240728 | ||
export EXECUTORCH_ROOT="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/../.." && pwd)" | ||
|
||
bash backends/qualcomm/scripts/build.sh --skip_aarch64 --job_number 2 --release | ||
} | ||
|
||
set_up_aot() { | ||
cd $EXECUTORCH_ROOT | ||
if [ ! -d "cmake-out" ]; then | ||
mkdir cmake-out | ||
fi | ||
pushd cmake-out | ||
cmake .. \ | ||
-DCMAKE_INSTALL_PREFIX=$PWD \ | ||
-DEXECUTORCH_BUILD_QNN=ON \ | ||
-DQNN_SDK_ROOT=${QNN_SDK_ROOT} \ | ||
-DEXECUTORCH_BUILD_DEVTOOLS=ON \ | ||
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \ | ||
-DEXECUTORCH_BUILD_EXTENSION_TENSOR=ON \ | ||
-DEXECUTORCH_ENABLE_EVENT_TRACER=ON \ | ||
-DPYTHON_EXECUTABLE=python3 \ | ||
-DEXECUTORCH_SEPARATE_FLATCC_HOST_PROJECT=OFF | ||
cmake --build $PWD --target "PyQnnManagerAdaptor" "PyQnnWrapperAdaptor" -j$(nproc) | ||
# install Python APIs to correct import path | ||
# The filename might vary depending on your Python and host version. | ||
cp -f backends/qualcomm/PyQnnManagerAdaptor.cpython-310-x86_64-linux-gnu.so $EXECUTORCH_ROOT/backends/qualcomm/python | ||
cp -f backends/qualcomm/PyQnnWrapperAdaptor.cpython-310-x86_64-linux-gnu.so $EXECUTORCH_ROOT/backends/qualcomm/python | ||
popd | ||
|
||
# Workaround for fbs files in exir/_serialize | ||
cp schema/program.fbs exir/_serialize/program.fbs | ||
cp schema/scalar_type.fbs exir/_serialize/scalar_type.fbs | ||
} | ||
|
||
build_qnn_backend | ||
set_up_aot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/bash | ||
# Copyright (c) Meta Platforms, Inc. and affiliates. | ||
# All rights reserved. | ||
# | ||
# This source code is licensed under the BSD-style license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
|
||
set -exu | ||
|
||
# This script follows the instructions from GitHub to install an Apple certificate | ||
# https://docs.github.com/en/actions/use-cases-and-examples/deploying/installing-an-apple-certificate-on-macos-runners-for-xcode-development | ||
|
||
CERTIFICATE_PATH="${RUNNER_TEMP}"/build_certificate.p12 | ||
PP_PATH="${RUNNER_TEMP}"/build_pp.mobileprovision | ||
KEYCHAIN_PATH="${RUNNER_TEMP}"/app-signing.keychain-db | ||
|
||
# Import certificate and provisioning profile from secrets | ||
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH | ||
echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode -o $PP_PATH | ||
|
||
# Create a temporary keychain | ||
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH | ||
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH | ||
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH | ||
|
||
# Import certificate to the keychain | ||
security import $CERTIFICATE_PATH -P "" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH | ||
security set-key-partition-list -S apple-tool:,apple: -k "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH | ||
security list-keychain -d user -s $KEYCHAIN_PATH | ||
|
||
# Apply provisioning profile | ||
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles | ||
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#!/bin/bash | ||
# Copyright (c) Meta Platforms, Inc. and affiliates. | ||
# All rights reserved. | ||
# | ||
# This source code is licensed under the BSD-style license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
|
||
set -ex | ||
|
||
verify_pkg_installed() { | ||
echo $(dpkg-query -W --showformat='${Status}\n' $1|grep "install ok installed") | ||
} | ||
|
||
install_qnn() { | ||
echo "Start installing qnn." | ||
QNN_INSTALLATION_DIR=/tmp/qnn | ||
mkdir -p "${QNN_INSTALLATION_DIR}" | ||
|
||
curl -Lo /tmp/v2.25.0.24.07.28.zip "https://softwarecenter.qualcomm.com/api/download/software/qualcomm_neural_processing_sdk/v2.25.0.240728.zip" | ||
echo "Finishing downloading qnn sdk." | ||
unzip -qo /tmp/v2.25.0.24.07.28.zip -d /tmp | ||
echo "Finishing unzip qnn sdk." | ||
|
||
|
||
# Print the content for manual verification | ||
ls -lah "/tmp/qairt" | ||
mv "/tmp/qairt"/* "${QNN_INSTALLATION_DIR}" | ||
echo "Finishing installing qnn '${QNN_INSTALLATION_DIR}' ." | ||
|
||
ls -lah "${QNN_INSTALLATION_DIR}" | ||
} | ||
|
||
setup_libc++() { | ||
sudo apt-get update | ||
pkgs_to_check=('libc++-dev') | ||
j=0 | ||
while [ $j -lt ${#pkgs_to_check[*]} ]; do | ||
install_status=$(verify_pkg_installed ${pkgs_to_check[$j]}) | ||
if [ "$install_status" == "" ]; then | ||
sudo apt-get install -y ${pkgs_to_check[$j]} | ||
if [[ $? -ne 0 ]]; then | ||
echo "ERROR: Failed to install required packages for libc++" | ||
exit 1 | ||
fi | ||
fi | ||
j=$(( $j +1)); | ||
done | ||
} | ||
|
||
setup_libc++ | ||
install_qnn |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.