Skip to content
Merged
29 changes: 25 additions & 4 deletions .ci/scripts/test_backend_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,34 @@ eval "$(conda shell.bash hook)"
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
conda activate "${CONDA_ENV}"

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

# CMake options to use, in addition to the defaults.
EXTRA_BUILD_ARGS="-DEXECUTORCH_BUILD_VULKAN=ON"
EXTRA_BUILD_ARGS=""

if [[ "$FLOW" == *qualcomm* ]]; then
# Setup QNN sdk and deps - note that this is a bit hacky due to the nature of the
# Qualcomm build. TODO (gjcomer) Clean this up once the QNN pybinding integration is
# cleaned up.
PYTHON_EXECUTABLE=python bash .ci/scripts/setup-linux.sh --build-tool cmake
PYTHON_EXECUTABLE=python bash .ci/scripts/setup-qnn-deps.sh
PYTHON_EXECUTABLE=python bash .ci/scripts/build-qnn-sdk.sh
QNN_X86_LIB_DIR=`realpath build-x86/lib/`
QNN_SDK_ROOT="/tmp/qnn/2.28.0.241029"
export LD_LIBRARY_PATH"=$QNN_X86_LIB_DIR:$QNN_SDK_ROOT/lib/x86_64-linux-clang/:${LD_LIBRARY_PATH:-}"

# TODO Get SDK root from install scripts
EXTRA_BUILD_ARGS+=" -DEXECUTORCH_BUILD_QNN=ON -DQNN_SDK_ROOT=$QNN_SDK_ROOT"
fi

if [[ "$FLOW" == *vulkan* ]]; then
# Setup swiftshader and Vulkan SDK which are required to build the Vulkan delegate
source .ci/scripts/setup-vulkan-linux-deps.sh

EXTRA_BUILD_ARGS+=" -DEXECUTORCH_BUILD_VULKAN=ON"
fi

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

python -m executorch.backends.test.suite.runner $SUITE --flow $FLOW --report "$ARTIFACT_DIR/test_results.csv"
4 changes: 2 additions & 2 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ jobs:
strategy:
fail-fast: false
matrix:
flow: [vulkan, xnnpack, xnnpack_static_int8_per_channel]
flow: [qualcomm, vulkan, xnnpack, xnnpack_static_int8_per_channel]
suite: [models, operators]
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
runner: linux.4xlarge.memory
docker-image: ci-image:executorch-ubuntu-22.04-clang12
docker-image: ci-image:executorch-ubuntu-22.04-qnn-sdk
submodules: recursive
timeout: 120
upload-artifact: test-report-${{ matrix.flow }}-${{ matrix.suite }}
Expand Down
10 changes: 5 additions & 5 deletions backends/qualcomm/scripts/install_qnn_sdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ source "${SCRIPT_DIR}/qnn_config.sh"
# Function to install Android NDK (only if not already set)
setup_android_ndk() {
# Check if ANDROID_NDK_ROOT is already set and valid
if [ -n "${ANDROID_NDK_ROOT}" ] && [ -d "${ANDROID_NDK_ROOT}" ]; then
if [ -n "${ANDROID_NDK_ROOT:-}" ] && [ -d "${ANDROID_NDK_ROOT:-}" ]; then
echo "Android NDK already set to ${ANDROID_NDK_ROOT} - skipping installation"
return
fi
Expand Down Expand Up @@ -41,7 +41,7 @@ verify_pkg_installed() {

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

# Set environment variables
export CPLUS_INCLUDE_PATH="${INSTALL_DIR}/include:$CPLUS_INCLUDE_PATH"
export LD_LIBRARY_PATH="${INSTALL_DIR}/lib:$LD_LIBRARY_PATH"
export LIBRARY_PATH="${INSTALL_DIR}/lib:$LIBRARY_PATH"
export CPLUS_INCLUDE_PATH="${INSTALL_DIR}/include:${CPLUS_INCLUDE_PATH:-}"
export LD_LIBRARY_PATH="${INSTALL_DIR}/lib:${LD_LIBRARY_PATH:-}"
export LIBRARY_PATH="${INSTALL_DIR}/lib:${LIBRARY_PATH:-}"

echo "libc++ installed to ${INSTALL_DIR}"
}
Expand Down
Loading