onnxruntime/csharp
Rui Ren 1a48099eea
ORT 1.14.0 release -- cherry pick round1 (#14456)
### Description
<!-- Describe your changes. -->
First round cherry pick, total `19` PRs, as below. Please check here for
[Here](https://github.com/microsoft/onnxruntime/issues?q=label%3Arelease%3A1.14+sort%3Aupdated-asc)
for the total list.
<head>

<meta name=ProgId content=Excel.Sheet>
<meta name=Generator content="Microsoft Excel 15">
<link id=Main-File rel=Main-File

href="file:///C:/Users/ruiren/AppData/Local/Temp/msohtmlclip1/01/clip.htm">
<link rel=File-List

href="file:///C:/Users/ruiren/AppData/Local/Temp/msohtmlclip1/01/clip_filelist.xml">
<style>
<!--table
	{mso-displayed-decimal-separator:"\.";
	mso-displayed-thousand-separator:"\,";}
@page
	{margin:.75in .7in .75in .7in;
	mso-header-margin:.3in;
	mso-footer-margin:.3in;}
tr
	{mso-height-source:auto;}
col
	{mso-width-source:auto;}
br
	{mso-data-placement:same-cell;}
td
	{padding-top:1px;
	padding-right:1px;
	padding-left:1px;
	mso-ignore:padding;
	color:black;
	font-size:11.0pt;
	font-weight:400;
	font-style:normal;
	text-decoration:none;
	font-family:Calibri, sans-serif;
	mso-font-charset:0;
	mso-number-format:General;
	text-align:general;
	vertical-align:bottom;
	border:none;
	mso-background-source:auto;
	mso-pattern:auto;
	mso-protection:locked visible;
	white-space:nowrap;
	mso-rotate:0;}
.xl65
	{text-align:center;}
.xl66
	{color:windowtext;
	text-align:center;
	border:.5pt solid windowtext;
	background:#E2EFDA;
	mso-pattern:black none;}
.xl67
	{color:windowtext;
	text-align:center;
	border:.5pt solid windowtext;}
.xl68
	{color:windowtext;
	text-align:center;
	border:.5pt solid windowtext;
	background:white;
	mso-pattern:black none;}
-->
</style>
</head>

<body link="#0563C1" vlink="#954F72">



Date | PR | # | Commit # | Short #
-- | -- | -- | -- | --
0 | fix headers for training apis | 14350 |
ea7bbd667d | ea7bbd6
1 | Fix post merge jobs pipeline build issues | 14346 |
ae0e090c7b | ae0e090
2 | support ScatterND(18) and ScatterElement(18) | 14224 |
5d6a049141 | 5d6a049
3 | Exclude a multi-stream case from reduced ops build | 14351 |
36ba3d8d21 | 36ba3d8
4 | Support muP in Attention | 14348 |
668586e8f8 | 668586e
5 | Add memory efficient attention from CUTLASS | 14343 |
414b012f42 | 414b012
6 | Add PyTorch 2.0 to ORT transformer benchmarking | 14300 |
72821a6113 | 72821a6
7 | Misc transformer fixes - 3 | 14320 |
2d8ee5251c | 2d8ee52
8 | Update quantization_defs.cc | 14380 |
de7a868d5f | de7a868
9 | Revert "Allow PostAnalysis@2 task to continue on error for
Windows_Pa… | 14375 | cf3661ff6d | cf3661f
10 | Fix fuzz test | 14385 | f03c507cf0 |
f03c507
11 | support Pad(18) | 14219 | 05915d8393
| 05915d8
12 | Ort openvino 4.3 cli | 14341 |
77b455b969 | 77b455b
13 | cpu to support bitwise ops | 14197 |
7b6d880b28 | 7b6d880
14 | Update ORT format v5 change docs to cover limited backwards
compatibility in 1.14. | 14413 |
3bc092b1ea | 3bc092b
15 | Upgrade CUTLASS to v2.11 and add sequence length threshold for
cutlass FMHA | 14401 | 94b1791974 |
94b1791
16 | Add Col2Im CPU op | 12311 |
32c05fcdd1 | 32c05fc
17 | [DML EP] Upgrade DML to 1.10.1 | 14433 |
edb377f2cb | edb377f
18 | cpu support of LpPool(18) | 14205 |
2b1a59f01a | 2b1a59f



</body>

</html>


### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->
First round cherry-pick for ORT 1.14.0 release.

---------

Signed-off-by: Liqun Fu <liqfu@microsoft.com>
Co-authored-by: Ashwini Khade <askhade@microsoft.com>
Co-authored-by: Edward Chen <18449977+edgchen1@users.noreply.github.com>
Co-authored-by: liqun Fu <liqfu@microsoft.com>
Co-authored-by: RandySheriffH <48490400+RandySheriffH@users.noreply.github.com>
Co-authored-by: Randy Shuai <rashuai@microsoft.com>
Co-authored-by: Ye Wang <52801275+wangyems@users.noreply.github.com>
Co-authored-by: Ubuntu <wy@v100-2.0cdb2e52twzevn1i4fi45bylyg.jx.internal.cloudapp.net>
Co-authored-by: Tianlei Wu <tlwu@microsoft.com>
Co-authored-by: kunal-vaishnavi <115581922+kunal-vaishnavi@users.noreply.github.com>
Co-authored-by: Hariharan Seshadri <shariharan91@gmail.com>
Co-authored-by: Yi Zhang <zhanyi@microsoft.com>
Co-authored-by: Hector Li <hecli@microsoft.com>
Co-authored-by: sfatimar <sahar.fatima@intel.com>
Co-authored-by: Preetha <preetha.veeramalai@intel.com>
Co-authored-by: Thiago Crepaldi <thiago.crepaldi@microsoft.com>
Co-authored-by: Sumit Agarwal <sumitagarwal330@gmail.com>
2023-01-31 14:35:34 -08:00
..
ApiDocs Lint updates csharp docs (#12962) 2022-09-14 17:56:41 -05:00
sample Add csharp docfx (#12596) 2022-08-25 09:51:32 -05:00
src Create dedicated build for training api (#14136) 2023-01-10 20:58:04 -08:00
test ORT 1.14.0 release -- cherry pick round1 (#14456) 2023-01-31 14:35:34 -08:00
testdata Format all python files under onnxruntime with black and isort (#11324) 2022-04-26 09:35:16 -07:00
tools/Microsoft.ML.OnnxRuntime.PerfTool Patch Protobuf and ONNX's cmake files and enforce BinSkim check (#13694) 2022-11-18 10:09:47 -08:00
.clang-format Add Xamarin support (#9436) 2021-10-27 20:07:07 +10:00
Directory.Build.props.in Patch Protobuf and ONNX's cmake files and enforce BinSkim check (#13694) 2022-11-18 10:09:47 -08:00
Nuget.CSharp.config
OnnxRuntime.CSharp.proj Enable nuget packages for on device training (#13637) 2022-12-05 14:54:09 -08:00
OnnxRuntime.CSharp.sln Add csharp docfx (#12596) 2022-08-25 09:51:32 -05:00
OnnxRuntime.DesktopOnly.CSharp.sln Limit inclusion of Xamarin mobile target frameworks. (#9834) 2021-11-23 11:29:53 +10:00
OnnxRuntime.snk
readme.md Add .net6 support to the C# nuget package. (#11908) 2022-06-22 08:08:24 +10:00
readme.txt Limit inclusion of Xamarin mobile target frameworks. (#9834) 2021-11-23 11:29:53 +10:00

ORT C# Managed Library

The solution files here are used to produce nuget packages for the C# bindings.

Note that the project naming is currently confusing and needs updating.

  • The Microsoft.ML.OnnxRuntime project produces the Microsoft.ML.OnnxRuntime.Managed nuget package.
  • The Microsoft.ML.OnnxRuntime nuget package contains the native (i.e. C++) code for various platforms.

Solution files

The main solution file is OnnxRuntime.CSharp.sln. This includes desktop and Xamarin mobile projects. OnnxRuntime.DesktopOnly.CSharp.sln is a copy of that with all the mobile projects removed. This is due to there being no way to selectively exclude a csproj from the sln if Xamarin isn't available.

If changes are required, either update the main solution first and copy the relevant changes across, or copy the entire file and remove the mobile projects (anything with iOS, Android or Droid in the name).

Development setup:

Requirements:

NOTE: The usage of this solution is primarily for ORT developers creating the managed Microsoft.ML.OnnxRuntime.Managed nuget package. Due to that, the requirements are quite specific.

Visual Studio 2022 v17.2.4 or later, with Xamarin workloads

There's no good way to use Visual Studio 2022 17.3 Preview in a CI, so we currently have to build pre-.net6 targets using VS, and .net6 targets using dotnet. We can't build them all using dotnet as the xamarin targets require msbuild. We can't package them using dotnet as that also requires msbuild.

Once the official VS 2022 release supports .net6 and is available in the CI we can revert to the original simple setup of building everything using msbuild.

To test packaging locally you will also need nuget.exe. Download from https://www.nuget.org/downloads. Put in a folder (e.g. C:\Program Files (x86)\NuGet). Add that folder to your PATH.

Magic incantations to build the nuget managed package locally:

If we're starting with VS 2022 17.2.4 we should have dotnet sdk 6.0.301

Make sure all the required workloads are installed dotnet workload install android ios maccatalyst macos - original example from here: - dotnet workload install android ios maccatalyst macos maui --source https://aka.ms/dotnet6/nuget/index.json --source https://api.nuget.org/v3/index.json - don't need 'maui' in this list until we update the sample/test apps - didn't seem to need --source arg/s for local build. YMMV.

Build pre-net6 targets msbuild -t:restore .\src\Microsoft.ML.OnnxRuntime\Microsoft.ML.OnnxRuntime.csproj -p:SelectedTargets=PreNet6 msbuild -t:build .\src\Microsoft.ML.OnnxRuntime\Microsoft.ML.OnnxRuntime.csproj -p:SelectedTargets=PreNet6

Need to run msbuild twice - once to restore which creates some json configs that are needed like Microsoft.ML.OnnxRuntime\obj\project.assets.json, and once to build using the configs.

Build net6 targets dotnet build .\src\Microsoft.ML.OnnxRuntime\Microsoft.ML.OnnxRuntime.csproj -p:SelectedTargets=Net6

The dotnet build does the restore internally.

Create project.assets.json in obj dir with all targets so the nuget package creation includes them all msbuild -t:restore .\src\Microsoft.ML.OnnxRuntime\Microsoft.ML.OnnxRuntime.csproj -p:SelectedTargets=All

Create nuget package msbuild .\OnnxRuntime.CSharp.proj -t:CreatePackage -p:OrtPackageId=Microsoft.ML.OnnxRuntime -p:Configuration=Debug -p:Platform="Any CPU"