File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4444# able to see the installed torch package.
4545
4646" ${GITHUB_WORKSPACE} /${REPOSITORY} /install_requirements.sh" --example
47-
48- # Download Qualcomm QNN SDK on Linux x86_64 so the wheel build can include the
49- # QNN backend. The SDK is large, so we download it here (outside CMake) rather
50- # than during cmake configure.
51- if [[ " $( uname -s) " == " Linux" && " $( uname -m) " == " x86_64" ]]; then
52- echo " Downloading Qualcomm QNN SDK..."
53- QNN_SDK_ROOT=$( python3 \
54- " ${GITHUB_WORKSPACE} /${REPOSITORY} /backends/qualcomm/scripts/download_qnn_sdk.py" \
55- --print-sdk-path)
56- export QNN_SDK_ROOT
57- echo " QNN_SDK_ROOT=${QNN_SDK_ROOT} " >> " ${GITHUB_ENV} "
58- echo " QNN SDK downloaded to ${QNN_SDK_ROOT} "
59- fi
Original file line number Diff line number Diff line change 55# This source code is licensed under the BSD-style license found in the
66# LICENSE file in the root directory of this source tree.
77
8- import platform
9-
108import test_base
119from examples .models import Backend , Model
1210
1311if __name__ == "__main__" :
14- # On Linux x86_64 the wheel is built with the Qualcomm backend.
15- # Verify that it was registered correctly.
16- if platform .system () == "Linux" and platform .machine () in ("x86_64" , "amd64" ):
17- from executorch .extension .pybindings .portable_lib import (
18- _get_registered_backend_names ,
19- )
20-
21- registered = _get_registered_backend_names ()
22- assert (
23- "QnnBackend" in registered
24- ), f"QnnBackend not found in registered backends: { registered } "
25- print ("✓ QnnBackend is registered" )
26-
2712 test_base .run_tests (
2813 model_tests = [
2914 test_base .ModelTest (
Original file line number Diff line number Diff line change 1616 test-qnn-wheel-packages-linux :
1717 name : test-qnn-wheel-packages-linux
1818 uses : pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
19+ if : false
1920 permissions :
2021 id-token : write
2122 contents : read
Original file line number Diff line number Diff line change @@ -23,19 +23,9 @@ get_filename_component(
2323 _common_include_directories "${EXECUTORCH_SOURCE_DIR } /.." ABSOLUTE
2424)
2525
26- # If QNN_SDK_ROOT was not passed as a CMake variable, fall back to the
27- # environment variable. Prefer downloading the SDK *outside* of CMake (e.g. via
28- # backends/qualcomm/scripts/download_qnn_sdk.py) and passing the path in.
29- if (NOT DEFINED QNN_SDK_ROOT AND DEFINED ENV{QNN_SDK_ROOT})
30- set (QNN_SDK_ROOT
31- $ENV{QNN_SDK_ROOT}
32- CACHE PATH "Qualcomm SDK root directory" FORCE
33- )
34- endif ()
35-
36- # Last-resort fallback: download during cmake configure when building wheels and
37- # QNN_SDK_ROOT was not provided externally.
38- if (NOT DEFINED QNN_SDK_ROOT AND EXECUTORCH_BUILD_WHEEL_DO_NOT_USE)
26+ # We only download QNN SDK when we build pip wheel for ExecuTorch. Please don't
27+ # change this code unless you know what you are doing.
28+ if (EXECUTORCH_BUILD_WHEEL_DO_NOT_USE)
3929 set (_qnn_default_sdk_dir "${CMAKE_CURRENT_BINARY_DIR } /sdk/qnn" )
4030
4131 if (EXISTS "${_qnn_default_sdk_dir} " AND EXISTS "${_qnn_default_sdk_dir} /lib" )
@@ -45,7 +35,7 @@ if(NOT DEFINED QNN_SDK_ROOT AND EXECUTORCH_BUILD_WHEEL_DO_NOT_USE)
4535 CACHE PATH "Qualcomm SDK root directory" FORCE
4636 )
4737 else ()
48- message (STATUS "Downloading Qualcomm SDK (fallback) " )
38+ message (STATUS "Downloading Qualcomm SDK" )
4939 execute_process (
5040 COMMAND
5141 ${PYTHON_EXECUTABLE}
Original file line number Diff line number Diff line change @@ -706,17 +706,6 @@ def run(self): # noqa C901
706706 ):
707707 cmake_configuration_args += ["-DEXECUTORCH_BUILD_CUDA=ON" ]
708708
709- # Check if QNN SDK is available (via QNN_SDK_ROOT env var), and if so,
710- # enable building the Qualcomm backend by default.
711- qnn_sdk_root = os .environ .get ("QNN_SDK_ROOT" , "" ).strip ()
712- if qnn_sdk_root and install_utils .is_cmake_option_on (
713- cmake_configuration_args , "EXECUTORCH_BUILD_QNN" , default = True
714- ):
715- cmake_configuration_args += [
716- "-DEXECUTORCH_BUILD_QNN=ON" ,
717- f"-DQNN_SDK_ROOT={ qnn_sdk_root } " ,
718- ]
719-
720709 with Buck2EnvironmentFixer ():
721710 # Generate the cmake cache from scratch to ensure that the cache state
722711 # is predictable.
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
3737 set_overridable_option (EXECUTORCH_BUILD_EXTENSION_LLM_RUNNER ON )
3838 set_overridable_option (EXECUTORCH_BUILD_EXTENSION_LLM ON )
3939 if (CMAKE_SYSTEM_PROCESSOR MATCHES "^(x86_64|amd64|i.86)$" )
40- set_overridable_option (EXECUTORCH_BUILD_QNN ON )
40+ set_overridable_option (EXECUTORCH_BUILD_QNN OFF )
4141 endif ()
4242elseif (CMAKE_SYSTEM_NAME STREQUAL "Windows" OR CMAKE_SYSTEM_NAME STREQUAL
4343 "WIN32"
You can’t perform that action at this time.
0 commit comments