mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-29 20:14:01 +00:00
166 lines
5.1 KiB
YAML
166 lines
5.1 KiB
YAML
parameters:
|
|
|
|
- name: MACHINE_POOL
|
|
type: string
|
|
default: 'Onnxruntime-QNNEP-Windows-2022-CPU'
|
|
|
|
- name: QNN_SDK
|
|
displayName: QNN SDK Version
|
|
type: string
|
|
default: 2.28.0.241029
|
|
|
|
- name: ENV_SETUP_SCRIPT
|
|
type: string
|
|
default: ''
|
|
|
|
- name: BUILD_PY_PARAMETERS
|
|
displayName: >
|
|
Extra parameters to pass to build.py. Don't put newlines in here.
|
|
type: string
|
|
default: ''
|
|
|
|
jobs:
|
|
- job: Win_py_x64_qnn_Wheels
|
|
timeoutInMinutes: 210
|
|
workspace:
|
|
clean: all
|
|
pool:
|
|
name: ${{ parameters.MACHINE_POOL }}
|
|
strategy:
|
|
matrix:
|
|
Python310_x64:
|
|
PythonVersion: '3.10'
|
|
Python311_x64:
|
|
PythonVersion: '3.11'
|
|
Python312_x64:
|
|
PythonVersion: '3.12'
|
|
variables:
|
|
GRADLE_OPTS: '-Dorg.gradle.daemon=false'
|
|
VSGenerator: 'Visual Studio 17 2022'
|
|
steps:
|
|
- checkout: self
|
|
clean: true
|
|
submodules: recursive
|
|
|
|
- template: telemetry-steps.yml
|
|
|
|
- task: UsePythonVersion@0
|
|
inputs:
|
|
versionSpec: $(PythonVersion)
|
|
addToPath: true
|
|
architecture: 'x64'
|
|
|
|
- task: PipAuthenticate@1
|
|
displayName: 'Pip Authenticate'
|
|
inputs:
|
|
artifactFeeds: 'Lotus'
|
|
|
|
- task: onebranch.pipeline.tsaoptions@1
|
|
displayName: 'OneBranch TSAOptions'
|
|
inputs:
|
|
tsaConfigFilePath: '$(Build.SourcesDirectory)\.config\tsaoptions.json'
|
|
appendSourceBranchName: false
|
|
|
|
- template: download-deps.yml
|
|
|
|
- task: PythonScript@0
|
|
displayName: 'Update deps.txt'
|
|
inputs:
|
|
scriptPath: $(Build.SourcesDirectory)/tools/ci_build/replace_urls_in_deps.py
|
|
arguments: --new_dir $(Build.BinariesDirectory)/deps
|
|
workingDirectory: $(Build.BinariesDirectory)
|
|
|
|
- task: PowerShell@2
|
|
displayName: 'Install ONNX'
|
|
inputs:
|
|
filePath: '$(Build.SourcesDirectory)/tools/ci_build/github/windows/install_third_party_deps.ps1'
|
|
workingDirectory: '$(Build.BinariesDirectory)'
|
|
arguments: -cpu_arch x64 -install_prefix $(Build.BinariesDirectory)\RelWithDebInfo\installed -build_config RelWithDebInfo
|
|
|
|
- template: set-nightly-build-option-variable-step.yml
|
|
|
|
- template: jobs/download_win_qnn_sdk.yml
|
|
parameters:
|
|
QnnSDKVersion: ${{ parameters.QNN_SDK }}
|
|
|
|
- task: PythonScript@0
|
|
displayName: 'Generate cmake config'
|
|
inputs:
|
|
scriptPath: '$(Build.SourcesDirectory)\tools\ci_build\build.py'
|
|
arguments: >
|
|
--config RelWithDebInfo
|
|
--build_dir $(Build.BinariesDirectory)
|
|
--skip_submodule_sync
|
|
--cmake_generator "$(VSGenerator)"
|
|
--use_qnn
|
|
--qnn_home $(QnnSDKRootDir)
|
|
--enable_pybind
|
|
--parallel --update
|
|
$(TelemetryOption) ${{ parameters.BUILD_PY_PARAMETERS }}
|
|
workingDirectory: '$(Build.BinariesDirectory)'
|
|
|
|
- task: VSBuild@1
|
|
displayName: 'Build'
|
|
inputs:
|
|
solution: '$(Build.BinariesDirectory)\RelWithDebInfo\onnxruntime.sln'
|
|
platform: 'x64'
|
|
configuration: RelWithDebInfo
|
|
msbuildArchitecture: 'x64'
|
|
maximumCpuCount: true
|
|
logProjectEvents: true
|
|
workingFolder: '$(Build.BinariesDirectory)\RelWithDebInfo'
|
|
createLogFile: true
|
|
|
|
# Esrp signing
|
|
- template: win-esrp-dll.yml
|
|
parameters:
|
|
FolderPath: '$(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo\onnxruntime\capi'
|
|
DisplayName: 'ESRP - Sign Native dlls'
|
|
DoEsrp: true
|
|
Pattern: '*.pyd'
|
|
|
|
- task: PythonScript@0
|
|
displayName: 'Build wheel'
|
|
inputs:
|
|
scriptPath: '$(Build.SourcesDirectory)\setup.py'
|
|
arguments: 'bdist_wheel $(NightlyBuildOption) --wheel_name_suffix=qnn'
|
|
workingDirectory: '$(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo'
|
|
|
|
- task: CopyFiles@2
|
|
displayName: 'Copy Python Wheel to: $(Build.ArtifactStagingDirectory)'
|
|
inputs:
|
|
SourceFolder: '$(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo\dist'
|
|
Contents: '*.whl'
|
|
TargetFolder: '$(Build.ArtifactStagingDirectory)'
|
|
|
|
- task: PublishBuildArtifacts@1
|
|
displayName: 'Publish Artifact: ONNXRuntime python wheel'
|
|
inputs:
|
|
ArtifactName: onnxruntime_qnn_x64
|
|
|
|
- script: |
|
|
7z x *.whl
|
|
workingDirectory: '$(Build.ArtifactStagingDirectory)'
|
|
displayName: 'unzip the package'
|
|
|
|
- task: CredScan@3
|
|
displayName: 'Run CredScan'
|
|
inputs:
|
|
debugMode: false
|
|
continueOnError: true
|
|
|
|
- task: BinSkim@4
|
|
displayName: 'Run BinSkim'
|
|
inputs:
|
|
AnalyzeTargetGlob: '+:file|$(Build.ArtifactStagingDirectory)\**\*.dll'
|
|
|
|
- task: TSAUpload@2
|
|
displayName: 'TSA upload'
|
|
condition: and (succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main'))
|
|
inputs:
|
|
GdnPublishTsaOnboard: false
|
|
GdnPublishTsaConfigFile: '$(Build.sourcesDirectory)\.gdn\.gdntsa'
|
|
|
|
- template: component-governance-component-detection-steps.yml
|
|
parameters:
|
|
condition: 'succeeded'
|