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

Partial Value Optimization #27555

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jane-intel
Copy link
Contributor

Details:

  • Partial Value optimization was already capable of optimizing multiple value sources. This time we strive to reuse singular values in the construction of multi-values so that we minimize ShapeOf op number and minimize ShapeOf sub-graphs. Additionally, this time we prioritize static values over symbol for the case when value has both

Signed-off-by: Evgeniia Nugmanova <[email protected]>
@jane-intel jane-intel requested a review from a team as a code owner November 14, 2024 09:34
@jane-intel jane-intel requested review from itikhono and removed request for a team November 14, 2024 09:34
@github-actions github-actions bot added the category: transformations OpenVINO Runtime library - Transformations label Nov 14, 2024
Signed-off-by: Evgeniia Nugmanova <[email protected]>
@@ -316,16 +344,16 @@ std::vector<std::shared_ptr<ov::Node>> topological_order(const std::shared_ptr<o
}

void save_shape_sources(const std::shared_ptr<ov::Node>& op, STS_map& symbol_shape_source) {
if (ov::is_type<ov::op::v0::ShapeOf>(op) || ov::is_type<ov::op::v3::ShapeOf>(op)) {
const auto& output = op->input_value(0);
bool is_shape = ov::is_type<ov::op::v0::ShapeOf>(op) || ov::is_type<ov::op::v3::ShapeOf>(op);
Copy link
Contributor

Choose a reason for hiding this comment

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

Detail

Suggested change
bool is_shape = ov::is_type<ov::op::v0::ShapeOf>(op) || ov::is_type<ov::op::v3::ShapeOf>(op);
const auto is_shape_of = ov::is_type<ov::op::util::ShapeOfBase>(op);

?

if (ov::is_type<ov::op::v0::ShapeOf>(op) || ov::is_type<ov::op::v3::ShapeOf>(op)) {
const auto& output = op->input_value(0);
bool is_shape = ov::is_type<ov::op::v0::ShapeOf>(op) || ov::is_type<ov::op::v3::ShapeOf>(op);
bool is_parameter = ov::is_type<ov::op::v0::Parameter>(op);
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
bool is_parameter = ov::is_type<ov::op::v0::Parameter>(op);
const auto is_parameter = ov::is_type<ov::op::v0::Parameter>(op);

or

Suggested change
bool is_parameter = ov::is_type<ov::op::v0::Parameter>(op);
const auto is_parameter = ov::op::util::is_paramter(op);

?

STS_map& symbol_value_source) {
if (output.get_tensor().get_value_symbol().size() < 2)
return; // singular values are handled by optimize_single_value_usage helper
auto result = OutputValue::make(output);
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
auto result = OutputValue::make(output);
const auto result = OutputValue::make(output);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: transformations OpenVINO Runtime library - Transformations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants