- This adds support for ONNX sequences, along with basic unit tests for
the sequence types.
- This also introduces a new test network generated via sklearn in an
included script.
- The test using sklearn_randomforest.onnx has not been written yet,
but I wanted to commit after doing all the work so far. The existing
tests all pass.
- Add SessionOptions.AppendExecutionProviderOpenVINO, which should
enable the OpenVINO execution provider on supported systems.
Internally it calls the
SessionOptionsAppendExecutionProvider_OpenVINO_V2 API.
- I hadn't tested this properly before, but DynamicAdvancedSession
seems perfectly capable of handling inputs and outputs with dynamic
axes. This change introduces a test case for this behavior, including
a basic ONNX network that computes a sum on an arbitrary batch of
vectors.
- Added the GetInputOutputInfo() and GetInputOutputInfoWithONNXData()
functions, which return a list of input and output names, shapes, and
types for a .onnx file.
- This commit adds bindings to enable DirectML on supported onnxruntime
builds and systems.
- I couldn't get the tests to run on my own system, so it has not yet
been tested.
- I am still not happy with copying the OrtDmlApi struct, but think
it's better than the "proper" alternative of trying to pull in the
dml_provider_factory.h header.
- There was an old comment in the test about the data types not being
exposed, which is no longer true as of the addition of
TensorElementDataType to the go wrapper.
- Added a function that sets the underlying data slice to 0 for any
tensor type.
- Added a test for the new function.
- Nobody was asking for this, but I plan to use it myself.
- It's probably worth benchmarking whether this is better to do using
C.memset or just a loop in go. Probably depends on tensor size and
the overhead of the C call.
- Some code intended to compare two floats only was comparing them if
they had a negative difference. Fixed.
- Fixing this issue made no difference in the tests passing; they still
seem fine. Not surprising.
- This change introduces the CustomDataTensor type, which implements
the ArbitraryTensor interface but, unlike the typed Tensor[T], is
backed by an arbitrary slice of user-provided bytes. The user is
responsible for providing the type of data the tensor is supposed to
contain, as well as responsible for ensuring the data slice is in the
correct format for the specified shape.
- Added some test cases for the new CustomDataTensor type, which most
notably will enable users to use float16 tensors (provided they
converted the float16 array into bytes on their own).
- Add a .gitattributes file that will hopefully make github recognize
this as a Go repo rather than a C++ one.
- Remove an outdated comment from onnxruntime_test.go.
- A comment in onnxruntime_wrapper.h was written when I incorrectly
assumed that CoreML was supported via the ort_api struct. Fixed.
- The benchmark timer is not properly stopped before initializing the
session and environment in the CoreML benchmark.
- This commit adds changes to support CoreML. CoreML is enabled via a
function that's exported only in the onnxruntime dylib on supported
platforms (i.e., Apple systems). So, this change enables support by
looking up the required function if running on a platform where it is
expected. Doing this avoids the need for any headers, and support
can be detected at runtime.
- Refactors a bunch of testing and benchmarking code, to avoid
replicating a bunch of code for yet another execution provider.
- This change introduces support for enabling the TensorRT execution
backend. It is configured in basically the same manner as the CUDA
backend, with analogous APIs.
- Added a unit test and benchmark for the TensorRT backend. To try it,
run "go test -v -bench=." on a system where TensorRT is installed,
and you're using a build of onnxruntime with TensorRT enabled.
- Added a CUDA test and benchmark. They seem to pass on a CUDA 11.8
x86_64 Linux system, though I have not tested them elsewhere yet.
- Updated the test code to check for the
ONNXRUNTIME_SHARED_LIBRARY_TEST environment variable. If the
environment variable is set, then the test code will use it as the
path to the onnxruntime shared library binary, rather than attempting
to use the copies in the test_data directory. This is helpful when
testing with CUDA-enabled builds, which are huge and I don't want to
include them in test_data.
- Added a test for setting SessionOptions.
- Added another network: example_big_compute.onnx. It is deterministic,
and I hope to use it when testing CUDA acceleration due to the
relatively large amount of compute it does (a series of scalar
multiplications and divisions across a 50M element tensor).
- Added a benchmark for single-threaded vs. multi-threaded evaluation
of a network. Unfortunately, they don't show any performance
difference; something may be wrong but I'll investigate more later.
- This commit introduces the AdvancedSession type, which supersedes all
existing typed Session[T] types. It addresses two big deficiencies
with the previous Session implementation: 1) lack of ability to
provide options, and 2) unecessary use of type parameters.
- Removing the type parameters allows the AdvancedSession to use an
arbitrary set of different-type input and output tensors. Added a new
test case to verify this works, along with the example_multitype.onnx
file and the pytorch script to generate it.
- Added the SessionOptions struct, which at the moment should allow for
setting the InterOpNumThreads or IntraOpNumThreads, as well as
enabling CUDA. However, the options settings have not yet been tested
at this time.
- Made the typed Session and DynamicSession delegate their
functionality to AdvancedSession instances.
- Moved the old typed Session struct definitions to the legacy_types.go
file.
- Updated the README and comments to make it clear that the typed
sessions probably shouldn't be used in new code.
- Added a new interface that is satisfied by any tensor regardless of
data type. While not useful in this commit alone, the plan is to use
it to facilitate a new Session type that will allow arbitrary
different combinations of input and output tensor types.
- This change adds the DisableTelemetry() and EnableTelemetry()
top-level functions, which wrap the DisableTelemetryEvents() and
EnableTelemetryEvents() C API functions for the package's internal
onnxruntime environment.
- This change rolls back some of the prior commit. As a fan of the
onnxruntime library, I decided to take a more charitable approach to
their telemetry and not disable it by default in these bindings.
- This change adds several more detailed error types that may be
returned when attempting to work with shapes that are invalid for
some reason.
- Added the Shape.Validate() function, which may be called by users,
but is internally called when creating new tensors.
- I hate the convention of putting "go" on every library wrapper, but
unfortunately the utility is undeniable. I don't want people to find
this repo when they are actually looking for the "real" onnxruntime
repo.
- Modified the Session API so that the user must provide all input and
output tensors when creating the session (Run() no longer takes any
arguments). This should avoid allocations and fix the incorrect way
I was using input and output names before.
- Updated the test to use the new API.
- Removed the onnx_example_application; it was only doing the same
thing as the unit test anyway.
- Named the cleanup function something more consistent with the other
cleanup functions.
- Fixed a couple bugs where deferred stuff was executed after the
environment was destroyed, causing a segfault.
- The library is now capable of loading the test session and running
it successfully.
- Updated the example application, which is really the same as the test
and should probably be deleted.
- TODO: The input names actually *do* need to match the names when the
network was created. The hardcoded names in onnxruntime_wrapper.c
will *not* do!
- There is now a wrapper to create generic Tensor objects in Go, that
should be appropriately backed by the onnxruntime.
- Did some minor tests.
- Still to do: update the example, and put together a nice API that
uses the tensors.
- Sets up the onnxruntime environment, but doesn't load or run networks
yet.
- The things builds and run on Windows.
- Still working on getting the Linux (arm64 for now) test to work.