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

[TRANSFORMATIONS] Remove usages of legacy names in transformations #26855

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -62,37 +62,6 @@ inline bool has_decompression_converts(const std::shared_ptr<const ov::Model>& f
return false;
}

OPENVINO_DEPRECATED("Plugins should use ov::ISyncInferRequest::find_port")
inline std::string create_ie_output_name(const Output<const Node>& output) {
const auto& prev_layer = output.get_node_shared_ptr();
auto out_name = prev_layer->get_friendly_name();
if (prev_layer->get_output_size() != 1) {
out_name += "." + std::to_string(output.get_index());
}
return out_name;
}

OPENVINO_DEPRECATED("Plugins should use ov::ISyncInferRequest::find_port")
inline std::string create_ie_output_name(const Output<Node>& output) {
OPENVINO_SUPPRESS_DEPRECATED_START
return create_ie_output_name(ov::Output<const Node>(output.get_node(), output.get_index()));
OPENVINO_SUPPRESS_DEPRECATED_END
}

OPENVINO_DEPRECATED("Plugins should use ov::ISyncInferRequest::find_port")
inline std::string get_ie_output_name(const Output<const Node>& output) {
OPENVINO_SUPPRESS_DEPRECATED_START
return create_ie_output_name(output);
OPENVINO_SUPPRESS_DEPRECATED_END
}

OPENVINO_DEPRECATED("Plugins should use ov::ISyncInferRequest::find_port")
inline std::string get_ie_output_name(const Output<Node>& output) {
OPENVINO_SUPPRESS_DEPRECATED_START
return get_ie_output_name(ov::Output<const Node>(output.get_node(), output.get_index()));
OPENVINO_SUPPRESS_DEPRECATED_END
}

/**
* \brief Convert epsilon value from double to float type.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,6 @@ ov::pass::ConvertMaxPool8ToMaxPool1::ConvertMaxPool8ToMaxPool1() {
maxpool_v8_node->get_rounding_type(),
maxpool_v8_node->get_auto_pad());

OPENVINO_SUPPRESS_DEPRECATED_START
auto out_name = ov::op::util::create_ie_output_name(maxpool_v8_node->output(0));
OPENVINO_SUPPRESS_DEPRECATED_END

maxpool_v1_node->set_friendly_name(maxpool_v8_node->get_friendly_name());
maxpool_v8_node->output(0).replace(maxpool_v1_node->output(0));
ov::copy_runtime_info(maxpool_v8_node, maxpool_v1_node);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,18 +109,20 @@ ov::pass::ConvertNMS9ToNMSIEInternal::ConvertNMS9ToNMSIEInternal() {
Output<Node> output_0 = nms_legacy->output(0);
if (nms_9->output(0).get_element_type() != output_0.get_element_type()) {
output_0 = std::make_shared<ov::op::v0::Convert>(output_0, nms_9->output(0).get_element_type());
OPENVINO_SUPPRESS_DEPRECATED_START
output_0.get_node_shared_ptr()->set_friendly_name(op::util::create_ie_output_name(nms_9->output(0)));
OPENVINO_SUPPRESS_DEPRECATED_END
output_0.get_node_shared_ptr()->set_friendly_name(
Copy link
Contributor

Choose a reason for hiding this comment

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

Do these friendly names still need to be set?

nms_9->output(0).get_node_shared_ptr()->get_friendly_name() +
std::string(nms_9->output(0).get_node_shared_ptr()->get_output_size() != 1 ? "." : "") +
std::to_string(output_0.get_index()));
new_ops.emplace_back(output_0.get_node_shared_ptr());
}

Output<Node> output_2 = nms_legacy->output(2);
if (nms_9->output(2).get_element_type() != output_2.get_element_type()) {
output_2 = std::make_shared<ov::op::v0::Convert>(output_2, nms_9->output(2).get_element_type());
OPENVINO_SUPPRESS_DEPRECATED_START
output_2.get_node_shared_ptr()->set_friendly_name(op::util::create_ie_output_name(nms_9->output(2)));
OPENVINO_SUPPRESS_DEPRECATED_END
output_2.get_node_shared_ptr()->set_friendly_name(
nms_9->output(2).get_node_shared_ptr()->get_friendly_name() +
std::string(nms_9->output(2).get_node_shared_ptr()->get_output_size() != 1 ? "." : "") +
std::to_string(output_2.get_index()));
new_ops.emplace_back(output_2.get_node_shared_ptr());
}

Expand Down
8 changes: 5 additions & 3 deletions src/inference/src/dev/icompiled_model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,11 @@ ov::ICompiledModel::ICompiledModel(const std::shared_ptr<const ov::Model>& model
for (const auto& result : model->get_results()) {
auto fake_param = std::make_shared<ov::op::v0::Parameter>(result->get_output_element_type(0),
result->get_output_partial_shape(0));
OPENVINO_SUPPRESS_DEPRECATED_START
const std::string res_name = ov::op::util::create_ie_output_name(result->input_value(0));
OPENVINO_SUPPRESS_DEPRECATED_END
auto prev_layer = result->input_value(0).get_node_shared_ptr();
const std::string res_name = prev_layer->get_friendly_name() +
std::string(prev_layer->get_output_size() != 1 ? "." : "") +
std::to_string(result->input_value(0).get_index());

fake_param->set_friendly_name(res_name);
fake_param->set_element_type(result->get_element_type());
fake_param->validate_and_infer_types();
Expand Down
9 changes: 4 additions & 5 deletions src/inference/src/model_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,10 @@ void update_v10_model(std::shared_ptr<ov::Model>& model, bool frontendMode = fal
// we need to add operation names as tensor names for inputs and outputs
{
for (const auto& result : model->get_results()) {
OPENVINO_SUPPRESS_DEPRECATED_START
// Note, upon removal of 'create_ie_output_name', just move it to this file as a local function
// we still need to add operation names as tensor names for outputs for IR v10
auto res_name = ov::op::util::create_ie_output_name(result->input_value(0));
OPENVINO_SUPPRESS_DEPRECATED_END
auto prev_layer = result->input_value(0).get_node_shared_ptr();
const std::string res_name = prev_layer->get_friendly_name() +
std::string(prev_layer->get_output_size() != 1 ? "." : "") +
std::to_string(result->input_value(0).get_index());
OPENVINO_ASSERT(leaf_names.find(res_name) == leaf_names.end() ||
result->output(0).get_names().find(res_name) != result->output(0).get_names().end(),
"Model operation names have collisions with tensor names.",
Expand Down
Loading