Skip to content

Comparison of InputDescription and OutputDescription in SubGraph#4123

Merged
ilyachur merged 10 commits intoopenvinotoolkit:masterfrom
elszkowski:compare_function-compare_subgraph
Feb 25, 2021
Merged

Comparison of InputDescription and OutputDescription in SubGraph#4123
ilyachur merged 10 commits intoopenvinotoolkit:masterfrom
elszkowski:compare_function-compare_subgraph

Conversation

@elszkowski
Copy link
Copy Markdown

@elszkowski elszkowski commented Feb 1, 2021

Changes:

  • add comparison between ngraph::Functions [inputs, parameters] and [outputs, result] comparison -> subgraph::compare_io
  • add storage for ngraph::Function
  • drop SpecialBodyPorts from storage

Ticket 47693

@elszkowski elszkowski requested a review from itikhono February 1, 2021 15:00
Copy link
Copy Markdown
Contributor

@ilyachur ilyachur left a comment

Choose a reason for hiding this comment

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

This PR contains a lot of TODO marks. Can we implement these TODOs in this PR?


if (description->get_type_info() == SubGraphOp::ConcatOutputDescription::type_info) {
///
/// TODO shape calculation - required decent formula to check size from Slice
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.

we need to know the count of iterations (m_iterations member in Loop/TensorIterator) to calculate the output shape correctly.
I guess this check shouldn't be a part of this Checker, we already have similar checks in validate_and_infer_type function of Loop/TI. @ilyachur @GlebKazantaev what do you think?

@elszkowski elszkowski requested a review from sdurawa February 22, 2021 11:28
}
}

void verify_else(const std::string& name, ngraph::ValueAccessor<void>& adapter) {
Copy link
Copy Markdown
Contributor

@sdurawa sdurawa Feb 23, 2021

Choose a reason for hiding this comment

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

function name is confusing, it does not provide information of its purpose.

Copy link
Copy Markdown
Author

@elszkowski elszkowski Feb 23, 2021

Choose a reason for hiding this comment

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

It's not best name but for now I can't find any better.
verify_others will be fine?

} else if (lhs->get_type_info() == SubGraphOp::InvariantInputDescription::type_info) {
return true; // noting extra to check
}

Copy link
Copy Markdown
Contributor

@sdurawa sdurawa Feb 23, 2021

Choose a reason for hiding this comment

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

missing else{} statement for the exception handling, the same issue appears in other matching and equal methods.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I'm not sure if extra else is required. Exception will be throw with or without else.

m_num_iterations = ((std::abs(concat->m_end - concat->m_start)) / concat->m_part_size);
}
}
set_num_iteratrions_if_no_slice_inputs(); // TODO can be move to validate_and_infer_types
Copy link
Copy Markdown
Contributor

@sdurawa sdurawa Feb 23, 2021

Choose a reason for hiding this comment

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

why adding TODO instead moving it to validate_and_infer_types?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Because I want to discus this question in this review.

@jdanieck jdanieck removed their request for review February 24, 2021 12:36
@jdanieck
Copy link
Copy Markdown
Contributor

@ilyachur do you plan to merge this before CF or after ? I mean, can we expect new bugs discovered just before CF or not ;)

@ilyachur
Copy link
Copy Markdown
Contributor

@ilyachur do you plan to merge this before CF or after ? I mean, can we expect new bugs discovered just before CF or not ;)

I think it will be good to have the full picture. And if this PR will show new issues I think we should know about it.

Copy link
Copy Markdown
Contributor

@sdurawa sdurawa left a comment

Choose a reason for hiding this comment

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

LGTM, one thing which can improve readability of the PR are comments, at least descriptions for classes and methods (lots of them are not self explanatory, ie 'verify_others', 'compare').

@elszkowski
Copy link
Copy Markdown
Author

LGTM, one thing which can improve readability of the PR are comments, at least descriptions for classes and methods (lots of them are not self explanatory, ie 'verify_others', 'compare').

https://youtu.be/ZsHMHukIlJY?t=617
:)

@elszkowski
Copy link
Copy Markdown
Author

elszkowski commented Feb 25, 2021

@ilyachur, all green now.

@ilyachur ilyachur merged commit af71274 into openvinotoolkit:master Feb 25, 2021
@elszkowski elszkowski deleted the compare_function-compare_subgraph branch February 26, 2021 06:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants