Disable LTO on Windows training CPU build (#3960)

Disable LTO on Windows training CPU build. Add a parameter to the win-ci-2019.yml build template for enabling LTO with a default value of true.
This commit is contained in:
edgchen1 2020-05-18 09:24:10 -07:00 committed by GitHub
parent 44731e88bb
commit e55f24364a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View file

@ -19,3 +19,4 @@ jobs:
EnvSetupScript: 'setup_env.bat'
sln_platform: 'x64'
BuildConfigurations: ['Debug', 'RelWithDebInfo']
EnableLto: false

View file

@ -17,6 +17,7 @@ parameters:
OrtPackageId: Microsoft.ML.OnnxRuntime
BuildConfigurations: ['RelWithDebInfo'] # Options: Debug, RelWithDebInfo
RunTests : 'true'
EnableLto: true
jobs:
- job: ${{ parameters.JobName }}
timeoutInMinutes: 160
@ -38,6 +39,8 @@ jobs:
DotNetExe: 'dotnet.exe'
CUDA_VERSION: ${{ parameters.CudaVersion }}
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
${{ if eq(parameters.EnableLto, true) }}:
build_py_lto_flag: --enable_lto
steps:
- checkout: self
@ -87,7 +90,7 @@ jobs:
displayName: 'Generate cmake config'
inputs:
scriptPath: '$(Build.SourcesDirectory)\tools\ci_build\build.py'
arguments: '$(BuildCommand) --update --config $(BuildConfig) --enable_lto'
arguments: '$(BuildCommand) --update --config $(BuildConfig) ${{ variables.build_py_lto_flag }}'
workingDirectory: '$(Build.BinariesDirectory)'
- ${{ if notIn(parameters['sln_platform'], 'Win32', 'x64') }}:
@ -156,7 +159,7 @@ jobs:
python.exe -m pip install -q --upgrade %WHEEL_FILENAME%
set PATH=%PATH%;$(Build.BinariesDirectory)\$(BuildConfig)\$(BuildConfig)
@echo %PATH%
python $(Build.SourcesDirectory)\tools\ci_build\build.py $(BuildCommand) --test --config $(BuildConfig) --enable_lto
python $(Build.SourcesDirectory)\tools\ci_build\build.py $(BuildCommand) --test --config $(BuildConfig) ${{ variables.build_py_lto_flag }}
workingDirectory: '$(Build.BinariesDirectory)\$(BuildConfig)\$(BuildConfig)'
displayName: 'Run tests'