Commit graph

52 commits

Author SHA1 Message Date
shahasad
f9bae489bd
cleanup extra header from c api and sanitize C api test (#517)
* cleaned up the additional header in C-api

* ensure test failure surfaces in the build pipeline

* sanitized runtest.bat

* cleanup unneeded headers

* formatting and typos
2019-02-24 21:06:54 -08:00
Scott McKay
5171e8b129
Make IExecutionProvider::Type return const std::string& instead of a new string. (#506)
Store the type string in IExecutionProvider so that Type() doesn't need to be a virtual.
2019-02-22 18:27:01 +10:00
Changming Sun
b69c834c06 Optimize graph partition 2019-02-20 16:32:04 -08:00
Changming Sun
b02c1d80d4 Fix an SAL annotation in the C API 2019-02-20 12:51:00 -08:00
Scott McKay
fc7185f060
Various optimizations to reduce the setup and device copying cost outside of the call to ExecuteGraph. (#470)
* Various optimizations to reduce the setup and execution cost.

Cache information about the feeds and fetches, and any device copies required to execute the graph so we minimize checking for later calls to ExecuteGraph using the same input/output.
  - enable use of caching in Loop and Scan
  - make use of caching optional for InferenceSession::Run
    - handle calls to Run with different feeds and fetches to support scenarios where there may be a truncated sequence in some calls

Take the feed names and MLValue instances as vectors so the order is deterministic.

Add unit tests

Update onnxruntime_perf_test to enable caching.

* Couple of tweaks.
Fix shared library unit test failure.
Attempt to workaround MacOS build failure due to VC++ bug around including reaching scope values in a lambda automatically.

* Rework order of init in Run so we get nice error messages about invalid feed/output names.

* Refine logic around copying MLValue using execution provider so common code can be used. Simplify the logic due to this change.
Split the paths for executing with/without cached info so we can be more const correct with how FeedsFetchesManager is passed in. This makes it clearer when a shared instance can be used due to it being const.
Cache the FeedsFetchesManager instances in the control flow nodes. They can be re-used across calls to Compute.

* Removed unused local variable to fix some builds.

* Fix build issue by cleaning up some more unused params.

* Check names when using cache entry from SessionState. Add unit test.
2019-02-20 12:12:17 +10:00
Pranav Sharma
9bc6503463
Support non-tensor types in the C API. (#489)
* support non-tensor types

* support non-tensor types.

* support non-tensor types.

* fix compilation issues

* fix compilation issues

* fix compilation issues

* add test cases

* test cases

* add test cases

* try to fix string test case

* working now

* use allocator (broken)

* string test broken after using allocator

* full working example

* Fix PR comments
2019-02-19 14:11:46 -08:00
Changming Sun
d05b74b1b7 Delete Tensor::ShallowCopy 2019-02-12 15:51:36 -08:00
Ke Zhang
fc90a9b2fc
allocator refactor (#467)
* update CPUAllocator.

* onnxruntime

* fix build break

* remove useless subclasses of CPUAllocator.

* refactor to get allocator from executionproviders instead of execution provider.
2019-02-12 14:14:21 -08:00
Hariharan Seshadri
fdd71574d6
misc: Fix comment in op_node_proto_helper (#460)
* Fix comment in op_node_proto_helper

* PR feedback
2019-02-11 14:38:43 -08:00
Changming Sun
4cdb0cbf6e A tiny fix in KernelCreateInfo 2019-02-06 17:59:20 -08:00
Changming Sun
7c70d9349a Fix a bug in execution_provider.cc 2019-02-06 17:08:38 -08:00
Weixing Zhang
851e291f22
Make OpKernelInfo not depend on SessionState. (#442) 2019-02-05 22:38:50 -08:00
Changming Sun
9faac70dae Delete Tensor's copy constructor 2019-02-05 16:38:27 -08:00
Weixing Zhang
696ab8a194
Create a separate component for graph optimization. (#421)
* Create a project for graph optimizer.

Move optimizer related code to the folder optimizer.

* Fix build failures.

* rebase and fix build failures.

* fix build failure.

* fix build failure with cuda path.

* fix python build failure.

* Move two transformers(memcpy and insert_cast) from framework to optimizer.

* rebase.

* SessionState should not depend on optimizer.
2019-02-04 15:45:12 -08:00
Scott McKay
f85cd520c0
Recurse into subgraphs in transformers and session initialization (#368)
* Add Recurse method to GraphTransformer.
Move GraphTransformer::Apply to ApplyImpl and make private.
Add non-virtual GraphTransformer::Apply method to handle calling Graph::Resolve in a more consistent manner.
Create MemcpyTransformer GraphTransformer to handle memcpy operations on subgraphs in a more standard way.

* Checkpoint

* Make the subgraph insert less verbose

* Add graph nesting level to transformer ApplyImpl
Tweak cast transformer to recurse nicely and avoid unnecessary Resolve calls by splitting out the duplicate removal into a separate transformer.
Decouple memcpy transformer from ExecutionProviders and minimise what's in the header.

* Recurse into subgraphs inside GraphPartitioner

* Update a couple of new transformers

* Check Recurse return value.

* Cleanup some memory management in inference session by moving some things into SessionState

* Add deleted flag to rewrite rules so we stop processing nodes that are removed.
Remove some (most likely) unnecessary Resolve calls. As we always call Resolve for a graph modified by a transformer there's generally no need for the transformer to do it.

* Minor cleanups.

* Add some extra usage information to the comments in GraphTransformer.

* Address PR comments
2019-02-02 06:03:00 +10:00
Scott McKay
efb72540be
Separate out constant node index information from ExecutionFrame (#410)
* Separate out the NodeArg index information from ExecutionFrame so it is only calculated once.

* Skip copy to/from device if only CPU execution provider is registered.
Cleanups.

* Address PR comments.
Clean up a few areas.

* Fix Linux build error
2019-02-01 10:55:49 +10:00
Konstantinos Karanasos
c76725da2d
Slice elimination rewrite rule; re-implementation of identity elimination using new Graph API (#87)
Rewrite rule that eliminates slice operators when they are redundant (i.e., when they preserve the whole input).
Re-implementation of the identity elimination rule using the latest Graph API.
2019-01-30 16:19:40 -08:00
Ryan Hill
09806625cf
Rename OrtInitialize to OrtCreateEnv in preparation for future. (#399)
* Rename OrtInitialize to OrtCreateEnv in preparation for future.
Add version number to structures

* Forgot about exports

* Update documentation
2019-01-29 15:03:18 -08:00
Ryan Hill
d875ab2acd
C API - Remove reference counting (#344) 2019-01-25 19:41:10 -08:00
stevenlix
8ea7197b82 trt (#361)
* updated cmake files for tensorrt
2019-01-23 13:28:13 -08:00
Scott McKay
8b55596dfe
The CUDA compiler doesn't support gsl::suppress so disable when __NVCC__ is defined. (#358) 2019-01-22 17:42:33 +10:00
Changming Sun
c87929e949 Use nsync for implementing condition variable 2019-01-21 22:59:42 -08:00
Ke Zhang
6831fc16ed Kezhan/kernel registry refine (#346)
* refactor kernel registry to make it a little bit more readable.

* update

* update cudaexecutionprovider

* fix build break

* fix comments

* fix build break
2019-01-18 09:55:30 -08:00
Scott McKay
9f3ae4279f Handle copy to/from non-CPU devices across control flow nodes (#339) 2019-01-17 10:51:23 -08:00
Changming Sun
c2704b5afb cleanup code (#343) 2019-01-16 17:12:22 -08:00
Ryan Hill
98a92547bf
Ryanunderhill/c api 8 (#297)
* Make OrtAllocator not be reference counted

* Make the allocator interface more type safe

* Fix build break

* Build break fix

* Build break fix

* Mistake in previous build fix.

* Fix review comments + build break

* Missed the export symbols

* C specific error, need 'struct' keyword in one case.

* Function calling OrtReleaseObject instead of OrtReleaseEnv
2019-01-10 02:06:29 -08:00
Changming Sun
5e113661a9 Build system upgrades (#281)
* update

* runas normal user
2019-01-07 13:15:24 -08:00
Pranav Sharma
de383d93be
Fix inconsistency in enum names in the C API (#277)
* Fix inconsistency in enum names in the C API

* fix build
2019-01-04 16:41:15 -08:00
Tang, Cheng
d0fa974976
interface change to code-generated kernels (#192)
* merge function compile interface

* fix build error

* fix linux build break

* fix static cast issue; fix clang style

* fix argument change

* use alignment allocation;fix comments in pr

* fix linux break

* apply clang format

* rename according to comments in pr

* rename according to pr comments;remove useless file

* remove the need_compile flag

* avoid passing whole session state
2019-01-02 17:18:08 -08:00
Ryan Hill
6a090985fb More C API changes (#259)
* More API changes, remove 'Inference' from function names. Remove enum values. Make Status match other types.

* Switch to bool instead of int, and remove stdbool
2018-12-28 14:53:19 -08:00
Dmitri Smirnov
7af1887b33
Introduce basic BFloat16 runtime support (#235)
* Add basic support for BFloat16 type.

* Advance onnx submodule for bfloat16 support.

* Update install_deps for linux.

* Address review comments.
2018-12-21 12:40:59 -08:00
Ryan Hill
a37887cfa1
More intuitive ordering to the API functions (#233)
* More intuitive ordering to the API functions

* Rename TCHAR_T
2018-12-20 13:47:48 -08:00
Tang, Cheng
c453b48b71
update kernel memory type interface (#225)
* refactor the kernel memory type interface

* remove useless change

* fix comments in PR
2018-12-20 11:11:50 -08:00
Ryan Hill
773114a4f1
More C header naming changes (#202)
* More Ort prefix changes for consistency

* Fix C# methods

* More C# fixes
2018-12-18 11:39:46 -08:00
edgchen1
71c56b6d7c Fix array feature extractor out of bounds access issue (#194)
* Fixed out of bounds access in ArrayFeatureExtractor.

* some cleanup

* Updated tensor_shape.h comments.

* Updated macro name.

* Added copy assignment, move assignment/ctor to TensorShape.

* Removed i64 literal suffix.

* Fixed test.

* Fixed type of x_num_dims.
2018-12-18 00:30:07 -08:00
Ryan Hill
11b369a864
Abbreviate ONNXRuntime as Ort in all of our public APIs (#175)
Applies to all public headers and macros, plus many internal ones. There are still some internal things with OnnxRuntime in the name, but this fixes all public functions & macros.
2018-12-14 14:54:23 -08:00
Ryan Hill
d419170c7b
Rename ONNXRUNTIME_API_STATUSCALL to ONNXRUNTIME_API_CALL since it's … (#165)
* Rename ONNXRUNTIME_API_STATUSCALL to ONNXRUNTIME_API_CALL since it's just for calling convention, there's no status return value implied.

* Missed a function
2018-12-13 14:42:51 -08:00
edgchen1
c5a0119d42 Added Environment::IsInitialized() and added check to InferenceSession constructor. (#169) 2018-12-13 13:34:49 -08:00
Ke Zhang
9baaf5e956
Kezhan/change edge api to use index (#138)
* remove input edges while removing a node.

* put comments on how to remove a node without using resolve.

* fix test failure

* fix test failure.

* fix format

* try to guess and fix mac ci failure.

* change add remove edge api.

* update IR

* update comments

* fix comments.
2018-12-12 14:30:55 -08:00
Yuan Yu
f189b76f9a Some small edits and renaming. (#153) 2018-12-11 16:36:39 -08:00
Ke Zhang
830c341c19
remove graph editor since it's not designed as expected to restrict graph access for rewrite rule. (#119) 2018-12-06 14:10:51 -08:00
Ryan Hill
eea7618d53
Ryanunderhill/c api (#85)
* Unify all C API header files into a single file.
Remove Ptr suffix and use '*' syntax directly.
2018-12-05 14:03:45 -08:00
Tang, Cheng
dd1b16dd58
add brainslice change in common folder (#109) 2018-12-05 13:48:51 -08:00
Ke Zhang
005f9dca96
Kezhan/renaming graph_base.h to graph.h (#95)
* rename graph.h to graph_viewer.h

* rename graph_base.h to graph.h
2018-12-04 13:25:39 -08:00
Ke Zhang
a78acb2d2c
rename graph.h to graph_viewer.h (#84) 2018-12-04 08:41:03 -08:00
Pranav Sharma
b7cc611563
Minor documentation changes (#78) 2018-12-03 12:55:29 -08:00
linkerzhang
e00c956254 update the comments. 2018-11-29 17:54:30 -08:00
linkerzhang
35f94cac27 remove const cast from conv related fusion. 2018-11-29 17:45:44 -08:00
Scott McKay
bd50598d17 Document the Graph header files and cleanup some issues. (#42)
* Checkpoint.

* Add doco to graph.h and graph_base.h.
Change NodeConstIterator to return a reference to clearly advertise no nullptr's are going to be returned as it's only iterating valid Nodes.
Fix some code analysis warnings.

* Make a couple of APIs return a reference instead of a pointer as they never return nullptr.

* More doco and some minor naming cleanups.

* Cleanups
Couple more consistency changes.

* Fix CUDA test file

* Fix invalid line.
2018-11-28 08:42:11 -08:00
Ryan Hill
a9b52f399d
Add pre-release notice to c_api (#38) 2018-11-27 18:06:00 -08:00