@@ -28,115 +28,131 @@ variables:
28
28
${{ if eq(parameters.CudaVersion, '12.2') }} :
29
29
value : $(Agent.TempDirectory)\v12.2
30
30
31
- stages :
32
- - template : templates/win-ci.yml
33
- parameters :
34
- ort_build_pool_name : ' onnxruntime-Win2022-GPU-A10'
35
- DoCompliance : false
36
- DoEsrp : true
37
- stage_name_suffix : CUDA
38
- buildArch : x64
39
- msbuildPlatform : x64
40
- packageName : x64-cuda
41
- CudaVersion : ${{ parameters.CudaVersion }}
42
- buildparameter : --use_cuda --cuda_home=${{ variables.win_cuda_home }} --enable_onnx_tests --enable_wcos --use_webgpu --cmake_extra_defines "CMAKE_CUDA_ARCHITECTURES=52-real;61-real;75-real;86-real;89-real;90-virtual"
43
- runTests : false
44
- buildJava : false
45
- java_artifact_id : onnxruntime_gpu
46
- UseIncreasedTimeoutForTests : false
47
- SpecificArtifact : false
48
- BuildId : ' 0'
49
-
50
- - template : templates/qnn-ep-win.yml
51
- parameters :
52
- qnn_ep_build_pool_name : ' Onnxruntime-QNNEP-Windows-2022-CPU'
53
- QnnSdk : ${{ parameters.QnnSdk }}
54
- IsReleaseBuild : ${{ parameters.IsReleaseBuild }}
55
- DoEsrp : true
56
- ArtifactName : ' drop-nuget-qnn-arm64'
57
- # Add --use_webgpu to enable WebGPU
58
- buildParameter : ' --arm64'
59
- buildPlatform : ' ARM64'
60
- buildArch : ' ARM64'
61
- StageName : ' OnnxRuntime_QNN_Nuget_Win_Arm64'
62
- build_config : ' RelWithDebInfo'
63
- Is1ES : false
64
- PublishArchive : true
65
-
66
- - stage : NugetPackaging
67
- dependsOn : [Windows_Packaging_CUDA, OnnxRuntime_QNN_Nuget_Win_Arm64]
68
- jobs :
69
- - job : CreateNugetPackage
70
- pool : ' Onnxruntime-Win2022-GPU-A10'
71
- timeoutInMinutes : 120
72
- steps :
73
- - checkout : self
74
- clean : true
75
- submodules : none
76
-
77
- - task : UsePythonVersion@0
78
- inputs :
79
- versionSpec : ' 3.12'
80
- addToPath : true
81
-
82
- - task : DownloadPipelineArtifact@0
83
- displayName : ' Download Pipeline Artifact - managed nuget'
84
- inputs :
85
- artifactName : ' drop-nuget-qnn-arm64'
86
- targetPath : ' $(Build.BinariesDirectory)/managed-nuget'
87
-
88
- - task : DownloadPipelineArtifact@0
89
- displayName : ' Download Pipeline Artifact - win-x64'
90
- inputs :
91
- artifactName : ' onnxruntime-win-x64-cuda'
92
- targetPath : ' $(Build.BinariesDirectory)/win-x64'
93
-
94
- - task : DownloadPipelineArtifact@0
95
- displayName : ' Download Pipeline Artifact - win-arm64'
96
- inputs :
97
- artifactName : ' onnxruntime-win-ARM64-qnn'
98
- targetPath : ' $(Build.BinariesDirectory)/win-arm64'
99
-
100
- - task : PowerShell@2
101
- displayName : ' Extract Nuget Package Version'
102
- inputs :
103
- targetType : ' inline'
104
- script : |
105
- $nupkgs = (Get-ChildItem $(Build.BinariesDirectory)/managed-nuget -Filter Microsoft.ML.OnnxRuntime.Managed.*.nupkg -Recurse)
106
- $package_name = $nupkgs[0].Name
107
- $version_length = $package_name.Length - "Microsoft.ML.OnnxRuntime.Managed.".Length - ".nupkg".Length
108
- $package_version = $package_name.Substring("Microsoft.ML.OnnxRuntime.Managed.".Length, $version_length)
109
- Write-Host "##vso[task.setvariable variable=package_version;]$package_version"
110
- workingDirectory : $(Build.BinariesDirectory)
111
-
112
- - task : PowerShell@2
113
- displayName : ' Extract Archives'
114
- inputs :
115
- targetType : ' inline'
116
- script : |
117
- Expand-Archive -Path $(Build.BinariesDirectory)/win-x64/onnxruntime-win-x64-cuda*.zip -DestinationPath $(Build.BinariesDirectory)/win-x64
118
- Expand-Archive -Path $(Build.BinariesDirectory)/win-arm64/onnxruntime-win-ARM64-qnn*.zip -DestinationPath $(Build.BinariesDirectory)/win-arm64
119
- $win_x64 = (Get-ChildItem -Path $(Build.BinariesDirectory)/win-x64 -Filter onnxruntime-win-x64-cuda*)[0].FullName
120
- $win_arm64 = (Get-ChildItem -Path $(Build.BinariesDirectory)/win-arm64 -Filter onnxruntime-win-ARM64-qnn*)[0].FullName
121
- Write-Host "##vso[task.setvariable variable=win_x64;]$win_x64"
122
- Write-Host "##vso[task.setvariable variable=win_arm64;]$win_arm64"
123
- workingDirectory : $(Build.BinariesDirectory)
124
-
125
- - task : PythonScript@0
126
- displayName : ' Generate Nuget Package'
127
- inputs :
128
- scriptPath : ' $(Build.SourcesDirectory)/tools/nuget/generate_nuspec_for_custom_nuget.py'
129
- arguments : ' --nuspec_path "$(Build.BinariesDirectory)/${{ parameters.PackageName }}.nuspec" --root_dir "$(Build.SourcesDirectory)" --commit_id "$(Build.SourceVersion)" --win_arm64 "$(win_arm64)" --win_x64 "$(win_x64)" --package_version "$(package_version)" --package_name "${{ parameters.PackageName }}"'
130
-
131
- - task : NuGetCommand@2
132
- displayName : ' Pack Nuget Package'
133
- inputs :
134
- command : ' pack'
135
- packagesToPack : ' $(Build.BinariesDirectory)/${{ parameters.PackageName }}.nuspec'
136
- packDestination : $(Build.ArtifactStagingDirectory)\
137
-
138
- - task : PublishBuildArtifacts@1
139
- displayName : ' Publish Artifact: Nuget'
140
- inputs :
141
- pathtoPublish : ' $(Build.ArtifactStagingDirectory)'
142
- artifactName : ' ${{ parameters.PackageName }}'
31
+ resources :
32
+ repositories :
33
+ - repository : 1esPipelines
34
+ type : git
35
+ name : 1ESPipelineTemplates/1ESPipelineTemplates
36
+ ref : refs/tags/release
37
+ extends :
38
+ # The pipeline extends the 1ES PT which will inject different SDL and compliance tasks.
39
+ # For non-production pipelines, use "Unofficial" as defined below.
40
+ # For productions pipelines, use "Official".
41
+ template : v1/1ES.Official.PipelineTemplate.yml@1esPipelines
42
+ parameters :
43
+ sdl :
44
+ sourceAnalysisPool :
45
+ name : onnxruntime-Win-CPU-2022
46
+ os : windows
47
+
48
+ stages :
49
+ - template : templates/win-ci.yml
50
+ parameters :
51
+ ort_build_pool_name : ' onnxruntime-Win2022-GPU-A10'
52
+ DoCompliance : false
53
+ DoEsrp : true
54
+ stage_name_suffix : CUDA
55
+ buildArch : x64
56
+ msbuildPlatform : x64
57
+ packageName : x64-cuda
58
+ CudaVersion : ${{ parameters.CudaVersion }}
59
+ buildparameter : --use_cuda --cuda_home=${{ variables.win_cuda_home }} --enable_onnx_tests --enable_wcos --use_webgpu --cmake_extra_defines "CMAKE_CUDA_ARCHITECTURES=52-real;61-real;75-real;86-real;89-real;90-virtual"
60
+ runTests : false
61
+ buildJava : false
62
+ java_artifact_id : onnxruntime_gpu
63
+ UseIncreasedTimeoutForTests : false
64
+ SpecificArtifact : false
65
+ BuildId : ' 0'
66
+
67
+ - template : templates/qnn-ep-win.yml
68
+ parameters :
69
+ qnn_ep_build_pool_name : ' Onnxruntime-QNNEP-Windows-2022-CPU'
70
+ QnnSdk : ${{ parameters.QnnSdk }}
71
+ IsReleaseBuild : ${{ parameters.IsReleaseBuild }}
72
+ DoEsrp : true
73
+ ArtifactName : ' drop-nuget-qnn-arm64'
74
+ # Add --use_webgpu to enable WebGPU
75
+ buildParameter : ' --arm64'
76
+ buildPlatform : ' ARM64'
77
+ buildArch : ' ARM64'
78
+ StageName : ' OnnxRuntime_QNN_Nuget_Win_Arm64'
79
+ build_config : ' RelWithDebInfo'
80
+ PublishArchive : true
81
+
82
+ - stage : NugetPackaging
83
+ dependsOn : [Windows_Packaging_CUDA, OnnxRuntime_QNN_Nuget_Win_Arm64]
84
+ jobs :
85
+ - job : CreateNugetPackage
86
+ pool : ' Onnxruntime-Win2022-GPU-A10'
87
+ timeoutInMinutes : 120
88
+ steps :
89
+ - checkout : self
90
+ clean : true
91
+ submodules : none
92
+
93
+ - task : UsePythonVersion@0
94
+ inputs :
95
+ versionSpec : ' 3.12'
96
+ addToPath : true
97
+
98
+ - task : DownloadPipelineArtifact@0
99
+ displayName : ' Download Pipeline Artifact - managed nuget'
100
+ inputs :
101
+ artifactName : ' drop-nuget-qnn-arm64'
102
+ targetPath : ' $(Build.BinariesDirectory)/managed-nuget'
103
+
104
+ - task : DownloadPipelineArtifact@0
105
+ displayName : ' Download Pipeline Artifact - win-x64'
106
+ inputs :
107
+ artifactName : ' onnxruntime-win-x64-cuda'
108
+ targetPath : ' $(Build.BinariesDirectory)/win-x64'
109
+
110
+ - task : DownloadPipelineArtifact@0
111
+ displayName : ' Download Pipeline Artifact - win-arm64'
112
+ inputs :
113
+ artifactName : ' onnxruntime-win-ARM64-qnn'
114
+ targetPath : ' $(Build.BinariesDirectory)/win-arm64'
115
+
116
+ - task : PowerShell@2
117
+ displayName : ' Extract Nuget Package Version'
118
+ inputs :
119
+ targetType : ' inline'
120
+ script : |
121
+ $nupkgs = (Get-ChildItem $(Build.BinariesDirectory)/managed-nuget -Filter Microsoft.ML.OnnxRuntime.Managed.*.nupkg -Recurse)
122
+ $package_name = $nupkgs[0].Name
123
+ $version_length = $package_name.Length - "Microsoft.ML.OnnxRuntime.Managed.".Length - ".nupkg".Length
124
+ $package_version = $package_name.Substring("Microsoft.ML.OnnxRuntime.Managed.".Length, $version_length)
125
+ Write-Host "##vso[task.setvariable variable=package_version;]$package_version"
126
+ workingDirectory : $(Build.BinariesDirectory)
127
+
128
+ - task : PowerShell@2
129
+ displayName : ' Extract Archives'
130
+ inputs :
131
+ targetType : ' inline'
132
+ script : |
133
+ Expand-Archive -Path $(Build.BinariesDirectory)/win-x64/onnxruntime-win-x64-cuda*.zip -DestinationPath $(Build.BinariesDirectory)/win-x64
134
+ Expand-Archive -Path $(Build.BinariesDirectory)/win-arm64/onnxruntime-win-ARM64-qnn*.zip -DestinationPath $(Build.BinariesDirectory)/win-arm64
135
+ $win_x64 = (Get-ChildItem -Path $(Build.BinariesDirectory)/win-x64 -Filter onnxruntime-win-x64-cuda*)[0].FullName
136
+ $win_arm64 = (Get-ChildItem -Path $(Build.BinariesDirectory)/win-arm64 -Filter onnxruntime-win-ARM64-qnn*)[0].FullName
137
+ Write-Host "##vso[task.setvariable variable=win_x64;]$win_x64"
138
+ Write-Host "##vso[task.setvariable variable=win_arm64;]$win_arm64"
139
+ workingDirectory : $(Build.BinariesDirectory)
140
+
141
+ - task : PythonScript@0
142
+ displayName : ' Generate Nuget Package'
143
+ inputs :
144
+ scriptPath : ' $(Build.SourcesDirectory)/tools/nuget/generate_nuspec_for_custom_nuget.py'
145
+ arguments : ' --nuspec_path "$(Build.BinariesDirectory)/${{ parameters.PackageName }}.nuspec" --root_dir "$(Build.SourcesDirectory)" --commit_id "$(Build.SourceVersion)" --win_arm64 "$(win_arm64)" --win_x64 "$(win_x64)" --package_version "$(package_version)" --package_name "${{ parameters.PackageName }}"'
146
+
147
+ - task : NuGetCommand@2
148
+ displayName : ' Pack Nuget Package'
149
+ inputs :
150
+ command : ' pack'
151
+ packagesToPack : ' $(Build.BinariesDirectory)/${{ parameters.PackageName }}.nuspec'
152
+ packDestination : $(Build.ArtifactStagingDirectory)\
153
+
154
+ - task : 1ES.PublishPipelineArtifact@1
155
+ displayName : ' Publish Artifact: Nuget'
156
+ inputs :
157
+ artifactName : ' ${{ parameters.PackageName }}'
158
+ targetPath : ' $(Build.ArtifactStagingDirectory)'
0 commit comments