Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .ci/scripts/build-qnn-sdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,10 @@ set_up_aot() {
-DEXECUTORCH_BUILD_EXTENSION_TENSOR=ON \
-DEXECUTORCH_ENABLE_EVENT_TRACER=ON \
-DPYTHON_EXECUTABLE=python3
cmake --build $PWD --target "PyQnnManagerAdaptor" "PyQnnWrapperAdaptor" -j$(nproc)
cmake --build $PWD --target "PyQnnManagerAdaptor" -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
Expand Down
1 change: 0 additions & 1 deletion .ci/scripts/test_llama.sh
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ if [[ "${MODE}" =~ .*qnn.* ]]; then
cp schema/program.fbs exir/_serialize/program.fbs
cp schema/scalar_type.fbs exir/_serialize/scalar_type.fbs
cp -f build-x86/backends/qualcomm/PyQnnManagerAdaptor.cpython-310-x86_64-linux-gnu.so backends/qualcomm/python
cp -f build-x86/backends/qualcomm/PyQnnWrapperAdaptor.cpython-310-x86_64-linux-gnu.so backends/qualcomm/python

else
QNN=OFF
Expand Down
1 change: 0 additions & 1 deletion .ci/scripts/test_qnn_static_llama_eval.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export PYTHONPATH=".."
cp schema/program.fbs exir/_serialize/program.fbs
cp schema/scalar_type.fbs exir/_serialize/scalar_type.fbs
cp -f build-x86/backends/qualcomm/PyQnnManagerAdaptor.cpython-310-x86_64-linux-gnu.so backends/qualcomm/python
cp -f build-x86/backends/qualcomm/PyQnnWrapperAdaptor.cpython-310-x86_64-linux-gnu.so backends/qualcomm/python

if [[ -z "${PYTHON_EXECUTABLE:-}" ]]; then
PYTHON_EXECUTABLE=python3
Expand Down
1 change: 0 additions & 1 deletion .ci/scripts/test_qnn_static_llm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ export PYTHONPATH=".."
cp schema/program.fbs exir/_serialize/program.fbs
cp schema/scalar_type.fbs exir/_serialize/scalar_type.fbs
cp -f build-x86/backends/qualcomm/PyQnnManagerAdaptor.cpython-310-x86_64-linux-gnu.so backends/qualcomm/python
cp -f build-x86/backends/qualcomm/PyQnnWrapperAdaptor.cpython-310-x86_64-linux-gnu.so backends/qualcomm/python

if [[ -z "${PYTHON_EXECUTABLE:-}" ]]; then
PYTHON_EXECUTABLE=python3
Expand Down
17 changes: 3 additions & 14 deletions backends/qualcomm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -267,15 +267,11 @@ if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64")
${CMAKE_CURRENT_BINARY_DIR}/pybind11
)
add_library(PyQnnManagerAdaptor MODULE)
add_library(PyQnnWrapperAdaptor MODULE)
# PyQnnManager containing a pybind type triggers the warning because pybind11
# code internally forces hidden visibility.
set_target_properties(
PyQnnManagerAdaptor PROPERTIES CXX_VISIBILITY_PRESET hidden
)
set_target_properties(
PyQnnWrapperAdaptor PROPERTIES CXX_VISIBILITY_PRESET hidden
)

target_link_libraries(
PyQnnManagerAdaptor
Expand All @@ -287,18 +283,14 @@ if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64")
executorch
extension_tensor
qnn_backend_options
)
target_link_libraries(
PyQnnWrapperAdaptor PRIVATE pybind11::module pybind11::lto wrappers
qnn_executorch_logging qnn_executorch_header
wrappers
qnn_executorch_logging
)

pybind11_extension(PyQnnManagerAdaptor)
pybind11_extension(PyQnnWrapperAdaptor)
if(NOT MSVC AND NOT ${CMAKE_BUILD_TYPE} MATCHES RelWithDebInfo)
# Strip unnecessary sections of the binary
pybind11_strip(PyQnnManagerAdaptor)
pybind11_strip(PyQnnWrapperAdaptor)
endif()

if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
Expand All @@ -309,9 +301,6 @@ if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64")
target_compile_options(
PyQnnManagerAdaptor PUBLIC ${_pybind_compile_options}
)
target_compile_options(
PyQnnWrapperAdaptor PUBLIC ${_pybind_compile_options}
)
endif()

add_subdirectory(
Expand All @@ -320,7 +309,7 @@ if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64")
)

install(
TARGETS PyQnnManagerAdaptor PyQnnWrapperAdaptor
TARGETS PyQnnManagerAdaptor
LIBRARY
DESTINATION ${CMAKE_INSTALL_LIBDIR}/executorch/backends/qualcomm/python
RUNTIME
Expand Down
6 changes: 0 additions & 6 deletions backends/qualcomm/aot/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,3 @@ target_sources(
PyQnnManagerAdaptor PUBLIC ${CMAKE_CURRENT_LIST_DIR}/PyQnnManagerAdaptor.cpp
${CMAKE_CURRENT_LIST_DIR}/PyQnnManagerAdaptor.h
)

# PyQnnWrapperAdaptor
target_sources(
PyQnnWrapperAdaptor PUBLIC ${CMAKE_CURRENT_LIST_DIR}/PyQnnWrapperAdaptor.cpp
${CMAKE_CURRENT_LIST_DIR}/PyQnnWrapperAdaptor.h
)
Loading
Loading