onnxruntime/tools/ci_build/github/azure-pipelines/templates/jobs/win-ci-prebuild-steps.yml
liqun Fu 2be4dc6d04
ONNX 1.15 integration (#17125)
### Description
this is for ORT 1.17.0 - make ORT to use ONNX release 1.15.0 branch. Eventually will update to the release tag once ONNX 1.15.0 is released


### Motivation and Context
Prepare for ORT 1.17.0 release. People can start work on new and updated ONNX ops in ORT.
---------

Signed-off-by: Liqun Fu <liqfu@microsoft.com>
2023-09-26 14:44:48 -07:00

95 lines
3.3 KiB
YAML

parameters:
- name: EnvSetupScript
type: string
default: setup_env.bat
- name: BuildConfig
type: string
- name: BuildArch
type: string
- name: DownloadCUDA
type: boolean
default: false
- name: WITHCACHE
type: boolean
default: false
- name: MachinePool
type: string
- name: Today
type: string
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.8'
addToPath: true
architecture: ${{parameters.BuildArch}}
- script: |
python -m pip install --upgrade "setuptools>=61.0.0" wheel numpy flatbuffers
workingDirectory: '$(Build.BinariesDirectory)'
displayName: 'Install python modules'
- 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)
- template: set-winenv.yml
parameters:
EnvSetupScript: ${{parameters.EnvSetupScript}}
DownloadCUDA: ${{parameters.DownloadCUDA}}
- ${{ if eq(parameters.WITHCACHE, true) }}:
- powershell: |
if ([string]::IsNullOrEmpty((Get-Command ccache -errorAction SilentlyContinue)))
{
choco install ccache -y --version 4.7.4
$ccache_path = (Get-Command ccache).Source
$ccache_parent_dir = (Split-Path -parent $ccache_path)
Copy-Item "C:\ProgramData\chocolatey\lib\ccache\tools\ccache-4.7.4-windows-x86_64\ccache.exe" -Destination "C:\ProgramData\chocolatey\bin\cl.exe"
Get-ChildItem $ccache_parent_dir
ccache --version
}
displayName: Install ccache and update PATH to use linked versions of gcc, cc, etc
- ${{ if eq(parameters.WITHCACHE, true) }}:
- task: Cache@2
# machinepool is used to ensure the compiler is same
inputs:
key: '"$(TODAY)" | ${{ parameters.buildArch }} | ${{ parameters.BuildConfig }} | ${{ parameters.MachinePool }} | $(Build.SourcesDirectory)/cmake/deps.txt, $(Build.SourcesDirectory)/tools/ci_build/github/windows/install_third_party_deps.ps1, $(Build.SourcesDirectory)/tools/ci_build/github/windows/helpers.ps1'
path: $(Agent.TempDirectory)/deps_ccache
restoreKeys: |
"$(TODAY)" | ${{ parameters.buildArch }} | ${{ parameters.BuildConfig }} | ${{ parameters.MachinePool }}
displayName: Cache Task
- task: PowerShell@2
displayName: 'Install ONNX'
inputs:
filePath: '$(Build.SourcesDirectory)/tools/ci_build/github/windows/install_third_party_deps.ps1'
workingDirectory: '$(Build.BinariesDirectory)'
${{ if eq(parameters.WITHCACHE, true) }}:
arguments: -cpu_arch ${{ parameters.buildArch }} -install_prefix $(Build.BinariesDirectory)\${{ parameters.BuildConfig }}\installed -build_config ${{ parameters.BuildConfig }} -use_cache
${{ else }}:
arguments: -cpu_arch ${{ parameters.buildArch }} -install_prefix $(Build.BinariesDirectory)\${{ parameters.BuildConfig }}\installed -build_config ${{ parameters.BuildConfig }}
${{ if eq(parameters.WITHCACHE, true) }}:
env:
CCACHE_DIR: $(Agent.TempDirectory)/deps_ccache
CCACHE_COMPILERCHECK: content
- ${{ if eq(parameters.WITHCACHE, true) }}:
- powershell: |
ccache -sv
ccache -z
displayName: cache stat
env:
CCACHE_DIR: $(Agent.TempDirectory)/deps_ccache