Skip to content

Commit ab3a356

Browse files
committed
Update on "[Executorch][CI] Fix qnn runner ci job scripts"
QNN backend's AOT artifacts were being copied in the source directory instead of them being installed, as build artifacts, in appropriate package directory. As a result we had to use PYTHON_PATH=".." in test_llama.sh CI script when running CI for qnn. This results in executorch having two locations as where the package is installed. This PR fixes that. Differential Revision: [D66406274](https://our.internmc.facebook.com/intern/diff/D66406274/) [ghstack-poisoned]
2 parents 4910c6f + 0ea9d09 commit ab3a356

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ build_qnn_backend() {
1212
echo "Start building qnn backend."
1313
export ANDROID_NDK_ROOT=/opt/ndk
1414
export QNN_SDK_ROOT=/tmp/qnn/2.25.0.240728
15-
export EXECUTORCH_ROOT="$(python -c 'import executorch; print(executorch.__path__[0])')"
16-
if [ "$EXECUTORCH_ROOT" == "" ]; then
15+
export EXECUTORCH_SRC_ROOT="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/../.." && pwd)"
16+
export EXECUTORCH_INSTALL_ROOT="$(python -c 'import executorch; print(executorch.__path__[0])')"
17+
if [ "$EXECUTORCH_INSTALL_ROOT" == "" ]; then
1718
echo "Failed to find where executorch package is installed."
1819
echo "import executorch failed"
1920
exit -1
@@ -23,7 +24,7 @@ build_qnn_backend() {
2324
}
2425

2526
set_up_aot() {
26-
cd $EXECUTORCH_ROOT
27+
cd $EXECUTORCH_SRC_ROOT
2728
if [ ! -d "cmake-out" ]; then
2829
mkdir cmake-out
2930
fi
@@ -41,8 +42,8 @@ set_up_aot() {
4142
cmake --build $PWD --target "PyQnnManagerAdaptor" "PyQnnWrapperAdaptor" -j$(nproc)
4243
# install Python APIs to correct import path
4344
# The filename might vary depending on your Python and host version.
44-
cp -f backends/qualcomm/PyQnnManagerAdaptor.cpython-310-x86_64-linux-gnu.so $EXECUTORCH_ROOT/backends/qualcomm/python
45-
cp -f backends/qualcomm/PyQnnWrapperAdaptor.cpython-310-x86_64-linux-gnu.so $EXECUTORCH_ROOT/backends/qualcomm/python
45+
cp -f backends/qualcomm/PyQnnManagerAdaptor.cpython-310-x86_64-linux-gnu.so $EXECUTORCH_INSTALL_ROOT/backends/qualcomm/python
46+
cp -f backends/qualcomm/PyQnnWrapperAdaptor.cpython-310-x86_64-linux-gnu.so $EXECUTORCH_INSTALL_ROOT/backends/qualcomm/python
4647
popd
4748

4849
# Workaround for fbs files in exir/_serialize

0 commit comments

Comments
 (0)