Skip to content

EISW-204125 [OV EP] Update DumpOpenVINOEPModel to handle initializer data#960

Merged
MayureshV1 merged 1 commit intointel:ovep-developfrom
intbf:ext_init_fix_graph_dumps
Mar 6, 2026
Merged

EISW-204125 [OV EP] Update DumpOpenVINOEPModel to handle initializer data#960
MayureshV1 merged 1 commit intointel:ovep-developfrom
intbf:ext_init_fix_graph_dumps

Conversation

@intbf
Copy link

@intbf intbf commented Mar 6, 2026

Expanded DumpOpenVINOEPModel to accept subgraph, logger, and initializer_data_in_proto flag. Now reconstructs and dumps a self-contained ONNX model when initializer data is omitted, ensuring standalone reloadability. Updated all call sites to pass new parameters.

Related to: https://jira.devtools.intel.com/browse/EISW-204125

Note: only impacts non-release builds.

Expanded DumpOpenVINOEPModel to accept subgraph, logger, and initializer_data_in_proto flag. Now reconstructs and dumps a self-contained ONNX model when initializer data is omitted, ensuring standalone reloadability. Updated all call sites to pass new parameters.
Copy link

@sfatimar sfatimar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates OpenVINO EP’s debug model dump helper to support cases where initializer data is intentionally omitted from the serialized ModelProto, enabling a reloadable debug .onnx dump.

Changes:

  • Extends DumpOpenVINOEPModel to accept subgraph, logger, and an initializer_data_in_proto flag.
  • When initializer data is omitted (in-memory external data refs), reconstructs a dump-only model proto with initializer data included.
  • Updates all call sites in GetModelProtoFromFusedNode to pass the new parameters/flag.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

std::fstream dump(model_name, std::ios::out | std::ios::trunc | std::ios::binary);
model_proto->SerializeToOstream(dump);
// When initializer data was omitted from the proto (ORT_MEM_ADDR references), build a
// self-contained proto for the dump so the saved .onnx file can be reloaded standalone.
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment says the dump is "self-contained" and can be "reloaded standalone", but this path only guarantees removing in-memory ORT_MEM_ADDR external-data references. If the original model uses file-based external initializers (data_location=EXTERNAL), the dumped model may still depend on external files. Consider clarifying the comment (or explicitly inlining file-based external initializer data if true standalone reloadability is required).

Suggested change
// self-contained proto for the dump so the saved .onnx file can be reloaded standalone.
// proto for the dump that inlines those initializers so the saved .onnx file does not
// depend on ORT_MEM_ADDR indirections. Note: models that use file-based external
// initializers (data_location=EXTERNAL) may still depend on external files.

Copilot uses AI. Check for mistakes.
Copy link

@MayureshV1 MayureshV1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good !

@MayureshV1
Copy link

Change does not impact release builds.

@MayureshV1 MayureshV1 merged commit 3882d68 into intel:ovep-develop Mar 6, 2026
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants