Skip to content

Move the scope of model proto to local#425

Closed
preetha-intel wants to merge 1 commit intoovep-develop-lnl-1.2from
optimize_model_proto
Closed

Move the scope of model proto to local#425
preetha-intel wants to merge 1 commit intoovep-develop-lnl-1.2from
optimize_model_proto

Conversation

@preetha-intel
Copy link

Description

Move the scope of model proto and clean it up from memory before OV read_model

// 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();

Choose a reason for hiding this comment

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

Model Proto changes look ok but should we keep string as constant as we want to delete it later ?

@preetha-intel
Copy link
Author

preetha-intel commented Aug 26, 2024 via email

{
const std::string model = model_proto.SerializeAsString();
const std::string model = model_proto->SerializeAsString();
auto model_proto_ptr = model_proto.release();

Choose a reason for hiding this comment

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

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);

Choose a reason for hiding this comment

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

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

@preetha-intel
Copy link
Author

Another PR with fix for dynamic backend is raised and merged.
#427
Closing as its duplicate.

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.

3 participants