Skip to content

Commit 1781d92

Browse files
committed
[Backend Tester] Add QNN test flow to nightly CI
ghstack-source-id: 312ff52 ghstack-comment-id: 3194008771 Pull-Request: #13468
1 parent 0809cba commit 1781d92

File tree

3 files changed

+24
-9
lines changed

3 files changed

+24
-9
lines changed

.ci/scripts/test_backend_linux.sh

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,26 @@ eval "$(conda shell.bash hook)"
1818
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
1919
conda activate "${CONDA_ENV}"
2020

21-
# Setup swiftshader and Vulkan SDK which are required to build the Vulkan delegate
22-
source .ci/scripts/setup-vulkan-linux-deps.sh
21+
export PYTHON_EXECUTABLE=python
2322

2423
# CMake options to use, in addition to the defaults.
25-
EXTRA_BUILD_ARGS="-DEXECUTORCH_BUILD_VULKAN=ON"
24+
EXTRA_BUILD_ARGS=""
25+
26+
if [[ "$FLOW" == *qualcomm* ]]; then
27+
# Setup QNN sdk and deps
28+
./install_requirements.sh --use-pt-pinned-commit
29+
source .ci/scripts/setup-qnn-deps.sh
30+
source .ci/scripts/build-qnn-sdk.sh
31+
32+
EXTRA_BUILD_ARGS+=" -DEXECUTORCH_BUILD_QNN=ON -DQNN_SDK_ROOT=$QNN_SDK_ROOT"
33+
fi
34+
35+
if [[ "$FLOW" =~ *vulkan* ]]; then
36+
# Setup swiftshader and Vulkan SDK which are required to build the Vulkan delegate
37+
source .ci/scripts/setup-vulkan-linux-deps.sh
38+
39+
EXTRA_BUILD_ARGS+=" -DEXECUTORCH_BUILD_VULKAN=ON"
40+
fi
2641

2742
# We need the runner to test the built library.
2843
PYTHON_EXECUTABLE=python CMAKE_ARGS="$EXTRA_BUILD_ARGS" .ci/scripts/setup-linux.sh --build-tool cmake --build-mode Release

.github/workflows/nightly.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
strategy:
4343
fail-fast: false
4444
matrix:
45-
flow: [vulkan, xnnpack, xnnpack_static_int8_per_channel]
45+
flow: [qualcomm, vulkan, xnnpack, xnnpack_static_int8_per_channel]
4646
suite: [models, operators]
4747
with:
4848
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}

backends/qualcomm/scripts/install_qnn_sdk.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ source "${SCRIPT_DIR}/qnn_config.sh"
99
# Function to install Android NDK (only if not already set)
1010
setup_android_ndk() {
1111
# Check if ANDROID_NDK_ROOT is already set and valid
12-
if [ -n "${ANDROID_NDK_ROOT}" ] && [ -d "${ANDROID_NDK_ROOT}" ]; then
12+
if [ -n "${ANDROID_NDK_ROOT:-}" ] && [ -d "${ANDROID_NDK_ROOT:-}" ]; then
1313
echo "Android NDK already set to ${ANDROID_NDK_ROOT} - skipping installation"
1414
return
1515
fi
@@ -41,7 +41,7 @@ verify_pkg_installed() {
4141

4242
install_qnn() {
4343
# Check if QNN_SDK_ROOT is already set and valid
44-
if [ -n "${QNN_SDK_ROOT}" ] && [ -d "${QNN_SDK_ROOT}" ]; then
44+
if [ -n "${QNN_SDK_ROOT:-}" ] && [ -d "${QNN_SDK_ROOT:-}" ]; then
4545
echo "QNN SDK already set to ${QNN_SDK_ROOT} - skipping installation"
4646
return
4747
fi
@@ -141,9 +141,9 @@ setup_libcpp() {
141141
popd >/dev/null
142142

143143
# Set environment variables
144-
export CPLUS_INCLUDE_PATH="${INSTALL_DIR}/include:$CPLUS_INCLUDE_PATH"
145-
export LD_LIBRARY_PATH="${INSTALL_DIR}/lib:$LD_LIBRARY_PATH"
146-
export LIBRARY_PATH="${INSTALL_DIR}/lib:$LIBRARY_PATH"
144+
export CPLUS_INCLUDE_PATH="${INSTALL_DIR}/include:${CPLUS_INCLUDE_PATH:-}"
145+
export LD_LIBRARY_PATH="${INSTALL_DIR}/lib:${LD_LIBRARY_PATH:-}"
146+
export LIBRARY_PATH="${INSTALL_DIR}/lib:${LIBRARY_PATH:-}"
147147

148148
echo "libc++ installed to ${INSTALL_DIR}"
149149
}

0 commit comments

Comments
 (0)