Skip to content

Enable ResolveNamesCollisions transformation in MOC #2#18772

Merged
itikhono merged 11 commits intoopenvinotoolkit:masterfrom
itikhono:itikhono/transformations/make_unique_names
Jul 29, 2023
Merged

Enable ResolveNamesCollisions transformation in MOC #2#18772
itikhono merged 11 commits intoopenvinotoolkit:masterfrom
itikhono:itikhono/transformations/make_unique_names

Conversation

@itikhono
Copy link
Copy Markdown
Contributor

@itikhono itikhono commented Jul 25, 2023

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:

  • 103543, 113761

@itikhono itikhono requested review from a team as code owners July 25, 2023 09:59
@itikhono itikhono requested a review from eaidova July 25, 2023 09:59
@github-actions github-actions bot added category: Core OpenVINO Core (aka ngraph) category: transformations OpenVINO Runtime library - Transformations category: IR FE OpenVINO IR v10 / v11 FrontEnd category: ONNX FE OpenVINO ONNX FrontEnd category: PDPD FE OpenVINO PaddlePaddle FrontEnd category: TF FE OpenVINO TensorFlow FrontEnd category: CPP API OpenVINO CPP API bindings category: PyTorch FE OpenVINO PyTorch Frontend category: TFL FE OpenVINO TensorFlow Lite FrontEnd labels Jul 25, 2023
@itikhono itikhono requested review from evkotov and t-jankowski July 25, 2023 09:59
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) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I am just curious. Why we call set_friendly_name() instead of using default generated name?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I am just curious. Could automaticaly generated node names be not unique? We don't proceed here nodes with set through set_friendly_name()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: Core OpenVINO Core (aka ngraph) category: CPP API OpenVINO CPP API bindings category: IR FE OpenVINO IR v10 / v11 FrontEnd category: ONNX FE OpenVINO ONNX FrontEnd category: PDPD FE OpenVINO PaddlePaddle FrontEnd category: PyTorch FE OpenVINO PyTorch Frontend category: TF FE OpenVINO TensorFlow FrontEnd category: TFL FE OpenVINO TensorFlow Lite FrontEnd category: transformations OpenVINO Runtime library - Transformations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants