[WIP] Csharp bindings for on-device training APIs
DO NOT REVIEW. This PR adds support for csharp bindings for on-device training APIs
"retrieve the training APIs.\n");
We would like to make sure no exception propagates across C API boundaries. No one will see this message, nullptr will be returned and the process would crash without any meaningful explanation. It will be a GH issue. Also, it is not clear how a ptr can eever be returned across the language boundaries. These structures should always be return by value and its structure should match the C# structure. We need either an alternative error reporting mechanism OR, better yet, make sure this is never called from C# in inference builds.
In reply to: 1216921870
Refers to: onnxruntime/core/session/onnxruntime_c_api.cc:2258 in 60576e8. [](commit_id = 60576e806629c0423f9fe78e2d89c7b53a7fbbc1, deletion_comment = False)
execution_providers.emplace_back(std::move(factory->CreateProvider()));
move is not necessary here
In reply to: 1228928558
Refers to: orttraining/orttraining/training_api/onnxruntime_training_c_api.cc:19 in 0168f52. [](commit_id = 0168f527559a116201e06ef9e59fb2355e2b5767, deletion_comment = False)
@ashbhandare : Can you add the details around how to enable these bindings in the build to the PR description. Basically, build flag etc info + what to expect in an inference build? will the user get a descriptive error message or whether ort will crash? Also have you tested this scenario?
printf("Error message :%s\n", msg); \
I suspect no one will ever see these.
In reply to: 1230695997
In reply to: 1230695997
Refers to: orttraining/orttraining/test/training_api/common/synthetic_data_loader.cc:103 in 0168f52. [](commit_id = 0168f527559a116201e06ef9e59fb2355e2b5767, deletion_comment = False)
#include <onnxruntime_cxx_api.h>
Please, remove
Refers to: orttraining/orttraining/test/training_api/common/synthetic_data_loader.h:16 in 0168f52. [](commit_id = 0168f527559a116201e06ef9e59fb2355e2b5767, deletion_comment = False)
#include <onnxruntime_cxx_api.h>
Please, remove
Refers to: orttraining/orttraining/test/training_api/common/synthetic_data_loader.h:16 in 0168f52. [](commit_id = 0168f52, deletion_comment = False)
As discussed offline, will be taken care of in a separate PR
In reply to: 1232252550
@ashbhandare : Can you add the details around how to enable these bindings in the build to the PR description. Basically, build flag etc info + what to expect in an inference build? will the user get a descriptive error message or whether ort will crash? Also have you tested this scenario?
I have added description of how to enable the bindings and the tests. In the Inference native build, while trying to use the APIs, user will get an error message like "System.InvalidOperationException : Training is disabled in the current build".
Has this been abandoned? Any news of c# training roadmap?
Are there any builds with c# training?