-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[EP ABI] Utility to serialize OrtGraph to GraphProto #25292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…to return the attribute names that correspond to each subgraph.
… the original model
* | ||
* \since Version 1.23. | ||
*/ | ||
ORT_API2_STATUS(Graph_GetNumOperatorSets, _In_ const OrtGraph* graph, _Out_ size_t* num_operator_sets); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: "Operator set" is terminology from ONNX: https://github.com/onnx/onnx/blob/3236bf77da50c6bd365e7a3d0e79ef47acace640/onnx/onnx.proto#L888-L901
ORT also uses "domain opset versions". Not sure which is clearer.
Thanks @adrianlizarraga! we should discuss with @chilo-ms where the utility functions should live. there are several options. |
@chilo-ms @jywu-msft , I made this a header-only file that can be copied into a project that builds with ORT + ONNX. I moved it into Please let me know if you have any feedback. Thanks. |
Description
OrtGraph
to aGraphProto
orModelProto
.Node_GetSubgraphs
API function to also return the attribute names associated with each subgraph. This is required to determine which subgraph corresponds to a given attribute.Graph_GetNumOperatorSets
andGraph_GetOperatorSets
API functions to get the opset version for each domain.Motivation and Context
Provide a utility to facilitate porting of existing execution providers to the new EP ABI. The utilities introduced by this PR convert an
OrtGraph
into an ONNX protobuf representation, which some existing EPs currently convert to their internal representation. Ideally, we would prefer a more direct conversion from aOrtGraph
to the EP's internal representation, but this is a large effort. These utilities enable an incremental transition.