Skip to content

Commit 212e91f

Browse files
authored
Fix tutorial for Qualcomm AI Engine Direct Backend (#2956) (#3026)
Summary: We have refactors recently and need to update the tutorial and cmake. See #2955 for isseues. Pull Request resolved: #2956 Reviewed By: mcr229, cccclai Differential Revision: D55947725 Pulled By: kirklandsign fbshipit-source-id: f23af28b9a8fe071223d8ffa922a6cd4e49efe61 (cherry picked from commit c7fd394)
1 parent e7e9e06 commit 212e91f

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

backends/qualcomm/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ target_link_libraries(qnn_executorch_backend
253253
qnn_executorch_header
254254
qnn_schema
255255
qnn_manager
256-
executorch
256+
executorch_no_prim_ops
257257
qcir_utils
258258
)
259259
target_link_libraries(utils

docs/source/build-run-qualcomm-ai-engine-direct-backend.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,10 @@ Python APIs on x64 are required to compile models to Qualcomm AI Engine Direct b
115115

116116
```bash
117117
cd $EXECUTORCH_ROOT
118+
# Workaround for fbs files in exir/_serialize
119+
cp schema/program.fbs exir/_serialize/program.fbs
120+
cp schema/scalar_type.fbs exir/_serialize/scalar_type.fbs
121+
118122
mkdir build_x86_64
119123
cd build_x86_64
120124
cmake .. -DEXECUTORCH_BUILD_QNN=ON -DQNN_SDK_ROOT=${QNN_SDK_ROOT}
@@ -138,8 +142,8 @@ mkdir build_android
138142
cd build_android
139143
# build executorch & qnn_executorch_backend
140144
cmake .. \
141-
-DBUCK2=buck2 \
142145
-DCMAKE_INSTALL_PREFIX=$PWD \
146+
-DEXECUTORCH_BUILD_SDK=ON \
143147
-DEXECUTORCH_BUILD_QNN=ON \
144148
-DQNN_SDK_ROOT=$QNN_SDK_ROOT \
145149
-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake \
@@ -220,6 +224,7 @@ So, we can run `qnn_executor_runner` like
220224
```bash
221225
adb push ./deeplab_v3/dlv3_qnn.pte ${DEVICE_DIR}
222226
adb push ${EXECUTORCH_ROOT}/build_android/examples/qualcomm/qnn_executor_runner ${DEVICE_DIR}
227+
adb push ${EXECUTORCH_ROOT}/build_android/lib/libqnn_executorch_backend.so ${DEVICE_DIR}
223228
adb shell "cd ${DEVICE_DIR} \
224229
&& export LD_LIBRARY_PATH=${DEVICE_DIR} \
225230
&& export ADSP_LIBRARY_PATH=${DEVICE_DIR} \

examples/qualcomm/executor_runner/qnn_executor_runner.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,10 @@ int main(int argc, char** argv) {
202202
// be used by a single thread at at time, but it can be reused.
203203
//
204204
torch::executor::ETDumpGen etdump_gen = torch::executor::ETDumpGen();
205+
// TODO: So far we have issues with etdump_gen during load_method. Enable it
206+
// after the issues are fixed.
205207
Result<Method> method =
206-
program->load_method(method_name, &memory_manager, &etdump_gen);
208+
program->load_method(method_name, &memory_manager, nullptr);
207209
ET_CHECK_MSG(
208210
method.ok(),
209211
"Loading of method %s failed with status 0x%" PRIx32,

0 commit comments

Comments
 (0)