Skip to content

Commit 281ed8c

Browse files
glen-amdGlen Cao
andauthored
VitisAI EP Context Model (microsoft#20926)
# Why so many commits - Runtime debugging - which is necessary - Three different approaches to EP context model - as a result testing back and forth - Windows compatibility issues - this development has been done on Linux for convenience # "Open" (?) questions - Full offloading to a specific EP - Dumping EP context models by EPs vs [by ONNXRT](https://github.com/microsoft/onnxruntime/blob/e2abba18ea9370329ce6894a4eb3e98ad8f11cb6/onnxruntime/core/framework/graph_partitioner.cc#L725) - [Node name to pick nodes](https://github.com/microsoft/onnxruntime/blob/e2abba18ea9370329ce6894a4eb3e98ad8f11cb6/onnxruntime/core/framework/graph_partitioner.cc#L654) # VitisAI EP made three variant implementations that have respective pros and cons (and of course we can combine them) ## Serialize and cache the list of compute capabilities and the original ONNX model itself ## In `ComputeCapability()`, serialize and cache the backend compilation cache and the related necessary cache info such as cache dir and cache key ## In `Compile()`, serialize and cache the backend compilation cache and the related necessary cache info such as cache dir and cache key # EP context model creation - Precondition Session option configuration `kOrtSessionOptionEpContextEnable` (aka "ep.context_enable") is enabled. - Approach 1 - Steps 1. EP creates an ONNX model whose main graph has EP context nodes (i.e., node type is "EPContext"). 2. EP implements/overrides `IExecutionProvider::GetEpContextNodes()` method. 3. ONNXRT core creates an EP context model and saves/dumps it. - `CreateEpContextModel()` in the file "graph_partitioner.cc" - In `get_ep_context_node()`, `Node::Name()` is used to check whether a node is an EP context node. This limits that EP model creation can only happen in `IExecutionProvider::Compile()`. - The workaround is (1) not implementing `IExecutionProvider::GetEpContextNodes()` and (2) dumping the EP context model by EP itself. 4. Optionally, EP can also dump the EP context model it created by iteself. - Examples - `QNNExecutionProvider` - `VitisAIExecutionProvider` - Approach 2 - Steps 1. EP creates an ONNX model whose main graph has EP context nodes (i.e., node type is "EPContext"). 2. EP does NOT implement `IExecutionProvider::GetEpContextNodes()` at all. 3. EP dumps the EP context model it created. - Examples - `TensorrtExecutionProvider` - UPDATES - TRT EP is switching to leveraging `IExecutionProvider::GetEpContextNodes()` - `OpenVINOExecutionProvider` (?) # What to cache in EP context nodes - Non Compilation based EPs - Examples - `VitisAIExecutionProvider` - Characteristics - Heavy lifting work happens in `IExecutionProvider::GetCapability()`. - Preconditions - `IExecutionProvider::GetCapability()` is only called once by ONNXRT. - Cache content - Serialization of a list of `ComputeCapability` - Not EP-specific - Serialized using `onnx::FunctionProto` - EP-specific cache - Compilation based EPs - Examples - `QNNExecutionProvider` - `TensorrtExecutionProvider` - `MIGraphXExecutionProvider` - `OpenVINOExecutionProvider` - Cache content - EP-specific cache # Requirements - Offline / AOT compilation of ONNX models with EP context cache - Compile somewhere, run everywhere - Pseudo code with brief explanation ``` GenerateCache(original_onnx_file, cache_onnx_file) model_buffer = load(original_onnx_file) --> Load the original ONNX model file model_buffer = decrypt(model_buffer) session_options = { kOrtSessionOptionEpContextEnable: true, kOrtSessionOptionEpContextFilePath: temp_file } --> Set necessary configs Ort::CreateSessionFromArray(model_buffer, session_options) --> The new ONNX model with EP context is created and dumped into the user specified file "temp_file" temp_buffer = encrypt(temp_file) write(temp_buffer, cache_onnx_file) --> Write the encypted context of "temp_file" into the "cache_onnx_file" file InitializeInferenceSession(cache_onnx_file) model_buffer = load(cache_onnx_file) --> Load the ONNX model with EP context from the file generated in the previous step model_buffer = decrypt(model_buffer) session_options = { } Ort::CreateSessionFromArray(model_buffer, session_options) --> Create and initalize an session with the EP context model ``` - Python code with comments - EP context model creation ```python import onnxruntime as onnxrt # Session options for creating an ONNX model with EP context cache. sess_opts = onnxrt.SessionOptions() # Verbose. sess_opts.log_severity_level = 0 # This is REQUIRED. sess_opts.add_session_config_entry("ep.context_enable", "1") # This is OPTIONAL. # Either an absolute path (preferred for now) or a relative path (WIP) is okay. # sess_opts.add_session_config_entry("ep.context_file_path", "/some/path/to/original_model_ctx.onnx") # This is OPTIONAL. sess_opts.add_session_config_entry("ep.context_embed_mode", "1") orig_model_location = "/some/path/to/original_model.onnx" sess = onnxrt.InferenceSession(orig_model_location, sess_opts, providers=["VitisAIExecutionProvider"], provider_options=[]) ``` - Inference run with an EP context model ```python import onnxruntime as onnxrt # Session options for creating an ONNX model with EP context cache. sess_opts = onnxrt.SessionOptions() # Default EP context model path. # ep_ctx_model_location = "/some/path/to/origina_model.onnx_ctx.onnx" # User configured EP context model path. ep_ctx_model_location = "/some/path/to/origina_model_ctx.onnx" sess = onnxrt.InferenceSession(ep_ctx_model_location, sess_opts, providers=["VitisAIExecutionProvider"], provider_options=[]) model_inputs = {} run_opts = onnxrt.RunOptions() # Verbose. run_opts.log_severity_level = 1 sess.run(None, model_inputs, run_opts) ``` --------- Co-authored-by: Glen Cao <glen@Glens-MacBook-Air.local>
1 parent 92a8407 commit 281ed8c

File tree

13 files changed

+1195
-16
lines changed

13 files changed

+1195
-16
lines changed

include/onnxruntime/core/graph/basic_types.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ class TensorProto;
1919
class SparseTensorProto;
2020
class TypeProto;
2121
class AttributeProto;
22+
class FunctionProto;
23+
class OperatorSetIdProto;
2224
// define types that would come from the ONNX library if we were building against it.
2325
#if defined(ORT_MINIMAL_BUILD)
2426
using OperatorSetVersion = int;

onnxruntime/core/providers/shared_library/provider_api.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ struct NodeProto;
108108
struct SparseTensorProto;
109109
struct StringStringEntryProto;
110110
struct StringStringEntryProtos; // RepeatedPtrField
111+
struct OperatorSetIdProto;
111112
struct TensorProto;
112113
struct TensorProtos; // RepeatedPtrField
113114
struct TensorShapeProto_Dimension;
@@ -120,6 +121,7 @@ struct TypeProto_Sequence;
120121
struct TypeProto;
121122
struct ValueInfoProto;
122123
struct ValueInfoProtos; // RepeatedPtrField
124+
struct FunctionProto;
123125
struct InferenceContext;
124126
class GraphInferencer;
125127
using InferenceFunction = std::function<void(InferenceContext&)>;
@@ -146,6 +148,7 @@ struct ConfigOptions;
146148
struct DataTransferManager;
147149
struct IndexedSubGraph;
148150
struct IndexedSubGraph_MetaDef;
151+
enum class IndexedSubGraph_SourceOfSchema : uint8_t;
149152
struct KernelCreateInfo;
150153
struct KernelDef;
151154
struct KernelDefBuilder;

onnxruntime/core/providers/shared_library/provider_interfaces.h

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,11 @@ struct ProviderHost {
304304
virtual int StringStringEntryProtos__size(ONNX_NAMESPACE::StringStringEntryProtos* p) = 0;
305305
virtual ONNX_NAMESPACE::StringStringEntryProto& StringStringEntryProtos__at(ONNX_NAMESPACE::StringStringEntryProtos* p, int index) = 0;
306306

307+
// OperatorSetIdProto
308+
virtual std::string* OperatorSetIdProto__mutable_domain(ONNX_NAMESPACE::OperatorSetIdProto* p) = 0;
309+
virtual void OperatorSetIdProto__set_version(ONNX_NAMESPACE::OperatorSetIdProto* p, int64_t version) = 0;
310+
virtual int64_t OperatorSetIdProto__version(const ONNX_NAMESPACE::OperatorSetIdProto* p) = 0;
311+
307312
#if !defined(DISABLE_OPTIONAL_TYPE)
308313
// TypeProto_Optional
309314
virtual const ONNX_NAMESPACE::TypeProto& TypeProto_Optional__elem_type(const ONNX_NAMESPACE::TypeProto_Optional* p) = 0;
@@ -420,13 +425,19 @@ struct ProviderHost {
420425
virtual void ModelProto__set_ir_version(ONNX_NAMESPACE::ModelProto* p, int64_t value) = 0;
421426
virtual ONNX_NAMESPACE::StringStringEntryProtos* ModelProto__mutable_metadata_props(ONNX_NAMESPACE::ModelProto* p) = 0;
422427

428+
virtual const ONNX_NAMESPACE::OperatorSetIdProto& ModelProto__opset_import(const ONNX_NAMESPACE::ModelProto* p, int index) = 0;
429+
virtual ONNX_NAMESPACE::OperatorSetIdProto* ModelProto__mutable_opset_import(ONNX_NAMESPACE::ModelProto* p, int index) = 0;
430+
virtual int ModelProto__opset_import_size(const ONNX_NAMESPACE::ModelProto* p) = 0;
431+
virtual ONNX_NAMESPACE::OperatorSetIdProto* ModelProto__add_opset_import(ONNX_NAMESPACE::ModelProto* p) = 0;
432+
423433
// NodeProto
424434
virtual std::unique_ptr<ONNX_NAMESPACE::NodeProto> NodeProto__construct() = 0;
425435
virtual void NodeProto__operator_delete(ONNX_NAMESPACE::NodeProto* p) = 0;
426436
virtual void NodeProto__operator_assign(ONNX_NAMESPACE::NodeProto* p, const ONNX_NAMESPACE::NodeProto& v) = 0;
427437
virtual int NodeProto__attribute_size(ONNX_NAMESPACE::NodeProto* p) = 0;
428438
virtual const ONNX_NAMESPACE::AttributeProto& NodeProto__attribute(const ONNX_NAMESPACE::NodeProto* p, int index) const = 0;
429439
virtual ONNX_NAMESPACE::AttributeProto* NodeProto__mutable_attribute(ONNX_NAMESPACE::NodeProto* p, int index) = 0;
440+
virtual ONNX_NAMESPACE::AttributeProto* NodeProto__add_attribute(ONNX_NAMESPACE::NodeProto* p) = 0;
430441

431442
// TensorProto
432443
virtual std::unique_ptr<ONNX_NAMESPACE::TensorProto> TensorProto__construct() = 0;
@@ -495,6 +506,64 @@ struct ProviderHost {
495506

496507
virtual const ONNX_NAMESPACE::ValueInfoProto& ValueInfoProtos__operator_array(const ONNX_NAMESPACE::ValueInfoProtos* p, int index) = 0;
497508

509+
// FunctionProto
510+
virtual std::unique_ptr<ONNX_NAMESPACE::FunctionProto> FunctionProto__construct() = 0;
511+
virtual void FunctionProto__operator_delete(ONNX_NAMESPACE::FunctionProto* p) = 0;
512+
513+
virtual bool FunctionProto__SerializeToString(const ONNX_NAMESPACE::FunctionProto* p, std::string& string) = 0;
514+
virtual bool FunctionProto__SerializeToOstream(const ONNX_NAMESPACE::FunctionProto* p, std::ostream& output) = 0;
515+
virtual bool FunctionProto__ParseFromString(ONNX_NAMESPACE::FunctionProto* p, const std::string& data) = 0;
516+
virtual std::string FunctionProto__SerializeAsString(const ONNX_NAMESPACE::FunctionProto* p) = 0;
517+
518+
virtual bool FunctionProto__has_name(const ONNX_NAMESPACE::FunctionProto* p) = 0;
519+
virtual const std::string& FunctionProto__name(const ONNX_NAMESPACE::FunctionProto* p) const = 0;
520+
virtual void FunctionProto__set_name(ONNX_NAMESPACE::FunctionProto* p, const ::std::string& name) = 0;
521+
522+
virtual bool FunctionProto__has_doc_string(const ONNX_NAMESPACE::FunctionProto* p) = 0;
523+
virtual const std::string& FunctionProto__doc_string(const ONNX_NAMESPACE::FunctionProto* p) const = 0;
524+
virtual void FunctionProto__set_doc_string(ONNX_NAMESPACE::FunctionProto* p, const ::std::string& doc_string) = 0;
525+
526+
virtual bool FunctionProto__has_domain(const ONNX_NAMESPACE::FunctionProto* p) = 0;
527+
virtual const std::string& FunctionProto__domain(const ONNX_NAMESPACE::FunctionProto* p) const = 0;
528+
virtual void FunctionProto__set_domain(ONNX_NAMESPACE::FunctionProto* p, const ::std::string& domain) = 0;
529+
530+
virtual const std::string& FunctionProto__input(const ONNX_NAMESPACE::FunctionProto* p, int index) = 0;
531+
virtual std::string* FunctionProto__mutable_input(ONNX_NAMESPACE::FunctionProto* p, int index) = 0;
532+
virtual int FunctionProto__input_size(const ONNX_NAMESPACE::FunctionProto* p) = 0;
533+
virtual void FunctionProto__add_input(ONNX_NAMESPACE::FunctionProto* p, const std::string& value) = 0;
534+
535+
virtual const std::string& FunctionProto__output(const ONNX_NAMESPACE::FunctionProto* p, int index) = 0;
536+
virtual std::string* FunctionProto__mutable_output(ONNX_NAMESPACE::FunctionProto* p, int index) = 0;
537+
virtual int FunctionProto__output_size(const ONNX_NAMESPACE::FunctionProto* p) = 0;
538+
virtual void FunctionProto__add_output(ONNX_NAMESPACE::FunctionProto* p, const std::string& value) = 0;
539+
540+
virtual const std::string& FunctionProto__attribute(const ONNX_NAMESPACE::FunctionProto* p, int index) = 0;
541+
virtual std::string* FunctionProto__mutable_attribute(ONNX_NAMESPACE::FunctionProto* p, int index) = 0;
542+
virtual int FunctionProto__attribute_size(const ONNX_NAMESPACE::FunctionProto* p) = 0;
543+
virtual void FunctionProto__add_attribute(ONNX_NAMESPACE::FunctionProto* p, const std::string& value) = 0;
544+
545+
virtual const ONNX_NAMESPACE::AttributeProto& FunctionProto__attribute_proto(const ONNX_NAMESPACE::FunctionProto* p, int index) = 0;
546+
virtual ONNX_NAMESPACE::AttributeProto* FunctionProto__mutable_attribute_proto(ONNX_NAMESPACE::FunctionProto* p, int index) = 0;
547+
virtual int FunctionProto__attribute_proto_size(const ONNX_NAMESPACE::FunctionProto* p) = 0;
548+
virtual ONNX_NAMESPACE::AttributeProto* FunctionProto__add_attribute_proto(ONNX_NAMESPACE::FunctionProto* p) = 0;
549+
550+
virtual const ONNX_NAMESPACE::NodeProto& FunctionProto__node(const ONNX_NAMESPACE::FunctionProto* p, int index) = 0;
551+
virtual ONNX_NAMESPACE::NodeProto* FunctionProto__mutable_node(ONNX_NAMESPACE::FunctionProto* p, int index) = 0;
552+
virtual int FunctionProto__node_size(const ONNX_NAMESPACE::FunctionProto* p) = 0;
553+
virtual ONNX_NAMESPACE::NodeProto* FunctionProto__add_node(ONNX_NAMESPACE::FunctionProto* p) = 0;
554+
555+
virtual const ONNX_NAMESPACE::ValueInfoProto& FunctionProto__value_info(const ONNX_NAMESPACE::FunctionProto* p, int index) = 0;
556+
virtual ONNX_NAMESPACE::ValueInfoProtos* FunctionProto__mutable_value_info(ONNX_NAMESPACE::FunctionProto* p) = 0;
557+
virtual ONNX_NAMESPACE::ValueInfoProto* FunctionProto__mutable_value_info(ONNX_NAMESPACE::FunctionProto* p, int index) = 0;
558+
virtual int FunctionProto__value_info_size(const ONNX_NAMESPACE::FunctionProto* p) = 0;
559+
virtual ONNX_NAMESPACE::ValueInfoProto* FunctionProto__add_value_info(ONNX_NAMESPACE::FunctionProto* p) = 0;
560+
561+
virtual const ONNX_NAMESPACE::StringStringEntryProto& FunctionProto__metadata_props(const ONNX_NAMESPACE::FunctionProto* p, int index) = 0;
562+
virtual ONNX_NAMESPACE::StringStringEntryProtos* FunctionProto__mutable_metadata_props(ONNX_NAMESPACE::FunctionProto* p) = 0;
563+
virtual ONNX_NAMESPACE::StringStringEntryProto* FunctionProto__mutable_metadata_props(ONNX_NAMESPACE::FunctionProto* p, int index) = 0;
564+
virtual int FunctionProto__metadata_props_size(const ONNX_NAMESPACE::FunctionProto* p) = 0;
565+
virtual ONNX_NAMESPACE::StringStringEntryProto* FunctionProto__add_metadata_props(ONNX_NAMESPACE::FunctionProto* p) = 0;
566+
498567
virtual void RegisterSchema(const std::string& domain, const OrtCustomOp* op, int type) = 0;
499568

500569
// ConfigOptions
@@ -546,6 +615,9 @@ struct ProviderHost {
546615
virtual void IndexedSubGraph__SetMetaDef(IndexedSubGraph* p, std::unique_ptr<IndexedSubGraph_MetaDef>&& meta_def_) = 0;
547616
virtual const IndexedSubGraph_MetaDef* IndexedSubGraph__GetMetaDef(const IndexedSubGraph* p) = 0;
548617

618+
virtual void IndexedSubGraph__SetSchemaSource(IndexedSubGraph* p, IndexedSubGraph_SourceOfSchema schema_source) = 0;
619+
virtual IndexedSubGraph_SourceOfSchema IndexedSubGraph__GetSchemaSource(const IndexedSubGraph* p) = 0;
620+
549621
// KernelDef
550622
virtual void KernelDef__operator_delete(KernelDef* p) = 0;
551623
virtual int KernelDef__ExecQueueId(const KernelDef* p) = 0;

onnxruntime/core/providers/shared_library/provider_wrappedtypes.h

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,15 @@ struct StringStringEntryProtos final {
8080

8181
PROVIDER_DISALLOW_ALL(StringStringEntryProtos)
8282
};
83+
84+
struct OperatorSetIdProto final {
85+
std::string* mutable_domain() { return g_host->OperatorSetIdProto__mutable_domain(this); }
86+
void set_version(int64_t version) { return g_host->OperatorSetIdProto__set_version(this, version); }
87+
int64_t version() { return g_host->OperatorSetIdProto__version(this); }
88+
89+
PROVIDER_DISALLOW_ALL(OperatorSetIdProto)
90+
};
91+
8392
struct AttributeProto final {
8493
static std::unique_ptr<AttributeProto> Create() { return g_host->AttributeProto__construct(); }
8594
void operator=(const AttributeProto& v) { g_host->AttributeProto__operator_assign(this, v); }
@@ -178,6 +187,11 @@ struct ModelProto final {
178187

179188
void set_ir_version(int64_t value) { return g_host->ModelProto__set_ir_version(this, value); }
180189

190+
const OperatorSetIdProto& opset_import(int index) const { return g_host->ModelProto__opset_import(this, index); }
191+
OperatorSetIdProto* mutable_opset_import(int index) { return g_host->ModelProto__mutable_opset_import(this, index); }
192+
int opset_import_size() const { return g_host->ModelProto__opset_import_size(this); }
193+
OperatorSetIdProto* add_opset_import() { return g_host->ModelProto__add_opset_import(this); }
194+
181195
ModelProto() = delete;
182196
ModelProto(const ModelProto&) = delete;
183197
void operator=(const ModelProto&) = delete;
@@ -190,6 +204,7 @@ struct NodeProto final {
190204
int attribute_size() { return g_host->NodeProto__attribute_size(this); }
191205
const AttributeProto& attribute(int index) const { return g_host->NodeProto__attribute(this, index); }
192206
AttributeProto* mutable_attribute(int index) { return g_host->NodeProto__mutable_attribute(this, index); }
207+
AttributeProto* add_attribute() { return g_host->NodeProto__add_attribute(this); }
193208

194209
NodeProto() = delete;
195210
NodeProto(const NodeProto&) = delete;
@@ -372,6 +387,69 @@ struct ValueInfoProtos final {
372387

373388
PROVIDER_DISALLOW_ALL(ValueInfoProtos)
374389
};
390+
391+
struct FunctionProto final {
392+
static std::unique_ptr<FunctionProto> Create() { return g_host->FunctionProto__construct(); }
393+
static void operator delete(void* p) { g_host->FunctionProto__operator_delete(reinterpret_cast<FunctionProto*>(p)); }
394+
395+
bool SerializeToString(std::string& string) const { return g_host->FunctionProto__SerializeToString(this, string); }
396+
bool SerializeToOstream(std::ostream& output) const { return g_host->FunctionProto__SerializeToOstream(this, output); }
397+
bool ParseFromString(const std::string& data) { return g_host->FunctionProto__ParseFromString(this, data); }
398+
std::string SerializeAsString() const { return g_host->FunctionProto__SerializeAsString(this); }
399+
400+
bool has_name() const { return g_host->FunctionProto__has_name(this); }
401+
const std::string& name() const { return g_host->FunctionProto__name(this); }
402+
void set_name(const std::string& name) { g_host->FunctionProto__set_name(this, name); }
403+
404+
bool has_doc_string() const { return g_host->FunctionProto__has_doc_string(this); }
405+
const std::string& doc_string() const { return g_host->FunctionProto__doc_string(this); }
406+
void set_doc_string(const std::string& doc_string) { g_host->FunctionProto__set_doc_string(this, doc_string); }
407+
408+
bool has_domain() const { return g_host->FunctionProto__has_domain(this); }
409+
const std::string& domain() const { return g_host->FunctionProto__domain(this); }
410+
void set_domain(const std::string& domain) { g_host->FunctionProto__set_domain(this, domain); }
411+
412+
const std::string& input(int index) const { return g_host->FunctionProto__input(this, index); }
413+
std::string* mutable_input(int index) { return g_host->FunctionProto__mutable_input(this, index); }
414+
int input_size() const { return g_host->FunctionProto__input_size(this); }
415+
void add_input(const std::string& value) { g_host->FunctionProto__add_input(this, value); }
416+
417+
const std::string& output(int index) const { return g_host->FunctionProto__output(this, index); }
418+
std::string* mutable_output(int index) { return g_host->FunctionProto__mutable_output(this, index); }
419+
int output_size() const { return g_host->FunctionProto__output_size(this); }
420+
void add_output(const std::string& value) { g_host->FunctionProto__add_output(this, value); }
421+
422+
const std::string& attribute(int index) const { return g_host->FunctionProto__attribute(this, index); }
423+
std::string* mutable_attribute(int index) { return g_host->FunctionProto__mutable_attribute(this, index); }
424+
int attribute_size() const { return g_host->FunctionProto__attribute_size(this); }
425+
void add_attribute(const std::string& value) { g_host->FunctionProto__add_attribute(this, value); }
426+
427+
const AttributeProto& attribute_proto(int index) const { return g_host->FunctionProto__attribute_proto(this, index); }
428+
AttributeProto* mutable_attribute_proto(int index) { return g_host->FunctionProto__mutable_attribute_proto(this, index); }
429+
int attribute_proto_size() const { return g_host->FunctionProto__attribute_proto_size(this); }
430+
AttributeProto* add_attribute_proto() { return g_host->FunctionProto__add_attribute_proto(this); }
431+
432+
const NodeProto& node(int index) const { return g_host->FunctionProto__node(this, index); }
433+
NodeProto* mutable_node(int index) { return g_host->FunctionProto__mutable_node(this, index); }
434+
int node_size() const { return g_host->FunctionProto__node_size(this); }
435+
NodeProto* add_node() { return g_host->FunctionProto__add_node(this); }
436+
437+
const ValueInfoProto& value_info(int index) const { return g_host->FunctionProto__value_info(this, index); }
438+
ValueInfoProtos* mutable_value_info() { return g_host->FunctionProto__mutable_value_info(this); }
439+
ValueInfoProto* mutable_value_info(int index) { return g_host->FunctionProto__mutable_value_info(this, index); }
440+
int value_info_size() const { return g_host->FunctionProto__value_info_size(this); }
441+
ValueInfoProto* add_value_info() { return g_host->FunctionProto__add_value_info(this); }
442+
443+
const StringStringEntryProto& metadata_props(int index) const { return g_host->FunctionProto__metadata_props(this, index); }
444+
StringStringEntryProtos* mutable_metadata_props() { return g_host->FunctionProto__mutable_metadata_props(this); }
445+
StringStringEntryProto* mutable_metadata_props(int index) { return g_host->FunctionProto__mutable_metadata_props(this, index); }
446+
int metadata_props_size() const { return g_host->FunctionProto__metadata_props_size(this); }
447+
StringStringEntryProto* add_metadata_props() { return g_host->FunctionProto__add_metadata_props(this); }
448+
449+
FunctionProto() = delete;
450+
FunctionProto(const FunctionProto&) = delete;
451+
void operator=(const FunctionProto&) = delete;
452+
};
375453
} // namespace ONNX_NAMESPACE
376454

377455
namespace onnxruntime {
@@ -449,6 +527,12 @@ struct IndexedSubGraph_MetaDef final {
449527
void operator=(const IndexedSubGraph_MetaDef&) = delete;
450528
};
451529

530+
enum class IndexedSubGraph_SourceOfSchema : uint8_t {
531+
CREATE,
532+
REUSE_OR_CREATE,
533+
EXISTING,
534+
};
535+
452536
struct IndexedSubGraph final {
453537
static std::unique_ptr<IndexedSubGraph> Create() { return g_host->IndexedSubGraph__construct(); }
454538
static void operator delete(void* p) { g_host->IndexedSubGraph__operator_delete(reinterpret_cast<IndexedSubGraph*>(p)); }
@@ -458,6 +542,9 @@ struct IndexedSubGraph final {
458542
void SetMetaDef(std::unique_ptr<IndexedSubGraph_MetaDef>&& meta_def_) { return g_host->IndexedSubGraph__SetMetaDef(this, std::move(*reinterpret_cast<std::unique_ptr<IndexedSubGraph_MetaDef>*>(&meta_def_))); }
459543
const IndexedSubGraph_MetaDef* GetMetaDef() const { return reinterpret_cast<const IndexedSubGraph_MetaDef*>(g_host->IndexedSubGraph__GetMetaDef(this)); }
460544

545+
void SetSchemaSource(IndexedSubGraph_SourceOfSchema schema_source) { return g_host->IndexedSubGraph__SetSchemaSource(this, schema_source); }
546+
IndexedSubGraph_SourceOfSchema GetSchemaSource() const { return g_host->IndexedSubGraph__GetSchemaSource(this); }
547+
461548
IndexedSubGraph() = delete;
462549
IndexedSubGraph(const IndexedSubGraph&) = delete;
463550
void operator=(const IndexedSubGraph&) = delete;

0 commit comments

Comments
 (0)