Enable ResolveNamesCollisions transformation in MOC #2#18772
Merged
itikhono merged 11 commits intoopenvinotoolkit:masterfrom Jul 29, 2023
Merged
Enable ResolveNamesCollisions transformation in MOC #2#18772itikhono merged 11 commits intoopenvinotoolkit:masterfrom
itikhono merged 11 commits intoopenvinotoolkit:masterfrom
Conversation
…mations/make_unique_names
…mations/make_unique_names
…mations/make_unique_names
…mations/make_unique_names
…github.com/itikhono/openvino into itikhono/transformations/make_unique_names
t-jankowski
approved these changes
Jul 25, 2023
evkotov
approved these changes
Jul 26, 2023
| RUN_ON_MODEL_SCOPE(AlignMixedFP32FP16Types); | ||
| std::unordered_set<std::string> new_friendly_names; | ||
|
|
||
| auto generate_uniq_name = [&new_friendly_names](const std::string& initial_name) { |
Contributor
There was a problem hiding this comment.
I am just curious. Why we call set_friendly_name() instead of using default generated name?
Contributor
Author
There was a problem hiding this comment.
I think it was done to increase readability.
| int64_t cnt = 2; | ||
| for (const auto& op : same_named_ops) { | ||
| // check if op has OV autogenerated friendly name. unique and friendly names have to be equal. | ||
| bool is_autogenerated = op->m_friendly_name.empty(); |
Contributor
There was a problem hiding this comment.
I am just curious. Could automaticaly generated node names be not unique? We don't proceed here nodes with set through set_friendly_name()
Contributor
Author
There was a problem hiding this comment.
if the original model already contains "OpType_idx" (e.g. Constant_3, Add_2 etc) names, these names may potentially conflict with the autogenerated names. We have to change autogenerated names in such situations.
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.
Details:
ResolveNamesCollisions resolves friendly_name collisions in the graph by adding "_counter" suffix to the automatically generated friendly_names. If 'friendly_name' was set via set_friendly_name method and differs from unique_name of this Node, it will remain the same.
NEW ! Fixed EliminateGatherUnsqueeze and AlignMixedFP32FP16Types transformations
ResolveNamesCollisions transformation refactoring
Enabled ResolveNamesCollisions in MOC and Frontends
Updated unit tests
Tickets: