@@ -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
0 commit comments