Commit graph

362 commits

Author SHA1 Message Date
Scott McKay
c20cbf0c97
Add undocumented attribute to disable generation of Java bindings from the Android AAR. (#12075)
The generated bindings causes C# build errors that require workaround code. Disabling generation should avoid the need for any workarounds.

As the user has the C# ORT package with the C# to C bindings there's no need for binding generation that calls the ORT Java API (which is C# -> Java ->C).
2022-07-05 10:29:32 -07:00
Gary Miguel
043816f895
Make C# runtest.sh automatically set latest opset (#12039)
* Update C# runtest.sh for opset 17

Should have been part of https://github.com/microsoft/onnxruntime/pull/11924

* get appropriate opset version from onnx doc

* use absolute rather than relative path

* fix typo in var name
2022-07-01 10:12:33 -07:00
Scott McKay
bfe1eca10c
Add targets files for new .net6 frameworks (#12016)
* Add net6 targets.
Remove maccatalyst as we don't have a native build targetting that.

* Set platform in macos targets

* Add targetFramework entries

* Move NativeLib.DllName definition and set using preprocessor values for simplicity. Couldn't get it to build with the preprocessor based setup when it was in a separate file.

Update the nuspec generation to set platform version for .net6 targets. TODO: Validate versions. I copied them from the managed nuget package the packaging pipeline generated prior to adding targets. Possibly w could/should lower some of the versions.

Hopefully the need to specify a version goes away when the release version of VS2022 supports .net6.

* Try android 31.1 as https://github.com/actions/virtual-environments/blob/main/images/win/Windows2022-Readme.md suggests that should be available on the CI machines

* Fix patch version mismatch
Add some extra debug info in case it helps

* Debug nuget location in CI

* Add workspace entry back in

* Add steps

* One more attempt with hardcoded nuget.exe path and original android31.0 version

* Better fix - found explicit nuget download and updated version there.

* flake8 fixes

* Fix black complaints.

* Exit Microsoft_ML_OnnxRuntime_CheckPrerequisites for net6 iOS.

* Removed outdated comment
2022-07-01 09:13:55 -07:00
Wei-Sheng Chin
0ee0b8cf18
Disable sequence-type tests since C# infra doesn't support well (#12037) 2022-06-30 09:49:03 -07:00
Edward Chen
466b2d9f3d
[C# Tests] Add support for double tensor output in TestPreTrainedModels. (#12008)
Add support for double tensor output in TestPreTrainedModels.
2022-06-27 18:49:19 -07:00
Gary Miguel
4bf22e2a40
Update ONNX to 1.12 (#11924)
Follow-ups that need to happen after this and before the next ORT release:
* Support SequenceMap with https://github.com/microsoft/onnxruntime/pull/11731
* Support signal ops with https://github.com/microsoft/onnxruntime/pull/11778

Follow-ups that need to happen after this but don't necessarily need to happen before the release:
* Implement LayerNormalization kernel for opset version 17: https://github.com/microsoft/onnxruntime/issues/11916

Fixes #11640
2022-06-21 17:19:52 -07: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
Scott McKay
d64f23fec0
EP factory creation cleanup and enhancements. (#11798)
* Rework the EP factory creation setup so we're not cut-and-pasting function declarations in multiple places.
Convert append EP for SNPE to be generic, and also use for XNNPACK.
Add XNNPACK to C# API

* Don't need stub for MIGraphX as it's using provider bridge.

* Remove old 'create' functions that aren't applicable now that the EPs are built as separate libraries.

* Only use EPs that require the layout transform if the opset is supported by the layout transformer.

* Update wasm registration of xnnpack.
2022-06-16 07:01:41 +10:00
Hector Li
95a16c1ffe
Snpe ep (#11665)
* Initiate Ort SNPE EP
* fix snpe ep windows build which is caused by the utility method (ToUTF8String) name change on master
* correct the source path for libonnxruntime.so while building for andorid package
* add AdditionalDependencies for amr64
* On MS-Windows, the patchfile must be a text file, i.e. CR-LF must be used as line endings. A file with LF may give the error: "Assertion failed, hunk, file patch.c, line 343," unless the option '--binary' is given.
* fix build failure if snpe is not enabled
* update doc for contrib op
* separate out snpe ep settings to onnxruntime_snpe_provider.cmake
* renaming according review comments
* update according review comments
2022-06-03 14:10:02 -07:00
Brian Popow
3624f7c5a5
Update samples (#11420) 2022-05-06 13:32:16 -07:00
Justin Chu
fdce4fa6af
Format all python files under onnxruntime with black and isort (#11324)
Description: Format all python files under onnxruntime with black and isort.

After checking in, we can use .git-blame-ignore-revs to ignore the formatting PR in git blame.

#11315, #11316
2022-04-26 09:35:16 -07:00
Scott McKay
c5de493a8a
Exclude EPs that aren't available on mobile to try and fix Xamarin build error on M1. (#11267) 2022-04-21 07:01:46 +10:00
Vincent Wang
3b6cee8059
[CUDA] Optimize Conv and ConvGrad for Training (#10999)
* Optimize Conv and ConvGrad for Training

* add provider option to control

* fix typo
2022-03-29 07:31:36 +08:00
Chun-Wei Chen
bac9c0eb50
skip optional related models from opset16 (#10840) (#10878) 2022-03-16 08:49:42 -07:00
Changming Sun
de6d1fcb41 Update C# runtest.sh 2022-03-15 14:18:34 -07:00
Yi Zhang
f1b6f0becd
Update nuget icon (#10672)
Update nuget icon from url to local file because the old tag is deprecated.
2022-03-01 09:11:03 -08:00
Scott McKay
f2ca43fe0d
Enable CoreML in the macos package (#10675)
* packaging pipeline change

* Enable CoreML on macos

Co-authored-by: Guoyu Wang <wanggy@outlook.com>
2022-02-28 09:12:37 +10:00
Changming Sun
81831201a8
Change C# tests to use C# 5.0 (#10686)
.NET Core 2.1 has reached end of support on August 21, 2021. Use C# 5.0 instead. Our CI build machines do no have C# 6.0 yet. Later I will do it.
2022-02-26 00:28:30 -08:00
Lingfeng Wu
3be3db5180
Use IntPtr instead of int conversion for pointer in Memory.Pin() (#10485)
* Use IntPtr instead of int conversion for pointer in Memory.Pin()
Co-authored-by: Lingfeng Wu <lingfw@microsoft.com>
2022-02-16 14:49:56 -08:00
Valery Chernov
1cdc23aba4
[TVM EP] Rename Standalone TVM (STVM) Execution Provider to TVM EP (#10260)
* update java API for STVM EP. Issue is from PR#10019

* use_stvm -> use_tvm

* rename stvm worktree

* STVMAllocator -> TVMAllocator

* StvmExecutionProviderInfo -> TvmExecutionProviderInfo

* stvm -> tvm for cpu_targets. resolve onnxruntime::tvm and origin tvm namespaces conflict

* STVMRunner -> TVMRunner

* StvmExecutionProvider -> TvmExecutionProvider

* tvm::env_vars

* StvmProviderFactory -> TvmProviderFactory

* rename factory funcs

* StvmCPUDataTransfer -> TvmCPUDataTransfer

* small clean

* STVMFuncState -> TVMFuncState

* USE_TVM -> NUPHAR_USE_TVM

* USE_STVM -> USE_TVM

* python API: providers.stvm -> providers.tvm. clean TVM_EP.md

* clean build scripts #1

* clean build scripts, java frontend and others #2

* once more clean #3

* fix build of nuphar tvm test

* final transfer stvm namespace to onnxruntime::tvm

* rename stvm->tvm

* NUPHAR_USE_TVM -> USE_NUPHAR_TVM

* small fixes for correct CI tests

* clean after rebase. Last renaming stvm to tvm, separate TVM and Nuphar in cmake and build files

* update CUDA support for TVM EP

* roll back CudaNN home check

* ERROR for not positive input shape dimension instead of WARNING

* update documentation for CUDA

* small corrections after review

* update GPU description

* update GPU description

* misprints were fixed

* cleaned up error msgs

Co-authored-by: Valery Chernov <valery.chernov@deelvin.com>
Co-authored-by: KJlaccHoeUM9l <wotpricol@mail.ru>
Co-authored-by: Thierry Moreau <tmoreau@octoml.ai>
2022-02-15 10:21:02 +01:00
Scott McKay
318d31ea12
Fix C# pipeline build error (#10524) 2022-02-11 08:56:40 -08:00
Dmitri Smirnov
91b8ad5ee7
Allow users to bind arbitrary memory using raw pointers (#10428)
Add binding external allocation
  Add negative tests
  Add missing return status check
2022-02-01 18:09:24 -08:00
Scott McKay
c1c9fa18bf
C#: Avoid inefficient DenseTensor ctor in ToTensor extensions (#10240)
* Update extension helpers to avoid inefficient construction of DenseTensor.
Add tests for extension helpers.
2022-01-19 07:43:44 +10:00
CarlPoirier
4af232df0c
Fix props file overwriting AdditionalIncludeDirectories (#10124)
Co-authored-by: Carl Poirier <carl.poirier@vab-solutions.com>
2022-01-11 23:30:40 -08:00
Hariharan Seshadri
0552a47ec2
Enable CUDA provider option configuration for C# (#10188) 2022-01-06 11:03:14 -08:00
Ye Wang
2803a9465d
Add example of registering custom cuda op as shared lib (#10025) 2022-01-05 09:22:15 -08:00
Sheil Kumar
ce1a9ca618
Fix Microsoft.AI.MachineLearning NuGet App failure with multiple binaries copied to same destination (#10076)
* Include onnxruntime binary when not using pacakge referene or uap app.

* Remove the lib\uap10.0 build from the nuget package - causing conflicts

* Add UWP test

* remove build files

* remove local change

* reset mimalloc and onnx-tensorrt

* change username to Microsoft

Co-authored-by: Sheil Kumar <sheilk@microsoft.com>
2021-12-21 12:34:03 -08:00
Valery Chernov
b327e89efa
Standalone TVM Executor Provider (#10019)
* squashed commit for standalone tvm execution provider

* critical fix for correct python build with stvm ep

* get tuning log file from ep options. It has priority over AUTOTVM_TUNING_LOG

* updates and fixes

* update parsing of stvm provider options

* add support of external data for onnx model

* add conditional dump of subgraphs

* remove unused code

* get input tensor shapes through provider options. get output shapes for fixed input ones by TVM API

* support AUTO_TVM tuning log file inside ORT. Selector for Ansor and Auto_TVM is provider option (tuning_type)

* add fp16

* add functionality of conversion of model layout to NHWC if need. Necessary parameter was added to STVM provider options

* fix license text in header. fix log format

* small fixes

* fix issues from flake8

* remove model proto construction from GetCapability

* reserve memory for vector of DLTensors

* add simple tutorial for STVM EP

* STVM docs

* jroesch/tvm -> apache/tvm

* remove dead code, unneccessary logs and comments

* fix in readme

* improve tutorial notebook

* tvm update

* update STVM_EP.md

* fix default value

* update STVM_EP.md

* some TODOs for the future development

* shorten long lines

* add hyperlink to STVM_EP.md

* fix Linux CI error

* fix error in csharp test

Co-authored-by: Jared Roesch <jroesch@octoml.ai>
Co-authored-by: Valery Chernov <valery.chernov@deelvin.com>
Co-authored-by: KJlaccHoeUM9l <wotpricol@mail.ru>
2021-12-15 16:59:20 -08: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
3f5c1e1c58
Update to include the Xamarin targets for internal ORT builds so the managed nuget package is consistent as both CPU and GPU builds produce a package called Microsoft.ML.OnnxRuntime.Managed. (#9906) 2021-12-02 18:43:34 +10:00
Scott McKay
fb4a8e12fc
Limit inclusion of Xamarin mobile target frameworks. (#9834)
- Only set them as targets for the ORT nuget package
    - Use OrtPackageId as the condition for inclusion, if installed
      - need to do the nuget restore via msbuild so that this property is set correctly
  - Add desktop-only version of the C# sln as there is no way to exclude the mobile specific csproj's from an sln
    - use this when applicable if someone is running build.py with the `--build_nuget` flag

Other
  - remove attempt to include symbols in the nuget package as nuget doesn't support symbols in native packages
  - update build.py to use `nuget` and not a windows specific path and filename for a linux build with `--build_nuget`
2021-11-23 11:29:53 +10:00
Dmitri Smirnov
567749b2dc
Expose IOBinding SynchronizeInputs/Outputs via C/C++/C# And Python APIs (#9823)
Add C/C++ APIs for SynchronizeBoundInputs/Outputs
 Add python bindings
 Expose SynchronizeBoundInputs/Outputs to C# API
2021-11-22 09:45:31 -08:00
Sheil Kumar
71a1a7b471
Enable building winml with --build_nuget (#9632)
* Enable building winml with --build_nuget

* Fix flake8 errors

* semicolor

Co-authored-by: Sheil Kumar <sheilk@microsoft.com>
2021-11-04 00:42:51 -07: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
a2b3e6bb23
Remove pointless assert. (#9571) 2021-10-28 07:33:40 +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
Jeff Daily
c8789d3047
[ROCm] static re-hipify of CUDA EP to ROCm EP, now a shared provider (#8877)
* re-hipify all rocm EP sources

* fix all other files affected by re-hipify

* add cuda_provider_factory.h to amd_hipify.py

* do not use cudnn_conv_algo_search in ROCm EP, missing reduce min registration

* Fix ReduceConsts template specialization introduced in #9101.

Fixes the error when building for ROCm 4.3.1:

error: too many template headers for onnxruntime::rocm::ReduceConsts<__half>::One (should be 0)

* fix flake8 error in amd_hipify.py

* speed up hipify with concurrent.futures

* flake8 fix in amd_hipify.py
2021-10-14 15:15:51 -07:00
Scott McKay
4a1b386f7c
#9182 removed the --is_store_build option but one place where that was used was missed. (#9219)
This should fix the relevant packaging pipelines.
2021-09-29 09:28:31 -07:00
Sheil Kumar
f16bb37fae
make uwp store apps link to statically-linked crt desktop builds (#9182)
Co-authored-by: Sheil Kumar <sheilk@microsoft.com>
2021-09-27 15:37:15 -07:00
Changming Sun
b175f98dcc
Do not generate nuget symbol packages on Linux (#9131) 2021-09-21 02:45:20 -07:00
Scott McKay
eebcc20f10
Add netstandard2.0 framework to nuget managed package. (#8960)
* Add netstandard2.0 to nuget managed package.
Re-does PR that was backed out due to packaging pipeline changes.
Allows deprecation of netstandard1.1 in the following release as netstandard2 is the preferred lowest level framework.
2021-09-04 08:01:46 +10:00
Changming Sun
6299a60bf8
Nuget: splitting PDB files to a separated package (#8903) 2021-09-01 09:07:24 -07:00
Scott McKay
0034ad72e6
Minimize changes to fix missing symbols used from C# (#8867)
* Revert "Cleanup C# bindings to add EP (#8810)"

This reverts commit b21ea00020.

* Add back in a minimal set of changes.
Provide stubs in for a limited set of things
  - things called from C# using a static lib of ORT built for mac/ios
  - things in OrtApis that are not included in the build by default
  - things in OrtApis that are excluded in a minimal build

* Cleanup order or EPs in test

* Fix unused function in ROCM build
2021-08-28 07:10:14 +10:00
Scott McKay
b21ea00020
Cleanup C# bindings to add EP (#8810)
Fix C# add EP bindings.
Add stubs to ORT so that if EP is not included in the build we return a graceful error message.
Move declaration of stubs into C API and out for EP so they're in one place and are easier to use (no extra header required in the C/C++ world and consistent with the CUDA EP setup).
Fix inconsistency in ROCM EP.
Cleanup a few other things.
2021-08-26 13:59:40 +10:00
Chandru Ramakrishnan
f51f2bad66
Fix for doxygen doc errors. (#8814) 2021-08-23 15:52:15 -04:00
Chi Lo
51152e1aaa
Integrate TensorRT EP libs into existing GPU Nuget Package (Approach#1) (#8727)
* Merge CPU/GPU nuget pipeline

* Include TensorRT EP libraries into existing GPU nuget package pipeline

* modify to use correct YAML

* Modify for test

* modify for test

* Add depedance

* Add depedance (cont.)

* modify for test

* Add create TensorRT nuget package

* modify for test

* modify for test

* Merge CPU/GPU nuget pipeline

* Include TensorRT EP libraries into existing GPU nuget package pipeline

* modify to use correct YAML

* Modify for test

* modify for test

* Add depedance

* Add depedance (cont.)

* modify for test

* Add create TensorRT nuget package

* modify for test

* fix merge bug

* code refactor

* code refactor

* modify for test

* modify for test

* modify for test

* modify for test

* modify for test

* modify for test

* cleanup

* modify for test

* fix bug

* modify for test

* refactor

* fix bug and test

* Modify for test

* Modify for test

* Modify for test

* Modify for test

* Prepare for PR

* Prepare for PR

* code refacotr from review

* Remove naming 'Microsoft.ML.OnnxRuntime.TensorRT' to avoid confusion

* Add linux TensorRT libraries

* Remove redundant variable in YMAL

* revert file

* undo revert file

* Modify regular expression so that it can capture the correct file

* Remove newline at end of file

* small fix

* Revert to CUDA11.1 on Windows

* Add unit tests for nuget package on Linux

Co-authored-by: Changming Sun <chasun@microsoft.com>
2021-08-18 17:26:34 -07:00
Changming Sun
5f74f198c1
Merge CPU/GPU nuget pipeline (#8683)
Merge CPU/GPU nuget pipeline. The old GPU nuget pipeline will be only for DML.

TODO: the result GPU package contains PDB files for some of the DLLs, but not all. It is due to the refactoring of CUDA EP to pluggable DLLs. At that time we forgot to copy the PDB files. However, I can't add them in now. Because currently the package is already 220MB large. If the missed PDB files were added, then it will be oversize. nuget.org doesn't accept >250MB packages.
2021-08-12 13:21:29 -07:00
Edward Chen
baf8c39a8d
Add Python checks pipeline (#7032)
This change adds a new pipeline for checking Python code. Currently this pipeline only runs flake8.
flake8 is also run as part of the CMake project builds, but we can switch over completely to the new pipeline later.
The .flake8 config file was also updated to make it easier to run standalone (flake8 --config ./.flake8) and some Python formatting issues were addressed in files that were not previously scanned.
2021-08-09 10:37:05 -07:00
Dmitri Smirnov
aaeb781132
Revert "Add netstandard2.0 target to OnnxRuntime.Managed (#8600)" (#8648)
This reverts commit e673d2e050.
2021-08-09 10:08:07 -07:00
Ashwini Khade
96eb9810ba
Update onnx (#8458)
* updates for picking pnnx commit

* add tests filter to c# tests

* plus test fixes

* fix versioning for contrib ops

* fix tests

* test filter for optional ops

* more versioning related updates

* fix test

* fix layernorm spec

* more updates

* update docs

* add more test filters

* more filters

* update binary size threshold

* update docs

* plus more fixes

* updates per review

* update to release commit

* add filters for optional type tests

* plus updates
2021-08-05 09:21:44 -07:00