Skip to content

Commit

Permalink
Fix DML release build (#14661)
Browse files Browse the repository at this point in the history
### Description
Fixes the DML release build for 1.14.1. This was initially fixed by
#13417 for 1.13.1, but the
changes didn't make their way back to the main branch.
  • Loading branch information
PatriceVignola authored Feb 14, 2023
1 parent 6e10088 commit ce9a716
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ parameters:
type: boolean
default: true

- name: UseIncreasedTimeoutForTests
- name: UseIncreasedTimeoutForTests
displayName: Increase timeout for tests? Set it to false if you are doing an Onnx Runtime release.
type: boolean
default: false
Expand Down Expand Up @@ -671,6 +671,7 @@ jobs:
- template: nuget/templates/dml-vs-2019.yml
parameters:
AgentPool : 'aiinfra-dml-winbuild'
IsReleaseBuild: ${{ parameters.IsReleaseBuild }}
ArtifactName: 'drop-nuget-dml'
JobName: 'Windows_CI_GPU_DML_Dev'
BuildCommand: --build_dir $(Build.BinariesDirectory) --skip_submodule_sync --build_shared_lib --enable_onnx_tests --enable_wcos --use_telemetry --use_dml --use_winml --cmake_generator "Visual Studio 16 2019"
Expand All @@ -685,7 +686,7 @@ jobs:
CudaVersion: '11.6'
OrtPackageId: 'Microsoft.ML.OnnxRuntime.DirectML'
NuPackScript: |
msbuild $(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.proj /p:Configuration=RelWithDebInfo /t:CreatePackage /p:OrtPackageId=Microsoft.ML.OnnxRuntime.DirectML
msbuild $(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.proj /p:Configuration=RelWithDebInfo /t:CreatePackage /p:OrtPackageId=Microsoft.ML.OnnxRuntime.DirectML /p:IsReleaseBuild=${{ parameters.IsReleaseBuild }}
copy $(Build.SourcesDirectory)\csharp\src\Microsoft.ML.OnnxRuntime\bin\RelWithDebInfo\*.nupkg $(Build.ArtifactStagingDirectory)
copy $(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo\*.nupkg $(Build.ArtifactStagingDirectory)
mkdir $(Build.ArtifactStagingDirectory)\testdata
Expand All @@ -694,6 +695,7 @@ jobs:
- template: nuget/templates/dml-vs-2019.yml
parameters:
AgentPool : 'aiinfra-dml-winbuild'
IsReleaseBuild: ${{ parameters.IsReleaseBuild }}
ArtifactName: 'drop-win-dml-x86-zip'
JobName: 'Windows_CI_GPU_DML_Dev_x86'
BuildCommand: --build_dir $(Build.BinariesDirectory) --skip_submodule_sync --build_shared_lib --enable_onnx_tests --enable_wcos --use_telemetry --use_dml --use_winml --cmake_generator "Visual Studio 16 2019"
Expand All @@ -706,7 +708,7 @@ jobs:
DoEsrp: ${{ parameters.DoEsrp }}
RunTests: 'false'
NuPackScript: |
msbuild $(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.proj /p:Configuration=RelWithDebInfo /p:TargetArchitecture=x86 /t:CreatePackage /p:OrtPackageId=Microsoft.ML.OnnxRuntime.DirectML
msbuild $(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.proj /p:Configuration=RelWithDebInfo /p:TargetArchitecture=x86 /t:CreatePackage /p:OrtPackageId=Microsoft.ML.OnnxRuntime.DirectML /p:IsReleaseBuild=${{ parameters.IsReleaseBuild }}
cd $(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo\
ren Microsoft.ML.OnnxRuntime.DirectML.* win-dml-x86.zip
copy $(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo\win-dml-x86.zip $(Build.ArtifactStagingDirectory)
Expand All @@ -716,6 +718,7 @@ jobs:
- template: nuget/templates/dml-vs-2019.yml
parameters:
AgentPool : 'Win-CPU-2021'
IsReleaseBuild: ${{ parameters.IsReleaseBuild }}
ArtifactName: 'drop-win-dml-arm64-zip'
JobName: 'Windows_CI_GPU_DML_Dev_arm64'
BuildCommand: --build_dir $(Build.BinariesDirectory) --arm64 --skip_submodule_sync --build_shared_lib --enable_onnx_tests --enable_wcos --use_telemetry --use_dml --use_winml --cmake_generator "Visual Studio 16 2019"
Expand All @@ -728,7 +731,7 @@ jobs:
DoEsrp: ${{ parameters.DoEsrp }}
RunTests: 'false'
NuPackScript: |
msbuild $(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.proj /p:Configuration=RelWithDebInfo /p:TargetArchitecture=arm64 /t:CreatePackage /p:OrtPackageId=Microsoft.ML.OnnxRuntime.DirectML
msbuild $(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.proj /p:Configuration=RelWithDebInfo /p:TargetArchitecture=arm64 /t:CreatePackage /p:OrtPackageId=Microsoft.ML.OnnxRuntime.DirectML /p:IsReleaseBuild=${{ parameters.IsReleaseBuild }}
cd $(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo\
ren Microsoft.ML.OnnxRuntime.DirectML.* win-dml-arm64.zip
copy $(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo\win-dml-arm64.zip $(Build.ArtifactStagingDirectory)
Expand All @@ -738,6 +741,7 @@ jobs:
- template: nuget/templates/dml-vs-2019.yml
parameters:
AgentPool : 'Win-CPU-2021'
IsReleaseBuild: ${{ parameters.IsReleaseBuild }}
ArtifactName: 'drop-win-dml-arm-zip'
JobName: 'Windows_CI_GPU_DML_Dev_arm'
BuildCommand: --build_dir $(Build.BinariesDirectory) --arm --skip_submodule_sync --build_shared_lib --enable_onnx_tests --enable_wcos --use_telemetry --use_dml --use_winml --cmake_generator "Visual Studio 16 2019"
Expand All @@ -750,7 +754,7 @@ jobs:
DoEsrp: ${{ parameters.DoEsrp }}
RunTests: 'false'
NuPackScript: |
msbuild $(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.proj /p:Configuration=RelWithDebInfo /p:TargetArchitecture=arm /t:CreatePackage /p:OrtPackageId=Microsoft.ML.OnnxRuntime.DirectML
msbuild $(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.proj /p:Configuration=RelWithDebInfo /p:TargetArchitecture=arm /t:CreatePackage /p:OrtPackageId=Microsoft.ML.OnnxRuntime.DirectML /p:IsReleaseBuild=${{ parameters.IsReleaseBuild }}
cd $(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo\
ren Microsoft.ML.OnnxRuntime.DirectML.* win-dml-arm.zip
copy $(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo\win-dml-arm.zip $(Build.ArtifactStagingDirectory)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ parameters:
EnableLto: true
# Controls whether unreleased onnx opsets are allowed. Default is set to 1
AllowReleasedOpsetOnly: '0'
IsReleaseBuild: false
jobs:
- job: ${{ parameters.JobName }}
timeoutInMinutes: 200
Expand Down Expand Up @@ -140,7 +141,7 @@ jobs:
solution: '$(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.sln'
configuration: '$(BuildConfig)'
platform: 'Any CPU'
msbuildArguments: '-p:OnnxRuntimeBuildDirectory="$(Build.BinariesDirectory)" -p:OrtPackageId=${{ parameters.OrtPackageId }}'
msbuildArguments: '-p:OnnxRuntimeBuildDirectory="$(Build.BinariesDirectory)" -p:OrtPackageId=${{ parameters.OrtPackageId }} -p:IsReleaseBuild=${{ parameters.IsReleaseBuild }}'
workingDirectory: '$(Build.SourcesDirectory)\csharp'

- script: |
Expand Down Expand Up @@ -214,13 +215,13 @@ jobs:
artifactName: ${{ parameters.ArtifactName }}
targetPath: '$(Build.ArtifactStagingDirectory)'

- task: PublishSymbols@2
displayName: 'Publish Build Symbols'
condition: eq(variables['IsReleaseBuild'], 'true')
inputs:
symbolsFolder: '$(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo'
searchPattern: '**/*.pdb'
symbolServerType: teamServices
- ${{ if eq(parameters['IsReleaseBuild'], 'true') }}:
- task: PublishSymbols@2
displayName: 'Publish Build Symbols'
inputs:
symbolsFolder: '$(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo'
searchPattern: '**/*.pdb'
symbolServerType: teamServices

# Node.js Publish
- ${{ if eq(parameters['DoNodejsPack'], 'true') }}:
Expand Down

0 comments on commit ce9a716

Please sign in to comment.