|
| 1 | +parameters: |
| 2 | + |
| 3 | +- name: MACHINE_POOL |
| 4 | + type: string |
| 5 | + default: 'Onnxruntime-QNNEP-Windows-2022-CPU' |
| 6 | + |
| 7 | +- name: QNN_SDK |
| 8 | + displayName: QNN SDK Version |
| 9 | + type: string |
| 10 | + default: 2.24.0.240626 |
| 11 | + |
| 12 | +- name: ENV_SETUP_SCRIPT |
| 13 | + type: string |
| 14 | + default: '' |
| 15 | + |
| 16 | +- name: BUILD_PY_PARAMETERS |
| 17 | + displayName: > |
| 18 | + Extra parameters to pass to build.py. Don't put newlines in here. |
| 19 | + type: string |
| 20 | + default: '' |
| 21 | + |
| 22 | +jobs: |
| 23 | +- job: Win_py_x64_qnn_Wheels |
| 24 | + timeoutInMinutes: 210 |
| 25 | + workspace: |
| 26 | + clean: all |
| 27 | + pool: |
| 28 | + name: ${{ parameters.MACHINE_POOL }} |
| 29 | + strategy: |
| 30 | + matrix: |
| 31 | + Python38_x64: |
| 32 | + PythonVersion: '3.8' |
| 33 | + Python39_x64: |
| 34 | + PythonVersion: '3.9' |
| 35 | + Python310_x64: |
| 36 | + PythonVersion: '3.10' |
| 37 | + Python311_x64: |
| 38 | + PythonVersion: '3.11' |
| 39 | + Python312_x64: |
| 40 | + PythonVersion: '3.12' |
| 41 | + variables: |
| 42 | + GRADLE_OPTS: '-Dorg.gradle.daemon=false' |
| 43 | + VSGenerator: 'Visual Studio 17 2022' |
| 44 | + steps: |
| 45 | + - checkout: self |
| 46 | + clean: true |
| 47 | + submodules: recursive |
| 48 | + |
| 49 | + - template: telemetry-steps.yml |
| 50 | + |
| 51 | + - task: UsePythonVersion@0 |
| 52 | + inputs: |
| 53 | + versionSpec: $(PythonVersion) |
| 54 | + addToPath: true |
| 55 | + architecture: 'x64' |
| 56 | + |
| 57 | + - task: onebranch.pipeline.tsaoptions@1 |
| 58 | + displayName: 'OneBranch TSAOptions' |
| 59 | + inputs: |
| 60 | + tsaConfigFilePath: '$(Build.SourcesDirectory)\.config\tsaoptions.json' |
| 61 | + appendSourceBranchName: false |
| 62 | + |
| 63 | + - template: download-deps.yml |
| 64 | + |
| 65 | + - task: PythonScript@0 |
| 66 | + displayName: 'Update deps.txt' |
| 67 | + inputs: |
| 68 | + scriptPath: $(Build.SourcesDirectory)/tools/ci_build/replace_urls_in_deps.py |
| 69 | + arguments: --new_dir $(Build.BinariesDirectory)/deps |
| 70 | + workingDirectory: $(Build.BinariesDirectory) |
| 71 | + |
| 72 | + - task: PowerShell@2 |
| 73 | + displayName: 'Install ONNX' |
| 74 | + inputs: |
| 75 | + filePath: '$(Build.SourcesDirectory)/tools/ci_build/github/windows/install_third_party_deps.ps1' |
| 76 | + workingDirectory: '$(Build.BinariesDirectory)' |
| 77 | + arguments: -cpu_arch x64 -install_prefix $(Build.BinariesDirectory)\RelWithDebInfo\installed -build_config RelWithDebInfo |
| 78 | + |
| 79 | + - template: set-nightly-build-option-variable-step.yml |
| 80 | + |
| 81 | + - template: jobs/download_win_qnn_sdk.yml |
| 82 | + parameters: |
| 83 | + QnnSDKVersion: ${{ parameters.QNN_SDK }} |
| 84 | + |
| 85 | + - task: PythonScript@0 |
| 86 | + displayName: 'Generate cmake config' |
| 87 | + inputs: |
| 88 | + scriptPath: '$(Build.SourcesDirectory)\tools\ci_build\build.py' |
| 89 | + arguments: > |
| 90 | + --config RelWithDebInfo |
| 91 | + --build_dir $(Build.BinariesDirectory) |
| 92 | + --skip_submodule_sync |
| 93 | + --cmake_generator "$(VSGenerator)" |
| 94 | + --use_qnn |
| 95 | + --qnn_home $(QnnSDKRootDir) |
| 96 | + --enable_pybind |
| 97 | + --parallel --update --arm64ec |
| 98 | + $(TelemetryOption) ${{ parameters.BUILD_PY_PARAMETERS }} |
| 99 | + workingDirectory: '$(Build.BinariesDirectory)' |
| 100 | + |
| 101 | + - task: VSBuild@1 |
| 102 | + displayName: 'Build' |
| 103 | + inputs: |
| 104 | + solution: '$(Build.BinariesDirectory)\RelWithDebInfo\onnxruntime.sln' |
| 105 | + platform: 'arm64ec' |
| 106 | + configuration: RelWithDebInfo |
| 107 | + msbuildArchitecture: 'x64' |
| 108 | + maximumCpuCount: true |
| 109 | + logProjectEvents: true |
| 110 | + workingFolder: '$(Build.BinariesDirectory)\RelWithDebInfo' |
| 111 | + createLogFile: true |
| 112 | + |
| 113 | + # Esrp signing |
| 114 | + - template: win-esrp-dll.yml |
| 115 | + parameters: |
| 116 | + FolderPath: '$(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo\onnxruntime\capi' |
| 117 | + DisplayName: 'ESRP - Sign Native dlls' |
| 118 | + DoEsrp: true |
| 119 | + Pattern: '*.pyd' |
| 120 | + |
| 121 | + - task: PythonScript@0 |
| 122 | + displayName: 'Build wheel' |
| 123 | + inputs: |
| 124 | + scriptPath: '$(Build.SourcesDirectory)\setup.py' |
| 125 | + arguments: 'bdist_wheel $(NightlyBuildOption) --wheel_name_suffix=qnn' |
| 126 | + workingDirectory: '$(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo' |
| 127 | + |
| 128 | + - task: CopyFiles@2 |
| 129 | + displayName: 'Copy Python Wheel to: $(Build.ArtifactStagingDirectory)' |
| 130 | + inputs: |
| 131 | + SourceFolder: '$(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo\dist' |
| 132 | + Contents: '*.whl' |
| 133 | + TargetFolder: '$(Build.ArtifactStagingDirectory)' |
| 134 | + |
| 135 | + - task: PublishBuildArtifacts@1 |
| 136 | + displayName: 'Publish Artifact: ONNXRuntime python wheel' |
| 137 | + inputs: |
| 138 | + ArtifactName: onnxruntime_qnn |
| 139 | + |
| 140 | + - script: | |
| 141 | + 7z x *.whl |
| 142 | + workingDirectory: '$(Build.ArtifactStagingDirectory)' |
| 143 | + displayName: 'unzip the package' |
| 144 | +
|
| 145 | + - task: CredScan@3 |
| 146 | + displayName: 'Run CredScan' |
| 147 | + inputs: |
| 148 | + debugMode: false |
| 149 | + continueOnError: true |
| 150 | + |
| 151 | + - task: BinSkim@4 |
| 152 | + displayName: 'Run BinSkim' |
| 153 | + inputs: |
| 154 | + AnalyzeTargetGlob: '+:file|$(Build.ArtifactStagingDirectory)\**\*.dll' |
| 155 | + |
| 156 | + - task: TSAUpload@2 |
| 157 | + displayName: 'TSA upload' |
| 158 | + condition: and (succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main')) |
| 159 | + inputs: |
| 160 | + GdnPublishTsaOnboard: false |
| 161 | + GdnPublishTsaConfigFile: '$(Build.sourcesDirectory)\.gdn\.gdntsa' |
| 162 | + |
| 163 | + - template: component-governance-component-detection-steps.yml |
| 164 | + parameters: |
| 165 | + condition: 'succeeded' |
0 commit comments