onnxruntime/tools/ci_build/github/azure-pipelines/templates/win-ci.yml
Adrian Tsai 4090d0d0de
Add DirectML Execution Provider (#2057)
This change adds a new execution provider powered by [DirectML](https://aka.ms/DirectML).

DirectML is a high-performance, hardware-accelerated DirectX 12 library for machine learning on Windows. DirectML provides GPU acceleration for common machine learning tasks across a broad range of supported hardware and drivers.

The DirectML execution provider is capable of greatly improving evaluation time of models using commodity GPU hardware, without sacrificing broad hardware support or requiring vendor-specific extensions to be installed.

**Note** that the DML EP code was moved verbatim from the existing WindowsAI project, which is why it doesn't yet conform to the onnxruntime coding style. This is something that can be fixed later; we would like to keep formatting/whitespace changes to a minimum for the time being to make it easier to port fixes from WindowsAI to ORT during this transition.

Summary of changes:
* Initial commit of DML EP files under onnxruntime/core/providers/dml
* Add cmake entries for building the DML EP and for pulling down the DirectML redist using nuget
* Add a submodule dependency on the Windows Implementation Library (WIL)
* Add docs under docs/execution_providers/DirectML-ExecutionProvider.md
* Add support for DML EP to provider tests and perf tests
* Add support for DML EP to fns_candy_style_transfer sample
* Add entries to the C ABI for instantiating the DML EP
2019-10-15 06:13:07 -07:00

202 lines
7.1 KiB
YAML

parameters:
DoDebugBuild: 'true'
DoCompliance: 'false'
BuildCommand: ''
JobName: 'Windows_CI_Dev'
DoNugetPack: 'false'
NuPackScript : ''
ArtifactName: 'drop-nuget'
DoEsrp: 'false'
DoTestCoverage: 'false'
BuildArch: 'x64'
SetVcvars: 'false'
MsbuildArguments: '/m'
EnvSetupScript: 'setup_env.bat'
CudaVersion: ''
AgentPool: 'Win-CPU'
AgentDemands: []
jobs:
- job: ${{ parameters.JobName }}
timeoutInMinutes: 120
pool:
name: ${{ parameters.AgentPool }}
demands: ${{ parameters.AgentDemands }}
variables:
buildDirectory: '$(Build.BinariesDirectory)'
BuildCommand: ${{ parameters.BuildCommand }}
OnnxRuntimeBuildDirectory: '$(Build.BinariesDirectory)'
DotNetExe: 'dotnet.exe'
CUDA_VERSION: ${{ parameters.CudaVersion }}
steps:
- template: set-test-data-variables-step.yml
- template: windows-build-tools-setup-steps.yml
parameters:
EnvSetupScript: ${{ parameters.EnvSetupScript }}
buildArch: ${{ parameters.BuildArch }}
setVcvars: ${{ parameters.SetVcvars }}
# Copy CUDA props files if needed
- ${{ if eq(parameters['CudaVersion'], '10.0') }}:
- task: PowerShell@1
displayName: 'Set CUDA path'
inputs:
scriptName: 'tools/ci_build/github/windows/set_cuda_path.ps1'
arguments: '-CudaMsbuildPath C:\local\cudaMsbuildIntegration-10.0.130-win10 -CudaVersion ${{ parameters.CudaVersion }}'
- task: CmdLine@1
displayName: 'Download test data and generate cmake config'
inputs:
filename: '$(Build.BinariesDirectory)\packages\python\python.exe'
arguments: '$(BuildCommand) --update --config Debug RelWithDebInfo'
workingDirectory: "$(Build.BinariesDirectory)"
# Build Debug Mode
- ${{ if eq(parameters['DoDebugBuild'], 'true') }}:
- task: VSBuild@1
displayName: 'Build Debug'
inputs:
solution: '$(Build.BinariesDirectory)\Debug\onnxruntime.sln'
platform: 'x64'
configuration: 'Debug'
msbuildArgs: ${{ parameters.MsbuildArguments }}
msbuildArchitecture: 'x64'
maximumCpuCount: true
logProjectEvents: true
workingFolder: '$(Build.BinariesDirectory)\Debug'
createLogFile: true
- task: BatchScript@1
displayName: 'Test Debug'
inputs:
filename: '$(Build.BinariesDirectory)\packages\python\python.exe'
arguments: '$(BuildCommand) --test --config Debug'
workingFolder: '$(Build.BinariesDirectory)'
- task: MSBuild@1
displayName: 'Build C# Debug'
inputs:
solution: '$(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.proj'
platform: 'Any CPU'
configuration: 'Debug'
msbuildArchitecture: 'x64'
workingFolder: '$(Build.SourcesDirectory)\csharp'
- task: MSBuild@1
displayName: 'Test C# Debug'
inputs:
solution: '$(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.proj'
platform: 'Any CPU'
configuration: 'Debug'
msbuildArchitecture: 'x64'
msbuildArguments: '/t:RunTest'
workingFolder: '$(Build.SourcesDirectory)\csharp'
# Run test coverage report
- ${{ if eq(parameters['DoTestCoverage'], 'true') }}:
- template: windows-code-coverage-steps.yml
parameters:
OpenCppCoverageExe: '$(Build.BinariesDirectory)\OpenCppCoverage\OpenCppCoverage.exe'
# Build RelWithDebInfo -- this variable required to build C#
- script: |
@echo ##vso[task.setvariable variable=Configuration]RelWithDebInfo
- task: VSBuild@1
displayName: 'Build RelWithDebInfo'
inputs:
solution: '$(Build.BinariesDirectory)\RelWithDebInfo\onnxruntime.sln'
platform: 'x64'
configuration: 'RelWithDebInfo'
msbuildArgs: ${{ parameters.MsbuildArguments }}
msbuildArchitecture: 'x64'
logProjectEvents: true
workingFolder: '$(Build.BinariesDirectory)\RelWithDebInfo'
- task: BatchScript@1
displayName: 'Test RelWithDebInfo'
inputs:
filename: '$(Build.BinariesDirectory)\packages\python\python.exe'
arguments: '$(BuildCommand) --test --config RelWithDebInfo'
workingFolder: "$(Build.BinariesDirectory)"
- task: MSBuild@1
displayName: 'Build C# RelWithDebInfo'
inputs:
solution: '$(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.proj'
platform: 'Any CPU'
configuration: 'RelWithDebInfo'
msbuildArchitecture: 'x64'
workingFolder: '$(Build.SourcesDirectory)\csharp'
- task: MSBuild@1
displayName: 'Test C# RelWithDebInfo'
inputs:
solution: '$(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.proj'
platform: 'Any CPU'
configuration: 'RelWithDebInfo'
msbuildArchitecture: 'x64'
msbuildArguments: '/t:RunTest'
workingfolder: '$(Build.SourcesDirectory)\csharp'
- task: PublishTestResults@2
displayName: 'Publish unit test results'
inputs:
testResultsFiles: '**\*.results.xml'
searchFolder: '$(Build.BinariesDirectory)'
testRunTitle: 'Unit Test Run'
condition: succeededOrFailed()
# Nuget packaging if needed
- ${{ if eq(parameters['DoNugetPack'], 'true') }}:
- task: BatchScript@1
displayName: 'Setup VS2017 env vars'
inputs:
filename: 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat'
arguments: 'x64'
modifyEnvironment: true
# Esrp signing
- template: esrp_dll.yml
parameters:
FolderPath: '$(Build.BinariesDirectory)\RelWithDebInfo'
DisplayName: 'ESRP - Sign Native dlls'
DoEsrp: ${{ parameters.DoEsrp }}
- template: esrp_dll.yml
parameters:
FolderPath: '$(Build.SourcesDirectory)\csharp\src\Microsoft.ML.OnnxRuntime\bin\RelWithDebInfo'
DisplayName: 'ESRP - Sign C# dlls'
DoEsrp: ${{ parameters.DoEsrp }}
- script: |
${{ parameters.NuPackScript }}
workingDirectory: '$(Build.SourcesDirectory)\csharp'
displayName: 'Create NuGet Package'
- task: PublishPipelineArtifact@0
displayName: 'Publish Pipeline Artifact: drop-nuget'
inputs:
artifactName: ${{ parameters.ArtifactName }}
targetPath: '$(Build.ArtifactStagingDirectory)'
# Remove CUDA props files after build
- ${{ if eq(parameters['CudaVersion'], '10.0') }}:
- task: PowerShell@1
displayName: 'Clean up CUDA props files'
inputs:
scriptName: 'tools/ci_build/github/windows/clean_up_cuda_prop_files.ps1'
arguments: '-CudaVersion ${{ parameters.CudaVersion }}'
# Compliance tasks require logs from Debug Build
- ${{ if eq(parameters['DoCompliance'], 'true') }}:
- template: compliance.yml
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
displayName: 'Component Detection'
condition: succeeded()
- template: clean-agent-build-directory-step.yml