onnxruntime/tools/ci_build/github/azure-pipelines/templates/win-ci.yml
Rui Ren 1a48099eea
ORT 1.14.0 release -- cherry pick round1 (#14456)
### Description
<!-- Describe your changes. -->
First round cherry pick, total `19` PRs, as below. Please check here for
[Here](https://github.com/microsoft/onnxruntime/issues?q=label%3Arelease%3A1.14+sort%3Aupdated-asc)
for the total list.
<head>

<meta name=ProgId content=Excel.Sheet>
<meta name=Generator content="Microsoft Excel 15">
<link id=Main-File rel=Main-File

href="file:///C:/Users/ruiren/AppData/Local/Temp/msohtmlclip1/01/clip.htm">
<link rel=File-List

href="file:///C:/Users/ruiren/AppData/Local/Temp/msohtmlclip1/01/clip_filelist.xml">
<style>
<!--table
	{mso-displayed-decimal-separator:"\.";
	mso-displayed-thousand-separator:"\,";}
@page
	{margin:.75in .7in .75in .7in;
	mso-header-margin:.3in;
	mso-footer-margin:.3in;}
tr
	{mso-height-source:auto;}
col
	{mso-width-source:auto;}
br
	{mso-data-placement:same-cell;}
td
	{padding-top:1px;
	padding-right:1px;
	padding-left:1px;
	mso-ignore:padding;
	color:black;
	font-size:11.0pt;
	font-weight:400;
	font-style:normal;
	text-decoration:none;
	font-family:Calibri, sans-serif;
	mso-font-charset:0;
	mso-number-format:General;
	text-align:general;
	vertical-align:bottom;
	border:none;
	mso-background-source:auto;
	mso-pattern:auto;
	mso-protection:locked visible;
	white-space:nowrap;
	mso-rotate:0;}
.xl65
	{text-align:center;}
.xl66
	{color:windowtext;
	text-align:center;
	border:.5pt solid windowtext;
	background:#E2EFDA;
	mso-pattern:black none;}
.xl67
	{color:windowtext;
	text-align:center;
	border:.5pt solid windowtext;}
.xl68
	{color:windowtext;
	text-align:center;
	border:.5pt solid windowtext;
	background:white;
	mso-pattern:black none;}
-->
</style>
</head>

<body link="#0563C1" vlink="#954F72">



Date | PR | # | Commit # | Short #
-- | -- | -- | -- | --
0 | fix headers for training apis | 14350 |
ea7bbd667d | ea7bbd6
1 | Fix post merge jobs pipeline build issues | 14346 |
ae0e090c7b | ae0e090
2 | support ScatterND(18) and ScatterElement(18) | 14224 |
5d6a049141 | 5d6a049
3 | Exclude a multi-stream case from reduced ops build | 14351 |
36ba3d8d21 | 36ba3d8
4 | Support muP in Attention | 14348 |
668586e8f8 | 668586e
5 | Add memory efficient attention from CUTLASS | 14343 |
414b012f42 | 414b012
6 | Add PyTorch 2.0 to ORT transformer benchmarking | 14300 |
72821a6113 | 72821a6
7 | Misc transformer fixes - 3 | 14320 |
2d8ee5251c | 2d8ee52
8 | Update quantization_defs.cc | 14380 |
de7a868d5f | de7a868
9 | Revert "Allow PostAnalysis@2 task to continue on error for
Windows_Pa… | 14375 | cf3661ff6d | cf3661f
10 | Fix fuzz test | 14385 | f03c507cf0 |
f03c507
11 | support Pad(18) | 14219 | 05915d8393
| 05915d8
12 | Ort openvino 4.3 cli | 14341 |
77b455b969 | 77b455b
13 | cpu to support bitwise ops | 14197 |
7b6d880b28 | 7b6d880
14 | Update ORT format v5 change docs to cover limited backwards
compatibility in 1.14. | 14413 |
3bc092b1ea | 3bc092b
15 | Upgrade CUTLASS to v2.11 and add sequence length threshold for
cutlass FMHA | 14401 | 94b1791974 |
94b1791
16 | Add Col2Im CPU op | 12311 |
32c05fcdd1 | 32c05fc
17 | [DML EP] Upgrade DML to 1.10.1 | 14433 |
edb377f2cb | edb377f
18 | cpu support of LpPool(18) | 14205 |
2b1a59f01a | 2b1a59f



</body>

</html>


### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->
First round cherry-pick for ORT 1.14.0 release.

---------

Signed-off-by: Liqun Fu <liqfu@microsoft.com>
Co-authored-by: Ashwini Khade <askhade@microsoft.com>
Co-authored-by: Edward Chen <18449977+edgchen1@users.noreply.github.com>
Co-authored-by: liqun Fu <liqfu@microsoft.com>
Co-authored-by: RandySheriffH <48490400+RandySheriffH@users.noreply.github.com>
Co-authored-by: Randy Shuai <rashuai@microsoft.com>
Co-authored-by: Ye Wang <52801275+wangyems@users.noreply.github.com>
Co-authored-by: Ubuntu <wy@v100-2.0cdb2e52twzevn1i4fi45bylyg.jx.internal.cloudapp.net>
Co-authored-by: Tianlei Wu <tlwu@microsoft.com>
Co-authored-by: kunal-vaishnavi <115581922+kunal-vaishnavi@users.noreply.github.com>
Co-authored-by: Hariharan Seshadri <shariharan91@gmail.com>
Co-authored-by: Yi Zhang <zhanyi@microsoft.com>
Co-authored-by: Hector Li <hecli@microsoft.com>
Co-authored-by: sfatimar <sahar.fatima@intel.com>
Co-authored-by: Preetha <preetha.veeramalai@intel.com>
Co-authored-by: Thiago Crepaldi <thiago.crepaldi@microsoft.com>
Co-authored-by: Sumit Agarwal <sumitagarwal330@gmail.com>
2023-01-31 14:35:34 -08:00

303 lines
13 KiB
YAML

parameters:
- name: DoCompliance
displayName: Run Compliance Tasks?
type: boolean
default: true
- name: DoEsrp
displayName: Run code sign tasks? Must be true if you are doing an Onnx Runtime release.
type: boolean
default: false
- name: EnvSetupScript
type: string
- name: buildArch
type: string
- name: msbuildPlatform
type: string
- name: packageName
displayName: Package name for nuget
type: string
- name: buildparameter
displayName: Additional build commandline parameter
type: string
- name: runTests
type: boolean
default: true
- name: buildJava
type: boolean
default: true
- name: buildNodejs
type: boolean
default: false
- name: job_name_suffix
displayName: job name for nuget
type: string
default: ''
- name: ort_build_pool_name
type: string
default: 'Win-CPU-2021'
#'onnxruntime' or 'onnxruntime_gpu'
- name: java_artifact_id
type: string
default: 'onnxruntime'
- name: UseIncreasedTimeoutForTests
displayName: Increase timeout for tests? Set it to false if you are doing an Onnx Runtime release.
type: boolean
default: false
jobs:
- job: Windows_Packaging_${{ parameters.job_name_suffix }}
workspace:
clean: all
pool: ${{ parameters.ort_build_pool_name }}
${{ if eq(parameters['UseIncreasedTimeoutForTests'], 'true') }}:
timeoutInMinutes: 1200
${{ else }}:
timeoutInMinutes: 300
steps:
- checkout: self
clean: true
submodules: none
- template: telemetry-steps.yml
- task: UsePythonVersion@0
inputs:
versionSpec: '3.7'
addToPath: true
architecture: ${{ parameters.buildArch }}
- task: NodeTool@0
condition: and(succeeded(), eq('${{ parameters.buildNodejs}}', true))
inputs:
versionSpec: '16.x'
- task: BatchScript@1
displayName: 'setup env'
inputs:
filename: '$(Build.SourcesDirectory)\tools\ci_build\github\windows\${{ parameters.EnvSetupScript }}'
modifyEnvironment: true
workingFolder: '$(Build.BinariesDirectory)'
- 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 ${{ parameters.buildArch }} -install_prefix $(Build.BinariesDirectory)\RelWithDebInfo\installed -build_config RelWithDebInfo
- template: set-version-number-variables-step.yml
- task: PythonScript@0
displayName: 'Generate cmake config'
inputs:
scriptPath: '$(Build.SourcesDirectory)\tools\ci_build\build.py'
${{ if eq(parameters['UseIncreasedTimeoutForTests'], 'true') }}:
arguments: '--config RelWithDebInfo --enable_lto --disable_rtti --build_dir $(Build.BinariesDirectory) --skip_submodule_sync --build_shared_lib --update --cmake_generator "Visual Studio 16 2019" --enable_onnx_tests $(TelemetryOption) ${{ parameters.buildparameter }} --test_all_timeout 72000'
${{ else }}:
arguments: '--config RelWithDebInfo --enable_lto --disable_rtti --build_dir $(Build.BinariesDirectory) --skip_submodule_sync --build_shared_lib --update --cmake_generator "Visual Studio 16 2019" --enable_onnx_tests $(TelemetryOption) ${{ parameters.buildparameter }} '
workingDirectory: '$(Build.BinariesDirectory)'
- task: VSBuild@1
displayName: 'Build'
inputs:
solution: '$(Build.BinariesDirectory)\RelWithDebInfo\onnxruntime.sln'
platform: ${{ parameters.msbuildPlatform }}
configuration: RelWithDebInfo
msbuildArchitecture: ${{ parameters.buildArch }}
maximumCpuCount: true
logProjectEvents: true
workingFolder: '$(Build.BinariesDirectory)\RelWithDebInfo'
createLogFile: true
- task: PythonScript@0
displayName: 'test'
condition: and(succeeded(), eq('${{ parameters.runTests}}', true))
inputs:
scriptPath: '$(Build.SourcesDirectory)\tools\ci_build\build.py'
arguments: '--config RelWithDebInfo --enable_lto --disable_rtti --build_dir $(Build.BinariesDirectory) --skip_submodule_sync --build_shared_lib --test --cmake_generator "Visual Studio 16 2019" --enable_onnx_tests $(TelemetryOption) ${{ parameters.buildparameter }}'
workingDirectory: '$(Build.BinariesDirectory)'
- script: |
dir *.dll
mkdir $(Build.ArtifactStagingDirectory)\testdata
workingDirectory: '$(Build.BinariesDirectory)/RelWithDebInfo/RelWithDebInfo'
displayName: 'List built DLLs'
- template: c-api-artifacts-package-and-publish-steps-windows.yml
parameters:
buildConfig: RelWithDebInfo
artifactName: 'onnxruntime-win-${{ parameters.packageName }}-$(OnnxRuntimeVersion)'
artifactNameNoVersionString: 'onnxruntime-win-${{ parameters.packageName }}'
commitId: $(OnnxRuntimeGitCommitHash)
DoEsrp: ${{ parameters.DoEsrp }}
- ${{ if eq(parameters.buildNodejs, true) }}:
- template: nodejs-artifacts-package-and-publish-steps-windows.yml
parameters:
arch: ${{ parameters.packageName }}
artifactName: 'drop-onnxruntime-nodejs-win-${{ parameters.packageName }}'
DoEsrp: ${{ parameters.DoEsrp }}
#Upload protoc.exe, which will be used in nuget build for generating C# files
- task: PublishPipelineArtifact@1
condition: and(succeeded(), eq('${{ parameters.packageName}}', 'x64'))
inputs:
targetPath: '$(Build.BinariesDirectory)\RelWithDebInfo\installed\bin\protoc.exe'
artifactName: 'drop-extra'
- task: CopyFiles@2
displayName: 'Copy custom_op_library to: $(Build.ArtifactStagingDirectory)'
condition: and(succeeded(), eq('${{ parameters.packageName}}', 'x64'))
inputs:
SourceFolder: '$(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo'
Contents: 'custom_op_library.dll'
TargetFolder: '$(Build.ArtifactStagingDirectory)/testdata'
#To be used in test_win.yml
- task: PublishPipelineArtifact@1
condition: and(succeeded(), eq('${{ parameters.packageName}}', 'x64'))
inputs:
targetPath: '$(Build.BinariesDirectory)\RelWithDebInfo\installed\bin\protoc.exe'
artifactName: 'drop-nuget'
- task: CmdLine@2
condition: and(succeeded(), eq('${{ parameters.buildJava}}', true))
inputs:
script: |
@echo on
cd $(Build.SourcesDirectory)\java
gradle cmakeCheck -DcmakeBuildDir=$(Build.BinariesDirectory)\RelWithDebInfo
if %errorlevel% neq 0 exit /b %errorlevel%
cd $(Build.BinariesDirectory)\RelWithDebInfo
set NATIVE_FOLDER=$(Build.BinariesDirectory)\onnxruntime-java-win-${{ parameters.msbuildPlatform }}\stage\ai\onnxruntime\native\win-x64
mkdir %NATIVE_FOLDER%
echo "Directories created"
copy .\java\build\libs\*.jar $(Build.BinariesDirectory)\onnxruntime-java-win-${{ parameters.msbuildPlatform }}
pushd $(Build.BinariesDirectory)\onnxruntime-java-win-${{ parameters.msbuildPlatform }}
set artifact_id=${{ parameters.java_artifact_id }}
jar xf onnxruntime-$(OnnxRuntimeVersion).jar META-INF\maven\com.microsoft.onnxruntime\%artifact_id%\pom.xml
move META-INF\maven\com.microsoft.onnxruntime\%artifact_id%\pom.xml onnxruntime-$(OnnxRuntimeVersion).pom
rd /s /q META-INF
popd
copy .\RelWithDebInfo\onnxruntime.pdb %NATIVE_FOLDER%
copy .\RelWithDebInfo\onnxruntime4j_jni.pdb %NATIVE_FOLDER%
copy $(Build.SourcesDirectory)\docs\Privacy.md $(Build.BinariesDirectory)\onnxruntime-java-win-${{ parameters.msbuildPlatform }}\stage\Privacy.md
copy $(Build.SourcesDirectory)\ThirdPartyNotices.txt $(Build.BinariesDirectory)\onnxruntime-java-win-${{ parameters.msbuildPlatform }}\stage\ThirdPartyNotices.txt
@echo $(OnnxRuntimeGitCommitHash) > $(Build.BinariesDirectory)\onnxruntime-java-win-${{ parameters.msbuildPlatform }}\stage\GIT_COMMIT_ID
pushd $(Build.BinariesDirectory)\onnxruntime-java-win-${{ parameters.msbuildPlatform }}\stage
jar uf $(Build.BinariesDirectory)\onnxruntime-java-win-${{ parameters.msbuildPlatform }}\onnxruntime-$(OnnxRuntimeVersion).jar ai\onnxruntime\native\win-x64\onnxruntime.pdb
jar uf $(Build.BinariesDirectory)\onnxruntime-java-win-${{ parameters.msbuildPlatform }}\onnxruntime-$(OnnxRuntimeVersion).jar ai\onnxruntime\native\win-x64\onnxruntime4j_jni.pdb
jar uf $(Build.BinariesDirectory)\onnxruntime-java-win-${{ parameters.msbuildPlatform }}\onnxruntime-$(OnnxRuntimeVersion).jar Privacy.md ThirdPartyNotices.txt GIT_COMMIT_ID
popd
pushd $(Build.SourcesDirectory)\java\build\classes\java\test
if %errorlevel% neq 0 exit /b %errorlevel%
jar cvf $(Build.BinariesDirectory)\onnxruntime-java-win-${{ parameters.msbuildPlatform }}\testing.jar .
if %errorlevel% neq 0 exit /b %errorlevel%
popd
pushd $(Build.SourcesDirectory)\java\build\resources\test
rd /s /q ai\onnxruntime\native
jar uvf $(Build.BinariesDirectory)\onnxruntime-java-win-${{ parameters.msbuildPlatform }}\testing.jar .
popd
rd /s /q $(Build.BinariesDirectory)\onnxruntime-java-win-${{ parameters.msbuildPlatform }}\stage
dir /s /b $(Build.BinariesDirectory)\onnxruntime-java-win-${{ parameters.msbuildPlatform }}
workingDirectory: '$(Build.BinariesDirectory)\RelWithDebInfo'
displayName: 'Add symbols and notices to Java'
- task: PublishBuildArtifacts@1
condition: and(succeeded(), eq('${{ parameters.buildJava}}', true))
displayName: 'Publish Java temp binaries'
inputs:
pathtoPublish: '$(Build.BinariesDirectory)\onnxruntime-java-win-${{ parameters.msbuildPlatform }}'
artifactName: 'drop-onnxruntime-java-win-${{ parameters.packageName }}'
- ${{ if eq(parameters['DoCompliance'], 'true') }}:
- task: Semmle@0
condition: and(succeeded(), eq('${{ parameters.buildJava}}', true))
inputs:
sourceCodeDirectory: '$(Build.SourcesDirectory)\java'
language: 'java'
cleanupBuildCommands: 'C:\ProgramData\chocolatey\bin\gradle.exe -Dorg.gradle.daemon=false clean'
buildCommands: 'C:\ProgramData\chocolatey\bin\gradle.exe -Dorg.gradle.daemon=false jar'
querySuite: 'Recommended'
timeout: '7200'
ram: '16384'
addProjectDirToScanningExclusionList: true
- task: CredScan@3
displayName: 'Run CredScan'
inputs:
debugMode: false
continueOnError: true
- task: BinSkim@4
displayName: 'Run BinSkim'
inputs:
AnalyzeTargetGlob: '$(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo\**\*.dll'
continueOnError: true
- task: DeleteFiles@1
displayName: 'Delete files from $(Build.BinariesDirectory)\RelWithDebInfo'
inputs:
SourceFolder: '$(Build.BinariesDirectory)\RelWithDebInfo'
Contents: |
**/*.obj
**/*.pdb
**/*.dll
#Manually set msBuildCommandline so that we can also set CAExcludePath
- task: SDLNativeRules@3
displayName: 'Run the PREfast SDL Native Rules for MSBuild'
condition: and (succeeded(), eq(variables['msbuildPlatform'], 'x64'))
inputs:
msBuildArchitecture: amd64
setupCommandlines: 'python $(Build.SourcesDirectory)\tools\ci_build\build.py --config Debug --disable_rtti --build_dir $(Build.BinariesDirectory) --skip_submodule_sync --build_shared_lib --update --cmake_generator "Visual Studio 16 2019" --enable_onnx_tests $(TelemetryOption) ${{ parameters.buildparameter }} --cmake_extra_defines onnxruntime_ENABLE_STATIC_ANALYSIS=ON'
msBuildCommandline: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\amd64\msbuild.exe" "$(Build.BinariesDirectory)\Debug\onnxruntime.sln" /p:platform="$(MsbuildPlatform)" /p:configuration=Debug /p:VisualStudioVersion="16.0" /m /p:PreferredToolArchitecture=x64'
excludedPaths: '$(Build.BinariesDirectory)#$(Build.SourcesDirectory)\cmake#C:\program files (x86)'
- task: PostAnalysis@2
inputs:
GdnBreakAllTools: false
GdnBreakGdnToolBinSkim: true
GdnBreakPolicy: M365
GdnBreakPolicyMinSev: Error
- task: TSAUpload@2
displayName: 'TSA upload'
condition: and (succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main'))
inputs:
GdnPublishTsaOnboard: false
GdnPublishTsaConfigFile: '$(Build.sourcesDirectory)\.gdn\.gdntsa'
continueOnError: true
- template: component-governance-component-detection-steps.yml
parameters :
condition : 'succeeded'
- task: mspremier.PostBuildCleanup.PostBuildCleanup-task.PostBuildCleanup@3
displayName: 'Clean Agent Directories'
condition: always()