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

Use get_partial_shape to get dynamic shape #26907

Merged

Conversation

ArtemySkrebkov
Copy link
Contributor

Details:

  • In the case of dynamic shapes, we need to call get_partial_shape, because get_shape will throw if called on dynamic shape

Tickets:

  • E88902

@ArtemySkrebkov ArtemySkrebkov requested review from a team as code owners October 3, 2024 18:16
@github-actions github-actions bot added the category: NPU OpenVINO NPU plugin label Oct 3, 2024
@ArtemySkrebkov
Copy link
Contributor Author

@PatrikStepan @pereanub @XinWangIntel

can you please have a look?

Copy link
Contributor

@DariaMityagina DariaMityagina left a comment

Choose a reason for hiding this comment

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

Thanks for the fix 👍

@@ -278,7 +277,7 @@ std::string LevelZeroCompilerInDriver<TableExtension>::serializeIOInfo(const std

for (const std::shared_ptr<ov::op::v0::Parameter>& parameter : parameters) {
const ov::element::Type& precision = parameter->get_element_type();
const size_t rank = parameter->get_shape().size();
const size_t rank = parameter->get_partial_shape().size();
Copy link
Contributor

Choose a reason for hiding this comment

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

rank can also be dynamic

Copy link
Contributor

Choose a reason for hiding this comment

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

@ArtemySkrebkov, do we need a throw for such cases? I'm pretty sure that we don't support this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, we do not support dynamic rank.

Added a throw for this case.

Previously, I thought to rely on PartialShape::size to throw (there is an assert for dynamic rank), but having a more precise error message sounds good to me too.

@ArtemySkrebkov ArtemySkrebkov added this pull request to the merge queue Oct 8, 2024
Merged via the queue into openvinotoolkit:master with commit 0882ff6 Oct 8, 2024
130 checks passed
@ArtemySkrebkov ArtemySkrebkov deleted the use-partial-shape-npu branch October 8, 2024 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: NPU OpenVINO NPU plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants