Skip to content

Commit 6c82462

Browse files
Add PR-blocking CI for QNN model tests, operator/model testsuite, and pass unit tests (pytorch#18854)
Differential Revision: D100708421 Pull Request resolved: pytorch#18854
1 parent 6a9d749 commit 6c82462

5 files changed

Lines changed: 65 additions & 2 deletions

File tree

‎.github/workflows/pull.yml‎

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -857,6 +857,8 @@ jobs:
857857
id-token: write
858858
contents: read
859859
strategy:
860+
matrix:
861+
model: [mv2, mv3, dl3]
860862
fail-fast: false
861863
with:
862864
runner: linux.2xlarge
@@ -868,9 +870,58 @@ jobs:
868870
# The generic Linux job chooses to use base env, not the one setup by the image
869871
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
870872
conda activate "${CONDA_ENV}"
873+
PYTHON_EXECUTABLE=python bash .ci/scripts/setup-linux.sh --build-tool cmake
874+
PYTHON_EXECUTABLE=python bash .ci/scripts/setup-qnn-deps.sh
875+
PYTHON_EXECUTABLE=python bash .ci/scripts/build-qnn-sdk.sh
876+
PYTHON_EXECUTABLE=python bash .ci/scripts/test_model.sh ${{ matrix.model }} "cmake" "qnn"
877+
878+
test-qnn-testsuite-linux:
879+
name: test-qnn-testsuite-linux
880+
permissions:
881+
id-token: write
882+
contents: read
883+
uses: ./.github/workflows/_test_backend.yml
884+
with:
885+
backend: qnn
886+
flows: '["qnn"]'
887+
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
888+
timeout: 120
889+
run-linux: true
890+
runner-linux: linux.2xlarge
891+
892+
test-qnn-passes-linux:
893+
name: test-qnn-passes-linux
894+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
895+
permissions:
896+
id-token: write
897+
contents: read
898+
strategy:
899+
fail-fast: false
900+
with:
901+
runner: linux.2xlarge
902+
docker-image: ci-image:executorch-ubuntu-22.04-qnn-sdk
903+
submodules: 'recursive'
904+
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
905+
timeout: 30
906+
script: |
907+
# The generic Linux job chooses to use base env, not the one setup by the image
908+
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
909+
conda activate "${CONDA_ENV}"
910+
911+
PYTHON_EXECUTABLE=python bash .ci/scripts/setup-qnn-deps.sh
912+
# Source (not bash) so QNN_SDK_ROOT stays in the environment
913+
PYTHON_EXECUTABLE=python source .ci/scripts/build-qnn-sdk.sh
914+
915+
# Editable install so the PyQnnManagerAdaptor .so built by build-qnn-sdk.sh
916+
# is visible in the source tree (the _passes import chain pulls it in transitively)
917+
CMAKE_ARGS="-DEXECUTORCH_BUILD_QNN=ON -DQNN_SDK_ROOT=$QNN_SDK_ROOT -DEXECUTORCH_BUILD_EXTENSION_TENSOR=ON" \
918+
PYTHON_EXECUTABLE=python bash .ci/scripts/setup-linux.sh --build-tool cmake --editable true
919+
920+
# test_mha_to_sha imports oss_scripts/llama which transitively needs torchtune
921+
pip install -r requirements-examples.txt
871922
872-
# placeholder for running test_qnn_delegate.py, can use matrix such that we can trigger different jobs, refers to test-llama-runner-qnn-linux
873-
# reminder: make sure each job runs fast
923+
# Run QNN pass unit tests
924+
pytest -xvs backends/qualcomm/tests/test_passes.py
874925
875926
test-phi-3-mini-runner-linux:
876927
name: test-phi-3-mini-runner-linux

‎.lintrunner.toml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ exclude_patterns = [
225225
'extension/llm/tokenizers/**',
226226
'backends/cadence/utils/FACTO',
227227
'examples/cuda',
228+
'examples/qualcomm',
228229
'kernels/portable',
229230
# File contains @generated
230231
'extension/llm/custom_ops/spinquant/fast_hadamard_transform_special.h',

‎examples/qualcomm/__init__.py‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright (c) Qualcomm Innovation Center, Inc.
2+
# All rights reserved
3+
#
4+
# This source code is licensed under the BSD-style license found in the
5+
# LICENSE file in the root directory of this source tree.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright (c) Qualcomm Innovation Center, Inc.
2+
# All rights reserved
3+
#
4+
# This source code is licensed under the BSD-style license found in the
5+
# LICENSE file in the root directory of this source tree.

‎src/executorch/examples/qualcomm‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../examples/qualcomm

0 commit comments

Comments
 (0)