Commit graph

34 commits

Author SHA1 Message Date
Dmitri Smirnov
bd4d011142
[C#] Rename unreleased API, add utilities (#16806)
### Description
1. rename OrtValue.FillStringTensorElement to StringTensorSetElementAt .
To the API user I think we're conceptually setting the string at an
offset in the tensor with is roughly equivalent to `List<string> list
... list[index] = "value"`.
2. While working on new inference examples, I noticed that I am still
inclined to use `DenseTensor` for N-D indexing. Added `GetStrides()` and
`GetIndex()` from strides for long dims, so the user can obtain strides
and translate N-D indices into a flat index to operate directly on the
native `OrtValue` buffers. Expose these functions to the user.
3. Make sure we generate docs for C# public static  functions.
2023-08-02 10:06:42 -07:00
Yi Zhang
3252ff2cb7
Change DML GPU pool in Windows GPU workflow use Visual Studio 2022 (#16784)
### Description
1. use the pool with VS2022
2. upgrade System.Memory to 4.5.5


### Motivation and Context
Solve the build error while using VS2022:
`[Failure] Msbuild failed when processing the file
'D:\a\_work\1\s\csharp\src\Microsoft.ML.OnnxRuntime\Microsoft.ML.OnnxRuntime.csproj'
with message: Method not found: 'System.ReadOnlySpan`1<Char>
Microsoft.IO.Path.GetFileName(System.ReadOnlySpan`1<Char>)'`

Ref:
https://stackoverflow.com/questions/73399777/azure-build-failing-due-to-method-not-found-system-readonlyspan1char-micros
2023-07-23 10:07:21 +08:00
Dmitri Smirnov
322237f482
[C#] Implement OrtValue APIs (#16206)
### Description

Expose `OrtValue` class API as first-class citizen.
Make it simular with C++ API.
Enable safe direct native memory access.
Make string tensor manipulation more efficient.
Avoid intermediate structures such as `NamedOnnxValue`,
`DisposableNamedOnnxvalue` and etc.

Provide more examples with `IOBinding`, although `OrtValue` API
potentially makes `IOBinding` redundant for most of scenarios, since
`OrtValue` can be created on top of any memory.

Run all the pre-trained models now with `OrtValue` API as well.
Obsolete `OrtExternalMemory class`. Obsolete IOBinding API that takes
`FixedBufferOnnxValue`.

### Motivation and Context
Make the API efficient and uniform with C++.

This aspires to address: 
https://github.com/microsoft/onnxruntime/issues/14918
https://github.com/microsoft/onnxruntime/issues/15381

Cc: @Craigacp
2023-06-29 08:59:23 -07:00
Cassie Breviu
e85dce8cea
Add csharp docfx (#12596)
* add docfx and gh action to build docs

* kick off build from feature branch

* Fix LGTM linting

* update az pipeline to win22 & remove nuget install

* remove azure ci changes

* fix implicit using to support 5.0

* fix more js issues

* remove resource designer changes

* remove space

* fix linting misspellings in autogenerated js temp

* fix misspellings in generated code

* delete log file
2022-08-25 09:51:32 -05:00
Scott McKay
0e85af6990
Add MAUI csharp\sample\InferenceSample\ project (#12356)
Add csharp\sample\InferenceSample\Microsoft.ML.OnnxRuntime.InferenceSample.Maui so we have an equivalent setup for MAUI as for the other platforms.

This provides a setup to do some basic local testing of using an InferenceSession in a MAUI app.
2022-07-29 07:22:36 +10:00
Scott McKay
3b1224dc08
Add .net6 support to the C# nuget package. (#11908)
* Add .net6 support to the C# nuget package.

Currently requires jumping through a lot of hoops due to .net 6 only being supported in the preview release of VS 2022.

Build existing targets using msbuild.
Add .net6 targets and build using dotnet.
Create nuget package with combined targets.

A few misc automated changes from VS to spacing and adding a couple of properties.
2022-06-22 08:08:24 +10:00
Brian Popow
3624f7c5a5
Update samples (#11420) 2022-05-06 13:32:16 -07:00
Scott McKay
a23cd5b697
Update Xamarin sample code (#9925)
* Update InferenceSample so the mobile app is more user friendly.

Remove fasterrcnn xamarin sample. Adding a more complete xamarin sample targeted at end users to the inference examples repo.

See https://github.com/microsoft/onnxruntime-inference-examples/pull/58
2021-12-07 16:18:58 +10:00
Scott McKay
eb2612b588
Remove netcoreapp2.1 target as it is EOL and out of support. Attempting to use it with VS now causes unit test run failures. (#9603) 2021-10-29 11:11:22 +10:00
Scott McKay
b5a652c578
Add Xamarin support (#9436)
Add Xamarin support to the ORT nuget packages.
  - Update C# code to support Xamarin builds for iOS and Android
  - refactor some things to split out common code
  - include iOS and Android ORT native shared library in native nuget package
2021-10-27 20:07:07 +10:00
Brian Popow
1bbe538379 Update references 2021-04-21 13:36:10 -07:00
Brian Popow
aa1ce726aa Remove unnecessary encoding step 2021-04-21 13:36:10 -07:00
Nat Kershaw (MSFT)
af9dfa7a4d
Remove docs that have been migrated to https://onnxruntime.ai/docs (#6225) 2021-02-05 18:09:27 -08:00
Ashwini Khade
0d3bbfdd0f
enable nuget packaging in local builds (#4884)
* enable building nuget packages

* add nuget creation from build.py

* add documentation

* fix flake8 errors

* fix nuget package version

* enable csharp tests

* update csharp tests

* copy nuget packges to nuget-artifacts

* add libmklml_gnu

* plus review updates

* fix references for release builds
2020-08-26 12:33:48 -07:00
Marcus Turewicz
ce65275edf
C# samples: Faster R-CNN (#4733)
* C# sample: Faster R-CNN

* Add link to new sample in samples README

* Remove duplicate image
2020-08-13 17:05:01 -07:00
Marcus Turewicz
37c45c3d6b
C# ResNet50 v2 sample/tutorial (#4722)
C# ResNet50 v2 sample
  Update samples README
2020-08-07 13:36:36 -07:00
Scott McKay
687edd702c
Add RelWithDebInfo target to the C# projects so that it correctly finds the native build. (#3839)
Make the cmake file slightly more consistent for the build c# flag.
2020-05-06 20:01:04 +10:00
Sreekanth Yalachigere
31ea11a696 Renaming MKL-DNN as DNNL (#2515)
* DNNL: Moving Files to rename file names

* DNNL name change

* azure pipeline updated

* disable ceil/dialation and enable Opset10

* disable ceil/dialation tests in Python

* mlperf_ssd_resnet34_1200 disabled
2019-12-03 07:34:23 -08:00
shahasad
6e4e764146
upgraded CSharp test and sample projects to netcoreapp2.1 (#1869) 2019-09-17 21:35:04 -07:00
shahasad
c9eb13a638
Copy System.Numerics.Tensors sources from dotnet/corefx into onnxruntime (#1605)
Copy System.Numerics.Tensors sources from dotnet/corefx into onnxruntime
2019-08-15 17:28:47 -07:00
Pranav Sharma
8d12ce45cf
Use a friendly enum for graph optimization level. (#1586)
* Mention OrtCreateSessionFromArray in C API doc

* review changes

* use enum for graph optimization level

* Use explicit values for enums

* updates...

* Add friendly enum for graph optimization levels in C, C# and Python APIs.

* Fix linux build

* Fix build breakage due to master merge

* PR comments
2019-08-14 17:12:08 -07:00
shahasad
a6a5acedda
Cleanup csharp API SessionOptions and RunOptions to be consistent with other APIs (#1570)
- Updated SessionOptions API to use properties instead of setter/getter methods. 
- Added missing APIs. 
- Added RunOptions.
2019-08-14 12:02:02 -07:00
jignparm
32da12491d
x86 support for C# API (#962)
* Refactor C# to handle x86

* update run script

* Add Native win x86 tests

* Add native x86 tests for Linux

* Update linux tests scripts to control which tests are run

* update linux image name for x86 to prevent using cached image

* update to not run unit python unit tests unless pybind is specified

* remove --build_wheel as a core common arg. Python cannot run on x86 build

* update OrtGetNumOfDimensions to OrtGetDimensionsCount in rest of C#
2019-05-20 15:48:14 -07:00
jignparm
4e3391ef60
Refactor NuGet to allow arbitrary PackageId names (e.g. Microsoft.ML.OnnxRuntime.MKLML) (#797)
* Refactor NuGet to allow arbitrary namespaces

* Move csharp build to end of cmake
2019-04-09 22:48:00 -07:00
Ashwini Khade
2dbce4ebcf
csharp api for graph transformers (#741)
* add graph optimization level to csharp api

* format documentation

* changes per review comments
2019-04-02 17:23:14 -07:00
jignparm
73fc91dc59 Fix preFast native rules warnings (#682)
* Address preFast native rules warnings
2019-03-29 00:26:33 -07:00
shahasad
5ef4c90f1d Make the return namedonnxvalue objects disposable in C# API (#392)
* added the disposablenamedonnxvalue as result container

* C-API related fixes and tensorproto fix

* addressed some of the review comments
2019-01-28 21:40:19 -08:00
Edward Chen
677918cd9a Added generation of C# project properties file containing actual build directory. 2019-01-14 16:02:13 -08:00
Shah Asaduzzaman (ASAD)
e477e7563b typo in last commit 2018-11-26 00:18:14 -08:00
Shah Asaduzzaman (ASAD)
4f0ec77f6e Merge branch 'dev/shahasad/enable-dll-and-csharp-in-windows-ci-build' into dev/shahasad/merge-latest-few-changes-on-csharp-api 2018-11-26 00:14:58 -08:00
Shah Asaduzzaman (ASAD)
33537055cb make mkldnn.dll optional 2018-11-26 00:13:32 -08:00
Shah Asaduzzaman (ASAD)
f454826b93 updated the files with the latest ones from Lotus VSTS repo 2018-11-25 22:46:21 -08:00
Pranav Sharma
7aef8a1cca Sync with internal master. 2018-11-22 20:56:43 -08:00
Pranav Sharma
89618e8f1e Initial bootstrap commit. 2018-11-19 16:48:22 -08:00