Cherry pick PR 3120 and 3131 to rel-1.2.0 (#3137)

* Enable DML Nuget Package for x64 or x86 architectures (#3120)

* add dml gpu pipelines

* add x86 to the gpu dml dev build pipeline

* Enable DML x86 builds

* Fix uint64_t -> size_t warning

* fix warnings

* enable dml on x86 ci builds

* operatorHelper 773 error uint32_t vs uint64_t

* operatorHelper 773 error uint32_t vs uint64_t

* make x86 pipeline use the gpu pool

* more warnings

* fix x86 directml path

* make dml nuget package

* disable tf_pnasnet_large

* disable zfnet512

* make validation use wildcards

* disable x86 dml gpu tests

* add args.

* update gpu.yml

* change nupkg wildcard

* add debug statements

* package x86 dml nupkg

* dont drop managed nuget again from dml pipeline build

* Add DML EULA

* directml license should be renamed to not clobber the existing license

* casing on dml package....

* {} to ()

* fix license name

* disable dml from x86 ci

* typo and cr feedback

* remove featurizers

* ship the dml pdb as well

* Fix CUDA PATH (#3131)

Previously, we put the "bin" folder of all the CUDA verions in the system PATH. And 10.2 is in the front. It's a mess.
So I've removed all of them from the system PATH env. But I need to add one of them back through build scripts.

(The problem only affect the C# test, not the C/C++ tests that forked from build.py).

Co-authored-by: smk2007 <smk2007@gmail.com>
Co-authored-by: Changming Sun <chasun@microsoft.com>
This commit is contained in:
Yufeng Li 2020-03-05 14:51:09 -08:00 committed by GitHub
parent c1166d1cd9
commit b71554c6dc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 167 additions and 51 deletions

View file

@ -56,7 +56,7 @@ elseif(onnxruntime_target_platform STREQUAL "ARM" OR CMAKE_GENERATOR MATCHES "AR
set(onnxruntime_target_platform "ARM")
elseif(onnxruntime_target_platform STREQUAL "x64" OR onnxruntime_target_platform STREQUAL "x86_64" OR onnxruntime_target_platform STREQUAL "AMD64" OR CMAKE_GENERATOR MATCHES "Win64")
set(onnxruntime_target_platform "x64")
elseif(onnxruntime_target_platform STREQUAL "x86" OR onnxruntime_target_platform STREQUAL "i386" OR onnxruntime_target_platform STREQUAL "i686")
elseif(onnxruntime_target_platform STREQUAL "Win32" OR onnxruntime_target_platform STREQUAL "x86" OR onnxruntime_target_platform STREQUAL "i386" OR onnxruntime_target_platform STREQUAL "i686")
set(onnxruntime_target_platform "x86")
endif()

View file

@ -435,6 +435,7 @@ if (onnxruntime_USE_DML)
if(NOT onnxruntime_target_platform STREQUAL "x86" AND NOT onnxruntime_target_platform STREQUAL "x64")
message(FATAL_ERROR "Target platform ${onnxruntime_target_platform} is not supported by DML")
endif()
foreach(file "DirectML.dll" "DirectML.pdb" "DirectML.Debug.dll" "DirectML.Debug.pdb")
add_custom_command(TARGET onnxruntime_providers_dml
POST_BUILD

View file

@ -18,8 +18,9 @@ CMake creates a target to this project
<IsReleaseBuild Condition=" '$(IsReleaseBuild)' == '' ">false</IsReleaseBuild>
<!--internal build related properties-->
<OnnxRuntimeSourceDirectory Condition="'$(OnnxRuntimeSourceDirectory)'==''">..</OnnxRuntimeSourceDirectory>
<OnnxRuntimeSourceDirectory Condition="'$(OnnxRuntimeSourceDirectory)'==''">..</OnnxRuntimeSourceDirectory>
<OnnxRuntimeBuildDirectory Condition="'$(OnnxRuntimeBuildDirectory)'==''">..\build\Windows</OnnxRuntimeBuildDirectory>
<OnnxRuntimePackagesDirectory Condition="'$(OnnxRuntimePackagesDirectory)'==''">$(OnnxRuntimeBuildDirectory)\packages</OnnxRuntimePackagesDirectory>
<NativeBuildOutputDir>$(OnnxRuntimeBuildDirectory)\$(Configuration)\$(Configuration)</NativeBuildOutputDir>
</PropertyGroup>
@ -87,6 +88,9 @@ CMake creates a target to this project
<ConvertToAbsolutePath Paths="$(NativeBuildOutputDir)">
<Output TaskParameter="AbsolutePaths" PropertyName="NativeBuildOutputDirAbs"/>
</ConvertToAbsolutePath>
<ConvertToAbsolutePath Paths="$(OnnxRuntimePackagesDirectory)">
<Output TaskParameter="AbsolutePaths" PropertyName="OnnxRuntimePackagesDirectoryAbs"/>
</ConvertToAbsolutePath>
<ConvertToAbsolutePath Paths="$(OnnxRuntimeSourceDirectory)">
<Output TaskParameter="AbsolutePaths" PropertyName="OnnxRuntimeSourceDirectoryAbs"/>
</ConvertToAbsolutePath>
@ -107,7 +111,7 @@ CMake creates a target to this project
Properties="NoBuild=true;Platform=AnyCPU;PackageVersion=$(PackageVersion);OrtPackageId=$(OrtPackageId)"/>
<Message Importance="High" Text="Generating nuspec for the native Nuget package ..." />
<Exec ContinueOnError="False" Command="python ..\tools\nuget\generate_nuspec_for_native_nuget.py --package_version $(PackageVersion) --package_name $(OrtPackageId) --target_architecture $(TargetArchitecture) --build_config $(Configuration) --native_build_path $(NativeBuildOutputDirAbs) --ort_build_path $(OnnxRuntimeBuildDirectoryAbs) --sources_path $(OnnxRuntimeSourceDirectoryAbs) --commit_id $(GitCommitHash) --is_release_build $(IsReleaseBuild)" ConsoleToMSBuild="true">
<Exec ContinueOnError="False" Command="python ..\tools\nuget\generate_nuspec_for_native_nuget.py --package_version $(PackageVersion) --package_name $(OrtPackageId) --target_architecture $(TargetArchitecture) --build_config $(Configuration) --native_build_path $(NativeBuildOutputDirAbs) --packages_path $(OnnxRuntimePackagesDirectoryAbs) --ort_build_path $(OnnxRuntimeBuildDirectoryAbs) --sources_path $(OnnxRuntimeSourceDirectoryAbs) --commit_id $(GitCommitHash) --is_release_build $(IsReleaseBuild)" ConsoleToMSBuild="true">
<Output TaskParameter="ConsoleOutput" PropertyName="GenerateNuspecOutput" />
</Exec>

View file

@ -92,8 +92,8 @@
CopyToOutputDirectory="Always"
Visible="false"
/>
<None Include="$(NativeBuildOutputDir)\windows.ai.machinelearning.dll"
Condition="Exists('$(NativeBuildOutputDir)\windows.ai.machinelearning.dll')
<None Include="$(NativeBuildOutputDir)\Windows.AI.MachineLearning.dll"
Condition="Exists('$(NativeBuildOutputDir)\Windows.AI.MachineLearning.dll')
And ('$(OrtPackageId)' == 'Microsoft.ML.OnnxRuntime.DirectML'
Or '$(OrtPackageId)' == 'Microsoft.ML.OnnxRuntime')"
PackagePath="\runtimes\win-$(TargetArchitecture)\native"
@ -101,8 +101,8 @@
CopyToOutputDirectory="Always"
Visible="false"
/>
<None Include="$(NativeBuildOutputDir)\windows.ai.machinelearning.lib"
Condition="Exists('$(NativeBuildOutputDir)\windows.ai.machinelearning.lib')
<None Include="$(NativeBuildOutputDir)\Windows.AI.MachineLearning.lib"
Condition="Exists('$(NativeBuildOutputDir)\Windows.AI.MachineLearning.lib')
And ('$(OrtPackageId)' == 'Microsoft.ML.OnnxRuntime.DirectML'
Or '$(OrtPackageId)' == 'Microsoft.ML.OnnxRuntime')"
PackagePath="\runtimes\win-$(TargetArchitecture)\native"
@ -110,8 +110,8 @@
CopyToOutputDirectory="Never"
Visible="false"
/>
<None Include="$(NativeBuildOutputDir)\windows.ai.machinelearning.pdb"
Condition="Exists('$(NativeBuildOutputDir)\windows.ai.machinelearning.pdb')
<None Include="$(NativeBuildOutputDir)\Windows.AI.MachineLearning.pdb"
Condition="Exists('$(NativeBuildOutputDir)\Windows.AI.MachineLearning.pdb')
And ('$(OrtPackageId)' == 'Microsoft.ML.OnnxRuntime.DirectML'
Or '$(OrtPackageId)' == 'Microsoft.ML.OnnxRuntime')"
PackagePath="\runtimes\win-$(TargetArchitecture)\native"
@ -119,8 +119,8 @@
CopyToOutputDirectory="Always"
Visible="false"
/>
<None Include="$(OnnxRuntimeBuildDirectory)\$(Configuration)\windows.ai.machinelearning.winmd"
Condition="Exists('$(OnnxRuntimeBuildDirectory)\$(Configuration)\windows.ai.machinelearning.winmd')
<None Include="$(OnnxRuntimeBuildDirectory)\$(Configuration)\Windows.AI.MachineLearning.winmd"
Condition="Exists('$(OnnxRuntimeBuildDirectory)\$(Configuration)\Windows.AI.MachineLearning.winmd')
And ('$(OrtPackageId)' == 'Microsoft.ML.OnnxRuntime.DirectML'
Or '$(OrtPackageId)' == 'Microsoft.ML.OnnxRuntime')"
PackagePath="\build\native\metadata"
@ -129,7 +129,7 @@
Visible="false"
/>
<None Include="$(OnnxRuntimeBuildDirectory)\$(Configuration)\Windows.AI.MachineLearning.h"
Condition="Exists('$(OnnxRuntimeBuildDirectory)\$(Configuration)\windows.ai.machinelearning.h')
Condition="Exists('$(OnnxRuntimeBuildDirectory)\$(Configuration)\Windows.AI.MachineLearning.h')
And ('$(OrtPackageId)' == 'Microsoft.ML.OnnxRuntime.DirectML'
Or '$(OrtPackageId)' == 'Microsoft.ML.OnnxRuntime')"
PackagePath="\build\native\include"
@ -138,7 +138,7 @@
Visible="false"
/>
<None Include="$(OnnxRuntimeBuildDirectory)\$(Configuration)\Windows.AI.MachineLearning.Native.h"
Condition="Exists('$(OnnxRuntimeBuildDirectory)\$(Configuration)\windows.ai.machinelearning.native.h')
Condition="Exists('$(OnnxRuntimeBuildDirectory)\$(Configuration)\Windows.AI.MachineLearning.Native.h')
And ('$(OrtPackageId)' == 'Microsoft.ML.OnnxRuntime.DirectML'
Or '$(OrtPackageId)' == 'Microsoft.ML.OnnxRuntime')"
PackagePath="\build\native\include"

View file

@ -62,7 +62,7 @@ void DmlCommandRecorder::InitializeOperator(
// Allocate and immediately free a temporary buffer. The buffer resource will still be
// alive (managed by the pool); freeing allows the resource to be shared with other operators.
void* tempResourceHandle = allocator->Alloc(temporaryResourceSize, AllocatorRoundingMode::Enabled);
void* tempResourceHandle = allocator->Alloc(static_cast<size_t>(temporaryResourceSize), AllocatorRoundingMode::Enabled);
if (!tempResourceHandle)
{
THROW_HR(E_OUTOFMEMORY);
@ -137,7 +137,7 @@ void DmlCommandRecorder::ExecuteOperator(
// Allocate and immediately free a temporary buffer. The buffer resource will still be
// alive (managed by the pool); freeing allows the resource to be shared with other operators.
void* tempResourceHandle = allocator->Alloc(temporaryResourceSize, AllocatorRoundingMode::Enabled);
void* tempResourceHandle = allocator->Alloc(static_cast<size_t>(temporaryResourceSize), AllocatorRoundingMode::Enabled);
if (!tempResourceHandle)
{
THROW_HR(E_OUTOFMEMORY);

View file

@ -455,7 +455,7 @@ namespace Dml
{
assert(!m_closed);
m_uploadHeap->BeginUploadToGpu(dstData, 0, D3D12_RESOURCE_STATE_UNORDERED_ACCESS, AsByteSpan(srcData, srcDataSize));
m_uploadHeap->BeginUploadToGpu(dstData, 0, D3D12_RESOURCE_STATE_UNORDERED_ACCESS, AsByteSpan(srcData, static_cast<size_t>(srcDataSize)));
return S_OK;
}

View file

@ -289,7 +289,7 @@ namespace Dml
if (persistentResourceSize > 0)
{
THROW_IF_FAILED(m_provider->AllocatePooledResource(
persistentResourceSize,
static_cast<size_t>(persistentResourceSize),
AllocatorRoundingMode::Disabled,
m_persistentResource.GetAddressOf(),
m_persistentResourceAllocatorUnk.GetAddressOf()));
@ -589,7 +589,7 @@ namespace Dml
// which is scheduled up to the point that this method returns has completed.
ComPtr<IUnknown> tempAlloc;
uint64_t tempAllocId = 0;
THROW_IF_FAILED(contextWrapper.AllocateTemporaryData(execBindingProps.TemporaryResourceSize, tempAlloc.GetAddressOf(), &tempAllocId));
THROW_IF_FAILED(contextWrapper.AllocateTemporaryData(static_cast<size_t>(execBindingProps.TemporaryResourceSize), tempAlloc.GetAddressOf(), &tempAllocId));
ComPtr<IUnknown> tempResourceUnk;
m_winmlProvider->GetABIDataInterface(false, tempAlloc.Get(), &tempResourceUnk);

View file

@ -80,7 +80,7 @@ namespace Dml
if (persistentResourceSize > 0)
{
THROW_IF_FAILED(m_executionProvider->AllocatePooledResource(
persistentResourceSize,
static_cast<size_t>(persistentResourceSize),
AllocatorRoundingMode::Enabled,
m_persistentResource.GetAddressOf(),
m_persistentResourcePoolingUnk.GetAddressOf()));
@ -117,7 +117,7 @@ namespace Dml
{
m_persistentResource = nullptr;
THROW_IF_FAILED(m_executionProvider->AllocatePooledResource(
persistentResourceSize,
static_cast<size_t>(persistentResourceSize),
AllocatorRoundingMode::Enabled,
m_persistentResource.GetAddressOf(),
m_persistentResourcePoolingUnk.GetAddressOf()));

View file

@ -374,7 +374,7 @@ int64_t ReadAsInt64(MLOperatorTensorDataType tensorDataType, const void* p)
)
{
const uint32_t inputDimCount = gsl::narrow_cast<int32_t>(inputDimensions.size());
m_axis = HandleNegativeAxis(operatorAttributes.GetOptionalAttribute<int32_t>(AttrName::Axis, 0), inputDimCount);
m_axis = static_cast<int>(HandleNegativeAxis(operatorAttributes.GetOptionalAttribute<int32_t>(AttrName::Axis, 0), inputDimCount));
m_split = operatorAttributes.GetOptionalAttributeVectorInt32(AttrName::Split);
}
@ -768,9 +768,9 @@ int64_t ReadAsInt64(MLOperatorTensorDataType tensorDataType, const void* p)
gsl::span<const DimensionType> inputDimensions
)
{
int32_t inputDimCount = gsl::narrow_cast<int>(inputDimensions.size());
m_axis = HandleNegativeAxis(operatorAttributes.GetOptionalAttribute<int>(AttrName::Axis, -1), inputDimCount);
ML_CHECK_VALID_ARGUMENT(m_axis < inputDimensions.size());
uint32_t inputDimCount = gsl::narrow_cast<uint32_t>(inputDimensions.size());
m_axis = static_cast<int>(HandleNegativeAxis(operatorAttributes.GetOptionalAttribute<int>(AttrName::Axis, -1), inputDimCount));
ML_CHECK_VALID_ARGUMENT(m_axis < static_cast<int>(inputDimensions.size()));
}
std::vector<EdgeShapes> ConcatHelper::GetOutputShapes(const MLShapeInferenceContext& shapeInfo) const
@ -864,7 +864,7 @@ int64_t ReadAsInt64(MLOperatorTensorDataType tensorDataType, const void* p)
int32_t inputDimCount = gsl::narrow_cast<int32_t>(inputDimensions.size());
int32_t axis = operatorAttributes.GetOptionalAttribute<int32_t>(AttrName::Axis, 1);
// Flatten can accept an axis [-r, r], including one past the last absolute index.
m_axis = (axis == inputDimCount) ? axis : HandleNegativeAxis(axis, inputDimCount);
m_axis = (axis == inputDimCount) ? axis : static_cast<int>(HandleNegativeAxis(axis, inputDimCount));
}
std::vector<EdgeShapes> FlattenHelper::GetOutputShapes(const MLShapeInferenceContext& shapeInfo) const

View file

@ -607,7 +607,7 @@ public:
{
dimIndex = axes[i];
}
ML_CHECK_VALID_ARGUMENT(dimIndex < inputDimensions.size(), "'axes' must be valid with within actual input dimensions.");
ML_CHECK_VALID_ARGUMENT(dimIndex < static_cast<int>(inputDimensions.size()), "'axes' must be valid with within actual input dimensions.");
// Positive values are offsets from 0.
// Negative values are offsets from the dimension's size.

View file

@ -396,7 +396,7 @@ int real_main(int argc, char* argv[], Ort::Env& env) {
static const ORTCHAR_T* cuda_flaky_tests[] = {
ORT_TSTR("fp16_inception_v1"),
ORT_TSTR("fp16_shufflenet"), ORT_TSTR("fp16_tiny_yolov2")};
static const ORTCHAR_T* dml_disabled_tests[] = {ORT_TSTR("mlperf_ssd_resnet34_1200"), ORT_TSTR("mlperf_ssd_mobilenet_300"), ORT_TSTR("mask_rcnn"), ORT_TSTR("faster_rcnn")};
static const ORTCHAR_T* dml_disabled_tests[] = {ORT_TSTR("mlperf_ssd_resnet34_1200"), ORT_TSTR("mlperf_ssd_mobilenet_300"), ORT_TSTR("mask_rcnn"), ORT_TSTR("faster_rcnn"), ORT_TSTR("tf_pnasnet_large"), ORT_TSTR("zfnet512")};
static const ORTCHAR_T* dnnl_disabled_tests[] = {ORT_TSTR("test_densenet121"), ORT_TSTR("test_resnet18v2"), ORT_TSTR("test_resnet34v2"), ORT_TSTR("test_resnet50v2"), ORT_TSTR("test_resnet101v2"),
ORT_TSTR("test_resnet101v2"), ORT_TSTR("test_vgg19"), ORT_TSTR("tf_inception_resnet_v2"), ORT_TSTR("tf_inception_v1"), ORT_TSTR("tf_inception_v3"), ORT_TSTR("tf_inception_v4"), ORT_TSTR("tf_mobilenet_v1_1.0_224"),
ORT_TSTR("tf_mobilenet_v2_1.0_224"), ORT_TSTR("tf_mobilenet_v2_1.4_224"), ORT_TSTR("tf_nasnet_large"), ORT_TSTR("tf_pnasnet_large"), ORT_TSTR("tf_resnet_v1_50"), ORT_TSTR("tf_resnet_v1_101"), ORT_TSTR("tf_resnet_v1_101"),

View file

@ -216,7 +216,7 @@ jobs:
timeoutInMinutes: 60
variables:
CUDA_VERSION: '10.1'
EnvSetupScript: setup_env.bat
EnvSetupScript: setup_env_cuda.bat
strategy:
matrix:
Python35:

View file

@ -165,7 +165,7 @@ jobs:
pool: 'Win-GPU-2019'
timeoutInMinutes: 120
variables:
EnvSetupScript: setup_env.bat
EnvSetupScript: setup_env_cuda.bat
buildArch: x64
msbuildArch: amd64
msbuildPlatform: x64

View file

@ -11,7 +11,7 @@ jobs:
BuildCommand: --build_dir $(Build.BinariesDirectory) --skip_submodule_sync --build_shared_lib --enable_onnx_tests --use_telemetry --cmake_generator "Visual Studio 16 2019" --use_cuda --cuda_version=10.1 --cuda_home="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1" --cudnn_home="C:\local\cudnn-10.1-windows10-x64-v7.6.5.32\cuda"
BuildArch: 'x64'
msbuildArchitecture: 'amd64'
EnvSetupScript: 'setup_env.bat'
EnvSetupScript: 'setup_env_cuda.bat'
sln_platform: 'x64'
DoDebugBuild: 'false'
DoNugetPack : 'true'
@ -26,6 +26,51 @@ jobs:
mkdir $(Build.ArtifactStagingDirectory)\testdata
copy $(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo\custom_op_library.* $(Build.ArtifactStagingDirectory)\testdata
- template: ../../templates/win-ci-2019.yml
parameters:
AgentPool : 'Win-GPU-2019'
ArtifactName: 'drop-nuget-dml'
JobName: 'Windows_CI_GPU_DML_Dev'
BuildCommand: --build_dir $(Build.BinariesDirectory) --skip_submodule_sync --build_shared_lib --enable_onnx_tests --use_telemetry --use_dml --use_winml --cmake_generator "Visual Studio 16 2019"
BuildArch: 'x64'
msbuildArchitecture: 'amd64'
EnvSetupScript: 'setup_env_cuda.bat'
sln_platform: 'x64'
DoDebugBuild: 'false'
DoNugetPack : 'true'
DoCompliance: 'false'
DoEsrp: ${{ parameters.DoEsrp }}
CudaVersion: '10.0'
OrtPackageId: 'Microsoft.ML.OnnxRuntime.DirectML'
NuPackScript: |
msbuild $(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.proj /p:Configuration=RelWithDebInfo /t:CreatePackage /p:OrtPackageId=Microsoft.ML.OnnxRuntime.DirectML
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
copy $(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo\custom_op_library.* $(Build.ArtifactStagingDirectory)\testdata
- template: ../../templates/win-ci-2019.yml
parameters:
AgentPool : 'Win-GPU-2019'
ArtifactName: 'drop-win-dml-x86-zip'
JobName: 'Windows_CI_GPU_DML_Dev_x86'
BuildCommand: --build_dir $(Build.BinariesDirectory) --x86 --skip_submodule_sync --build_shared_lib --enable_onnx_tests --use_telemetry --use_dml --use_winml --cmake_generator "Visual Studio 16 2019"
BuildArch: 'x86'
EnvSetupScript: 'setup_env_x86.bat'
sln_platform: 'Win32'
DoDebugBuild: 'false'
DoNugetPack : 'true'
DoCompliance: ${{ parameters.DoCompliance }}
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
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)
mkdir $(Build.ArtifactStagingDirectory)\testdata
copy $(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo\custom_op_library.* $(Build.ArtifactStagingDirectory)\testdata
- job: 'Linux_CI_GPU_Dev'
workspace:
clean: all
@ -68,15 +113,29 @@ jobs:
pool: 'Win-GPU-2019'
dependsOn:
- Windows_CI_GPU_CUDA_Dev
- Windows_CI_GPU_DML_Dev
- Windows_CI_GPU_DML_Dev_x86
- Linux_CI_GPU_Dev
condition: succeeded()
steps:
- task: DownloadPipelineArtifact@0
displayName: 'Download Pipeline Artifact - NuGet'
displayName: 'Download Pipeline Artifact - NuGet CUDA'
inputs:
artifactName: 'drop-nuget'
targetPath: '$(Build.BinariesDirectory)/nuget-artifact'
- task: DownloadPipelineArtifact@0
displayName: 'Download Pipeline Artifact - NuGet DirectML'
inputs:
artifactName: 'drop-nuget-dml'
targetPath: '$(Build.BinariesDirectory)/nuget-artifact-dml'
- task: DownloadPipelineArtifact@0
displayName: 'Download Pipeline Artifact - NuGet DirectML x86'
inputs:
artifactName: 'drop-win-dml-x86-zip'
targetPath: '$(Build.BinariesDirectory)/nuget-artifact-dml'
- task: DownloadPipelineArtifact@0
displayName: 'Download Pipeline Artifact - Linux'
inputs:
@ -110,6 +169,40 @@ jobs:
copy $(Build.BinariesDirectory)\nuget-artifact\*.nupkg $(Build.ArtifactStagingDirectory)
displayName: 'Bundle Native NuGet and other binaries'
- script: |
pushd $(Build.BinariesDirectory)\nuget-artifact-dml
dir
powershell -Command "Invoke-WebRequest http://stahlworks.com/dev/unzip.exe -OutFile unzip.exe"
powershell -Command "Invoke-WebRequest http://stahlworks.com/dev/zip.exe -OutFile zip.exe"
set PATH=%CD%;%PATH%
FOR /R %%i IN (*.nupkg) do (
rename %%~ni.nupkg %%~ni.zip
unzip %%~ni.zip -d %%~ni
del /Q %%~ni.zip
unzip win-dml-x86.zip -d win-x86
mkdir %%~ni\runtimes\win-x86
mkdir %%~ni\runtimes\win-x86\native
move win-x86\runtimes\win-x86\native\onnxruntime.dll %%~ni\runtimes\win-x86\native\onnxruntime.dll
move win-x86\runtimes\win-x86\native\onnxruntime.lib %%~ni\runtimes\win-x86\native\onnxruntime.lib
move win-x86\runtimes\win-x86\native\onnxruntime.pdb %%~ni\runtimes\win-x86\native\onnxruntime.pdb
move win-x86\runtimes\win-x86\native\windows.ai.machinelearning.dll %%~ni\runtimes\win-x86\native\windows.ai.machinelearning.dll
move win-x86\runtimes\win-x86\native\windows.ai.machinelearning.lib %%~ni\runtimes\win-x86\native\windows.ai.machinelearning.lib
move win-x86\runtimes\win-x86\native\windows.ai.machinelearning.pdb %%~ni\runtimes\win-x86\native\windows.ai.machinelearning.pdb
move win-x86\runtimes\win-x86\native\directml.dll %%~ni\runtimes\win-x86\native\directml.dll
pushd %%~ni
zip -r ..\%%~ni.zip .
popd
move %%~ni.zip %%~ni.nupkg
)
popd
copy $(Build.BinariesDirectory)\nuget-artifact-dml\Microsoft.ML.OnnxRuntime.DirectML*nupkg $(Build.ArtifactStagingDirectory)
displayName: 'Bundle DML NuGet and other binaries'
- template: ../../templates/esrp_nuget.yml
parameters:
DisplayName: 'ESRP - sign NuGet package'
@ -119,9 +212,17 @@ jobs:
- template: ../../templates/validate-nuget.yml
parameters:
NugetPath: '$(Build.ArtifactStagingDirectory)'
NugetPackage: 'Microsoft.ML.OnnxRuntime.Gpu*nupkg'
PlatformsSupported: 'win-x64,linux-x64'
VerifyNugetSigning: ${{ parameters.DoEsrp }}
- template: ../../templates/validate-nuget.yml
parameters:
NugetPath: '$(Build.ArtifactStagingDirectory)'
NugetPackage: 'Microsoft.ML.OnnxRuntime.DirectML*nupkg'
PlatformsSupported: 'win-x64,win-x86'
VerifyNugetSigning: ${{ parameters.DoEsrp }}
- task: PublishPipelineArtifact@0
displayName: 'Publish Pipeline NuGet Artifact'
inputs:

View file

@ -32,7 +32,7 @@ jobs:
- task: BatchScript@1
displayName: 'setup env'
inputs:
filename: '$(Build.SourcesDirectory)\tools\ci_build\github\windows\setup_env.bat'
filename: '$(Build.SourcesDirectory)\tools\ci_build\github\windows\setup_env_cuda.bat'
modifyEnvironment: true
workingFolder: '$(Build.BinariesDirectory)'

View file

@ -2,6 +2,7 @@ parameters:
NugetPath: ''
PlatformsSupported: ''
VerifyNugetSigning: ''
NugetPackage: '*'
steps:
- task: UsePythonVersion@0
@ -13,5 +14,5 @@ steps:
displayName: 'Validate Nuget'
inputs:
scriptPath: '$(Build.SourcesDirectory)\tools\nuget\validate_nuget.py'
arguments: '--nuget_path ${{parameters.NugetPath}} --platforms_supported ${{parameters.PlatformsSupported}} --verify_nuget_signing ${{parameters.VerifyNugetSigning}}'
arguments: '--nuget_package ${{parameters.NugetPackage}} --nuget_path ${{parameters.NugetPath}} --platforms_supported ${{parameters.PlatformsSupported}} --verify_nuget_signing ${{parameters.VerifyNugetSigning}}'
workingDirectory: "$(Build.BinariesDirectory)"

View file

@ -15,6 +15,7 @@ parameters:
AgentPool: 'Win-CPU-2019'
AgentDemands: []
OrtPackageId: Microsoft.ML.OnnxRuntime
RunTests : 'true'
jobs:
- job: ${{ parameters.JobName }}
timeoutInMinutes: 120
@ -133,18 +134,20 @@ jobs:
arguments: '--configuration RelWithDebInfo -p:Platform="Any CPU" -p:OnnxRuntimeBuildDirectory="$(Build.BinariesDirectory)" -p:OrtPackageId=${{ parameters.OrtPackageId }}'
workingDirectory: '$(Build.SourcesDirectory)\csharp'
- script: |
mklink /D /J $(Build.BinariesDirectory)\RelWithDebInfo\models $(Build.BinariesDirectory)\models
DIR dist\ /S /B > wheel_filename_file
set /p WHEEL_FILENAME=<wheel_filename_file
del wheel_filename_file
python.exe -m pip install -q --upgrade %WHEEL_FILENAME%
set PATH=%PATH%;$(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo
@echo %PATH%
python $(Build.SourcesDirectory)\tools\ci_build\build.py $(BuildCommand) --test --config RelWithDebInfo --enable_lto
workingDirectory: '$(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo'
displayName: 'Run tests'
- ${{ if eq(parameters.RunTests, true) }}:
- script: |
mklink /D /J $(Build.BinariesDirectory)\RelWithDebInfo\models $(Build.BinariesDirectory)\models
DIR dist\ /S /B > wheel_filename_file
set /p WHEEL_FILENAME=<wheel_filename_file
del wheel_filename_file
python.exe -m pip install -q --upgrade %WHEEL_FILENAME%
set PATH=%PATH%;$(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo
@echo %PATH%
python $(Build.SourcesDirectory)\tools\ci_build\build.py $(BuildCommand) --test --config RelWithDebInfo --enable_lto
workingDirectory: '$(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo'
displayName: 'Run tests'
- ${{ if eq(parameters.RunTests, true) }}:
- task: PublishTestResults@2
displayName: 'Publish unit test results'
inputs:
@ -180,7 +183,7 @@ jobs:
displayName: 'Create NuGet Package'
- task: PublishPipelineArtifact@0
displayName: 'Publish Pipeline Artifact: drop-nuget'
displayName: 'Publish Pipeline Artifact: ${{ parameters.ArtifactName }}'
inputs:
artifactName: ${{ parameters.ArtifactName }}
targetPath: '$(Build.ArtifactStagingDirectory)'

View file

@ -13,7 +13,7 @@ jobs:
MsbuildArguments: '-detailedsummary -maxcpucount -consoleloggerparameters:PerformanceSummary'
OnnxRuntimeBuildDirectory: '$(Build.BinariesDirectory)'
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
EnvSetupScript: setup_env.bat
EnvSetupScript: setup_env_cuda.bat
buildArch: x64
setVcvars: true
timeoutInMinutes: 120

View file

@ -13,7 +13,7 @@ jobs:
MsbuildArguments: '-detailedsummary -maxcpucount -consoleloggerparameters:PerformanceSummary'
OnnxRuntimeBuildDirectory: '$(Build.BinariesDirectory)'
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
EnvSetupScript: setup_env.bat
EnvSetupScript: setup_env_trt.bat
buildArch: x64
setVcvars: true
timeoutInMinutes: 120

View file

@ -0,0 +1,2 @@
set PATH=C:\azcopy;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin;C:\local\cudnn-10.1-windows10-x64-v7.6.5.32\cuda\bin;%PATH%
set GRADLE_OPTS=-Dorg.gradle.daemon=false

View file

@ -0,0 +1,2 @@
set PATH=C:\azcopy;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\bin;C:\local\cudnn-10.2-windows10-x64-v7.6.5.32\cuda\bin;%PATH%
set GRADLE_OPTS=-Dorg.gradle.daemon=false

View file

@ -14,7 +14,8 @@ def parse_arguments():
parser.add_argument("--target_architecture", required=True, help="Eg: x64")
parser.add_argument("--build_config", required=True, help="Eg: RelWithDebInfo")
parser.add_argument("--ort_build_path", required=True, help="ORT build directory.")
parser.add_argument("--native_build_path", required=True, help="Native build output directory..")
parser.add_argument("--native_build_path", required=True, help="Native build output directory.")
parser.add_argument("--packages_path", required=True, help="Nuget packages output directory.")
parser.add_argument("--sources_path", required=True, help="OnnxRuntime source code root.")
parser.add_argument("--commit_id", required=True, help="The last commit id included in this package.")
parser.add_argument("--is_release_build", required=False, default=None, type=str, help="Flag indicating if the build is a release build. Accepted values: true/false.")
@ -125,7 +126,8 @@ def generate_files(list, args):
# Process DirectML dll
if os.path.exists(os.path.join(args.native_build_path, 'DirectML.dll')):
files_list.append('<file src=' + '"' + os.path.join(args.native_build_path, 'DirectML.dll') + '" target="runtimes\\win-' + args.target_architecture + '\\native" />')
files_list.append('<file src=' + '"' + os.path.join(args.native_build_path, 'DirectML.pdb') + '" target="runtimes\\win-' + args.target_architecture + '\\native" />')
files_list.append('<file src=' + '"' + os.path.join(args.packages_path, 'DirectML.0.0.1\\LICENSE.txt') + '" target="DirectML_LICENSE.txt" />')
# Process onnxruntime import lib, dll, and pdb
files_list.append('<file src=' + '"' + os.path.join(args.native_build_path, 'onnxruntime.lib') + '" target="runtimes\\win-' + args.target_architecture + '\\native" />')

View file

@ -11,6 +11,7 @@ def parse_arguments():
parser = argparse.ArgumentParser(description="Validate ONNX Runtime native nuget containing native shared library artifacts spec script",
usage='')
# Main arguments
parser.add_argument("--nuget_package", required=True, help="Nuget package name to be validated.")
parser.add_argument("--nuget_path", required=True, help="Path containing the Nuget to be validated. Must only contain only one Nuget within this.")
parser.add_argument("--platforms_supported", required=True, help="Comma separated list (no space). Ex: linux-x64,win-x86,osx-x64")
parser.add_argument("--verify_nuget_signing", required=True, help="Flag inidicating if Nuget package signing is to be verified. Only accepets 'true' or 'false'")
@ -69,13 +70,12 @@ def check_if_nuget_is_signed(nuget_path):
def main():
args = parse_arguments()
files = os.listdir(args.nuget_path)
files = glob.glob(os.path.join(args.nuget_path, args.nuget_package))
nuget_packages_found_in_path = [i for i in files if i.endswith('.nupkg') and "Managed" not in i]
if (len(nuget_packages_found_in_path) != 1):
print('Nuget packages found in path: ')
print(nuget_packages_found_in_path)
raise Exception('No Nuget packages / more than one Nuget packages found in the given path.')
nuget_file_name = nuget_packages_found_in_path[0]
full_nuget_path = os.path.join(args.nuget_path, nuget_file_name)