Skip to content

Update the GraphProto for subgraphs when saving the Graph. #647

Merged
skottmckay merged 7 commits intomasterfrom
skottmckay/UpdateSubgraphsWhenSavingGraph
Oct 23, 2019
Merged

Update the GraphProto for subgraphs when saving the Graph. #647
skottmckay merged 7 commits intomasterfrom
skottmckay/UpdateSubgraphsWhenSavingGraph

Conversation

@skottmckay
Copy link
Contributor

This is required to produce a valid overall Graph if the Graph has been optimized. If the GraphProto attribute are not updated
a) the optimizations will be lost from any subgraphs
b) implicit inputs to the subgraphs may be broken by changes to nodes in the parent graph

…quired to produce a valid overall Graph if the Graph has been optimized.
@skottmckay skottmckay requested a review from a team as a code owner March 18, 2019 09:38
@skottmckay skottmckay requested a review from kkaranasos May 25, 2019 03:12
if (update_subgraphs && attribute.second.has_g()) {
// partitioning or optimization may have changed the subgraph, so the original GraphProto may not be valid.
// call ToGraphProto to get the current info and use this for the attribute
const auto& latest = attr_to_subgraph_map_.find(attribute.first)->second->ToGraphProto();
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we know when the subgraph proto needs re-building, so that we avoid it otherwise?

Copy link
Contributor Author

@skottmckay skottmckay Jul 29, 2019

Choose a reason for hiding this comment

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

ToGraphProto only rebuilds if it has to. If there have been no changes it will return the currrent GraphProto instead of creating a new one.

@yuslepukhin yuslepukhin closed this Aug 6, 2019
@yuslepukhin yuslepukhin deleted the skottmckay/UpdateSubgraphsWhenSavingGraph branch August 6, 2019 17:03
@yuslepukhin yuslepukhin restored the skottmckay/UpdateSubgraphsWhenSavingGraph branch August 6, 2019 17:14
@yuslepukhin yuslepukhin reopened this Aug 6, 2019
Copy link
Contributor

@ke1337 ke1337 left a comment

Choose a reason for hiding this comment

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

:shipit:

@skottmckay skottmckay merged commit 41d55ea into master Oct 23, 2019
@skottmckay skottmckay deleted the skottmckay/UpdateSubgraphsWhenSavingGraph branch October 24, 2019 20:33
jnagi-intel pushed a commit to jnagi-intel/onnxruntime that referenced this pull request Jan 5, 2026
* Fix the LUID check

* Address review comments
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.

6 participants