Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IR] Changed RT Info nodes naming (compatible with an old) #25159

Merged
merged 9 commits into from
Jul 8, 2024

Conversation

gkrivor
Copy link
Contributor

@gkrivor gkrivor commented Jun 21, 2024

Details:

  • Fixed an xml serialization/deserialization in case name isn't xml-compatible

Tickets:

@github-actions github-actions bot added category: Core OpenVINO Core (aka ngraph) category: IR FE OpenVINO IR v10 / v11 FrontEnd category: MO Model Optimizer labels Jun 21, 2024
@gkrivor gkrivor marked this pull request as ready for review June 21, 2024 15:50
@gkrivor gkrivor requested review from a team as code owners June 21, 2024 15:50
@gkrivor gkrivor requested review from itikhono and removed request for a team June 21, 2024 15:50
tools/mo/openvino/tools/mo/utils/ir_engine/ir_engine.py Outdated Show resolved Hide resolved
src/frontends/ir/src/ir_deserializer.cpp Outdated Show resolved Hide resolved
src/frontends/ir/src/ir_deserializer.cpp Outdated Show resolved Hide resolved
src/frontends/ir/src/ir_deserializer.cpp Outdated Show resolved Hide resolved
Copy link
Contributor

@slyalin slyalin left a comment

Choose a reason for hiding this comment

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

Provide "forward" compatibility for newly generated IRs except cases when it violates XML rules.

@gkrivor gkrivor requested a review from a team as a code owner July 5, 2024 11:02
@gkrivor gkrivor force-pushed the core_xml_names branch 2 times, most recently from c0ea146 to 2cf4424 Compare July 5, 2024 12:15
@gkrivor gkrivor requested a review from slyalin July 8, 2024 05:32
gkrivor and others added 6 commits July 8, 2024 14:59
Comment on lines +889 to +896
if (name.length() == 0) {
return false;
}
if (!std::all_of(name.begin(), name.end(), [](const int c) {
return std::isalnum(c) || (c == '_') || (c == '-') || (c == '.');
})) {
return false;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if (name.length() == 0) {
return false;
}
if (!std::all_of(name.begin(), name.end(), [](const int c) {
return std::isalnum(c) || (c == '_') || (c == '-') || (c == '.');
})) {
return false;
}
if (!std::all_of(name.begin(), name.end(), [](const int c) {
return std::isalnum(c) || (c == '_') || (c == '-') || (c == '.');
})) {
return false;
}

For empty string std::all_of should return false also.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right, I just prefer explicit check :) I think I'll move it near name[0] access, just to prevent issues in case of reordering in the future. If this build fails - I'll apply, if ok - change as a separate pr

Copy link
Contributor

Choose a reason for hiding this comment

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

No, std::all_of for an empty sequence returns true.

@gkrivor gkrivor enabled auto-merge July 8, 2024 13:43
@gkrivor gkrivor added this pull request to the merge queue Jul 8, 2024
Merged via the queue into openvinotoolkit:master with commit 68b26d2 Jul 8, 2024
123 checks passed
@gkrivor gkrivor deleted the core_xml_names branch July 8, 2024 14:48
spran180 pushed a commit to spran180/openvino that referenced this pull request Jul 27, 2024
…oolkit#25159)

### Details:
- Fixed an xml serialization/deserialization in case name isn't
xml-compatible

### Tickets:
 - 131514

---------

Co-authored-by: Pawel Raasz <pawel.raasz@intel.com>
@Wovchena Wovchena linked an issue Sep 4, 2024 that may be closed by this pull request
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: IR FE OpenVINO IR v10 / v11 FrontEnd category: MO Model Optimizer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Good First Issue][Bug][Core]: set_rt_info() makes IR not readable
4 participants