- This change adds support for tensors of
ONNX_TENSOR_ELEMENT_DATA_TYPE_STRING. Unfortunately, this can't be
shoehorned into Tensor[T], since there's no obvious way to have go
manage the backing buffer of memory. Instead this change adds a
StringTensor type, that satisfies the OrtValue interface.
- Added a new test .onnx file that takes a vector of strings and
converts each string into uppercase and lowercase outputs.
- This changes adds a wrapper for the
SessionOptionsAppendExecutionProvider API, which is a basic catch-all
function for enabling several execution providers, some of which
already have dedicated functions.
- Added a very basic test for the new function's error. It would be
nicer to test the function itself, but that would require a system
that supports one of the providers.
- Apparently some onnx models will use outputs that have no dimensions.
This change supports such models.
- Note: You still won't be able to create a ort.Tensor when the shape's
length is 0. I plan to keep things this way unless someone complains.
- Added functions for setting per-session and environment-wide logging
levels. This allows me to remove the stdout message when the test
fails to load the OpenVINO library.
- Onnxruntime allows one or more dimensions of a tensor to be 0, and
this is actually useful in some cases. This was previously
(incorrectly) prohibited by the Go wrapper. No longer.
- Added a test to ensure that tensors with a dimension of 0 are
allowed.
- Additionally, expose the LoggingLevel type, wrapping the
OrtLoggingLevel enum. I plan to use this to hopefully silence the
annoying failure messages printed to stdout when the OpenVINO tests
run.
- The unit test is rather basic, and just makes sure errors don't occur
for a couple things.
- Fixed a potential issue where an environment could remain partially
initialized if an initialization option failed to apply.
- Added basic wrappers for I/O binding APIs. BindOutputToDevice is
notably still not supported.
- Added support for setting the GraphOptimizationLevel in session
options.
- This adds a wrapper around the SetSessionExecutionMode C API, which
allows setting a session's execution mode to ORT_PARALLEL or
ORT_SEQUENTIAL.
- This also introduces a wrapper for the ExecutionMode enum.
- To test execution mode, introduced example_big_fanout.onnx, which
does 100 matrix multiplies in parallel before recombining the result.
It looks really funny in netron.app. Unfortunately, it performs worse
with parallelism, likely due to the matrix sizes being tiny. However,
the settings clearly make a difference.
- Added support for onnxruntime's string-based API for setting session
options. This includes three functions for SessionOptions instances:
HasSessionConfigEntry(key string), GetSessionConfigEntry(key string),
and AddSessionConfigEntry(key, value string).
- This can be used to change session settings that aren't otherwise
exposed by the API, such as "session.inter_op_allow_spinning".
- Added support for the bool tensor type; my main reservation is that
Go may in the future represent bool slices by something other than
single bytes. However, I doubt this will be the case for several
reasons: 1) it would likely break many other Cgo libraries, 2) it
would make binary.Write and binary.Read more complicated, since both
guarantee one byte per bool, 3) Go seems to have no mechanism to
have elements of slices be different sizes, which would be necessary
for some slice-of-bits implementation of bool, and 4) there should
never be a reason for a bool to be _larger_ than one byte. Given
these thoughts, I think it's reasonable to assume this change will be
safe. If any of this changes in the future, it would require
deprecating and removing bool tensor support, which seems unlikely to
be heavily used.
- Removed testing data that was used only with
onnxruntime_training_test.go, which was already removed.
- Renamed legacy_types.go to legacy_code.go, since it's now a parking
ground for legacy code that's not just "types".
- Fixed some references to the training API in CONTRIBUTING.md.
- The training API has been deprecated by onnxruntime itself, and it
will be much easier to remove it rather than deprecate it.
- The training API wrapper functions have been replaced by stubs that
return errors in legacy_types.go.
- The README mentions the old version required for the training API.
- The Scalar type has been promoted to onnxruntime_go.go, and a test
has been added for it.
Convert paths to UTF16 on Windows, enable path-based APIs
- This change adds a function to convert UTF8 to UTF16 strings on
Windows, enabling direct usage of the onnxruntime CreateSession
functions in lieu of always buffering files and using
CreateSessionFromArray.
- Adding functionality for converting paths to UTF16 also enables the
training API on Windows.
- This is an in-progress commit that still may require some touchups,
as well as proper test cases for the now-underutilized *WithONNXData
functions.
- Added a simple .onnx file to test_data with a name containing
non-ascii characters.
- Used the new file to test that the non-ASCII paths work correctly on
Windows and Linux, in both the current and "legacy" session API.
- Removed the old "example_network.onnx" and associated tests. This was
an overengineered idea from when I first started the library.
- Fix typos and minor text in CONTRIBUTING.md
- .gitignore doesn't refer to any artifacts within the repo. Removing
the unused lines made the file empty, so removed the file.
- Added the training API header to .gitattributes so it won't count
towards the LoC in the github statistics.
- Fixing this memory leak required changing the semantics for the
internal createGoValueFromOrtValue function, since the input OrtValue
will now be released and replaced if it was a Tensor.
- This fixes the memory leak by releasing C-managed data and copying it
into a Go slice. Previously, the C-managed data would never be freed,
because the OrtValue containing it would never be released. This
wouldn't cause a segfault, but it would potentially slowly leak
memory.
- I wanted to change this before anyone started using the previous
version.
- This new version is much easier to use; you no longer need to
manually free every value that you read from a sequence; they're
fetched when the sequence is created and destroyed when it's
destroyed.
- Added tests for the Sequence type, including preliminary ones
launching the sklearn network.
- The sklearn test will be finished after map support is added.
- 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.
- Use the createCSession function in GetInputOutputInfoWithONNXData and
GetModelMetadataWithONNXData.
- The createCSession function contains some essential error checks and
it's better to reuse code anyway. This should fix some bugs that
hadn't been reported yet (e.g., passing an empty slice to either of
these functions or calling GetInputOutputInfo with an empty file,
etc)
- The README mentioned not including arm64 osx binaries in test_data/,
which is no longer true. I'd personally prefer to keep the number
of libraries in test_data to a minimum, but it's valuable to make it
easier for other users to test on osx, which I personally am not able
to test.
- Add SessionOptions.AppendExecutionProviderOpenVINO, which should
enable the OpenVINO execution provider on supported systems.
Internally it calls the
SessionOptionsAppendExecutionProvider_OpenVINO_V2 API.
- This change updates the headers and included shared library binaries
release 1.17.1 of onnxruntime. The tests (including CUDA support)
still seem to pass.