name: Windows x64 QNN CI Pipeline
|
|
on:
|
push:
|
branches:
|
- main
|
- rel-*
|
pull_request:
|
branches:
|
- main
|
- rel-*
|
workflow_dispatch:
|
|
concurrency:
|
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.sha }}
|
cancel-in-progress: true
|
|
jobs:
|
build_test_qnn_ep:
|
name: Windows x64 QNN CI Pipeline (${{ matrix.QnnLibKind }})
|
runs-on: [
|
"self-hosted",
|
"1ES.Pool=onnxruntime-github-vs2022-latest",
|
"JobId=build_test_qnn_ep-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}-${{matrix.QnnLibKind}}"
|
]
|
timeout-minutes: 120
|
strategy:
|
matrix:
|
QnnLibKind: [shared_lib, static_lib]
|
env:
|
AZCOPY_AUTO_LOGIN_TYPE: MSI
|
AZCOPY_MSI_CLIENT_ID: d712a4c7-a0cf-4e87-af75-31510eba0a8e
|
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
|
ALLOW_RELEASED_ONNX_OPSET_ONLY: '1'
|
|
steps:
|
- name: Checkout repository
|
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
|
|
- name: Setup Python
|
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
|
with:
|
python-version: '3.12'
|
architecture: x64
|
|
- name: Setup Java
|
uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1
|
with:
|
distribution: 'temurin'
|
java-version: '17'
|
architecture: x64
|
|
# onnx (pinned to cmake/deps.txt) + numpy (pinned in requirements-materialize-onnx-node-tests.txt,
|
# python-conditional)
|
# are required at configure time by the onnxruntime_MATERIALIZE_ONNX_NODE_TESTS gate, which
|
# regenerates the onnx node-test corpus into the build tree (onnx_node_tests\node) for
|
# onnx_test_runner. The numpy markers in requirements-materialize-onnx-node-tests.txt self-select
|
# the same pin the CMake gate asserts.
|
- name: Install onnx for node-test materialization
|
shell: cmd
|
run: python -m pip install -r requirements-materialize-onnx-node-tests.txt
|
|
- name: Locate vcvarsall and Setup Env
|
uses: ./.github/actions/locate-vcvarsall-and-setup-env
|
with:
|
architecture: x64
|
|
- name: Download QNN SDK
|
working-directory: ${{ runner.temp }}
|
run: |
|
azcopy.exe cp --recursive https://lotusscus.blob.core.windows.net/models/qnnsdk/qnn-v2.42.0.251225 .
|
dir
|
shell: pwsh
|
|
- name: Set QNN_SDK_ROOT environment variable
|
shell: pwsh
|
run: |
|
$qnn_sdk_path = Join-Path $env:RUNNER_TEMP "qnn-v2.42.0.251225"
|
echo "QNN_SDK_ROOT=$qnn_sdk_path" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
echo "QNN SDK Root: $qnn_sdk_path"
|
dir $qnn_sdk_path
|
|
- name: Build and Test
|
shell: cmd
|
run: |
|
python ${{ github.workspace }}\tools\ci_build\build.py --config RelWithDebInfo --build_dir ${{ runner.temp }}\build --cmake_generator "Visual Studio 17 2022" --build_java --build_shared_lib --use_qnn ${{ matrix.QnnLibKind }} --qnn_home %QNN_SDK_ROOT% --use_binskim_compliant_compile_flags --cmake_extra_defines onnxruntime_MATERIALIZE_ONNX_NODE_TESTS=ON --update --build --test --enable_onnx_tests --parallel
|
|
- name: Run ONNX Tests
|
shell: cmd
|
working-directory: ${{ runner.temp }}\build\RelWithDebInfo\RelWithDebInfo
|
run: |
|
rem onnx#7959 collapse sentinel: -m 1 fails loud if 0 node tests are collected (e.g. a
|
rem MATERIALIZE=OFF leg still running this dir). Low value (not the 1500 build floor)
|
rem because -e qnn legitimately reduces the set to ~1529; strict count enforced at build via --min-cases.
|
.\onnx_test_runner -j 1 -m 1 -e qnn -i "backend_path|%QNN_SDK_ROOT%\lib\x86_64-windows-msvc\QnnCpu.dll" ${{ runner.temp }}\build\RelWithDebInfo\onnx_node_tests\node
|
|
- name: Run float32 model tests
|
shell: cmd
|
working-directory: ${{ runner.temp }}\build\RelWithDebInfo\RelWithDebInfo
|
run: |
|
rem This step assumes the model data exists at C:\data\float32_models on the runner
|
if exist C:\data\float32_models (
|
.\onnx_test_runner -j 1 -e qnn -i "backend_path|%QNN_SDK_ROOT%\lib\x86_64-windows-msvc\QnnCpu.dll" C:\data\float32_models
|
) else (
|
echo "Skipping float32 model tests: C:\data\float32_models not found."
|
)
|