Move the scope of model proto to local#425
Closed
preetha-intel wants to merge 1 commit intoovep-develop-lnl-1.2from
Closed
Move the scope of model proto to local#425preetha-intel wants to merge 1 commit intoovep-develop-lnl-1.2from
preetha-intel wants to merge 1 commit intoovep-develop-lnl-1.2from
Conversation
sfatimar
reviewed
Aug 26, 2024
| // Optimized OV compile_model API is supported with AUTO from version 2024.3 and above | ||
| // Inputs with static dimenstions | ||
| const std::string model = model_proto.SerializeAsString(); | ||
| const std::string model = model_proto->SerializeAsString(); |
There was a problem hiding this comment.
Model Proto changes look ok but should we keep string as constant as we want to delete it later ?
Author
|
The string is in local scope it gets automatically cleaned up after read_model()
The issue is OV accepts only const serialised model
________________________________
From: sfatimar ***@***.***>
Sent: Monday, August 26, 2024 6:04:15 PM
To: intel/onnxruntime ***@***.***>
Cc: Veeramalai, Preetha ***@***.***>; Author ***@***.***>
Subject: Re: [intel/onnxruntime] Move the scope of model proto to local (PR #425)
@sfatimar commented on this pull request.
________________________________
In onnxruntime/core/providers/openvino/backends/basic_backend.cc<#425 (comment)>:
@@ -103,7 +105,9 @@ BasicBackend::BasicBackend(const ONNX_NAMESPACE::ModelProto& model_proto,
(global_context_.OpenVINO_Version.at(0) >= 2024 && global_context_.OpenVINO_Version.at(1) > 2))) {
// Optimized OV compile_model API is supported with AUTO from version 2024.3 and above
// Inputs with static dimenstions
- const std::string model = model_proto.SerializeAsString();
+ const std::string model = model_proto->SerializeAsString();
Model Proto changes look ok but should we keep string as constant as we want to delete it later ?
—
Reply to this email directly, view it on GitHub<#425 (review)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AVCUTUDJKLFNKH4UUWBTRSDZTMOEPAVCNFSM6AAAAABND5LQKGVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDENRQGU3DSNJRGA>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
javier-intel
requested changes
Aug 26, 2024
| { | ||
| const std::string model = model_proto.SerializeAsString(); | ||
| const std::string model = model_proto->SerializeAsString(); | ||
| auto model_proto_ptr = model_proto.release(); |
There was a problem hiding this comment.
To avoid code bloat please leave this combined in one line
| i++; | ||
| } | ||
| subgraph_context_.subgraph_name = fused_node.Name(); | ||
| model_proto_ = GetModelProtoFromFusedNode(fused_node, subgraph, logger); |
There was a problem hiding this comment.
Please leave this line here and manage the result as needed. Replicating the call results in spaghetti code as it isn't clear why there are multiple calls. Here's the original code for reference https://github.com/intel-sandbox/jemartin-onnxruntime/commit/792523185d156550165eab34c92184b25bf09267
Author
|
Another PR with fix for dynamic backend is raised and merged. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Move the scope of model proto and clean it up from memory before OV read_model