microsoft / microsoft/onnxruntime

Create OrtKernelInfo for use in CreateOp via the C API

Open
#12,279 15 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature request
Dominant language
C++
Stars
21.9k
Forks
4.2k
Avg merge
4d 8h
Merged PRs (30d)
179

Description

Is your feature request related to a problem? Please describe.
I'd like to expose the CreateOp and InvokeOp methods in Java, but I need to be able to create an OrtKernelInfo and an OrtKernelContext to call the methods. It looks like the OrtKernelInfo is an alias for OpKernelInfo which is used to look up the EP to use. OrtKernelContext is an alias for OpKernelContext used to wrap the thread pool and the logger for the op execution.

System information

  • ONNX Runtime version (you are using): master

Describe the solution you'd like
Ability to create these classes from an instance of OrtSession using the execution providers defined inside it or an instance of OrtEnv by requesting a specific execution provider.

Describe alternatives you've considered
Instantiating these types isn't part of the C API I can see, so there isn't really any alternative without using non-public APIs.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the public C API entry points for CreateOp and InvokeOp, then review how OrtKernelInfo and OrtKernelContext alias OpKernelInfo and OpKernelContext. Check the Java exposure requirements described in the issue and determine how construction should use an OrtSession's execution providers or a requested provider from OrtEnv. Done means the required types can be created through supported public APIs.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, cpp, java
Domain
api, machine-learning
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.