Skip to content

Conversation

fcmiron
Copy link
Contributor

@fcmiron fcmiron commented Sep 4, 2025

Details:

  • Protopipe throws exception if I64 is specified as input precision type in config file
  • OpenCV 4.x which is used by protopipe does not support INT64. As a workaround we use INT32 instead of INT64

Tickets:

@fcmiron fcmiron requested review from a team as code owners September 4, 2025 07:46
@github-actions github-actions bot added the category: NPU OpenVINO NPU plugin label Sep 4, 2025
Copy link
Contributor

@SeptimiuIoachimNeagaIntel SeptimiuIoachimNeagaIntel left a comment

Choose a reason for hiding this comment

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

I can't see where you actually convert from int64 to int32. Neither can I see for the output where you convert from int32 to int64. Please do a test with a int64 model with int64 precision where you check that you get the same output for the same input as benchmark app or singleimagetest.

// workaround for I64 input type precision
if (mat.elemSize() == sizeof(int32_t) && file_byte_size == mat_byte_size * 2) {
std::size_t elem_size = mat.elemSize();
for (std::size_t i = 0; i < mat_byte_size; i += elem_size) {
Copy link
Contributor

@SeptimiuIoachimNeagaIntel SeptimiuIoachimNeagaIntel Sep 4, 2025

Choose a reason for hiding this comment

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

I can't see where you actually convert from int64 to int32. Neither can I see for the output where you convert from int32 to int64. Please do a test with a int64 model with int64 precision where you check that you get the same output for the same input as benchmark app or singleimagetest.

Copy link
Contributor Author

@fcmiron fcmiron Sep 4, 2025

Choose a reason for hiding this comment

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

The conversion is made here, when reading from the file, it reads lower 4 bytes from each 8 byte value
ifs.read(mat.ptr<char>() + i, elem_size); ifs.seekg(elem_size, std::ios::cur);

Copy link
Contributor

Choose a reason for hiding this comment

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

C++ has functions to make the conversion from int64 to int32 explicit. Also trucking the upper half is not a common way for a conversion. Still I don't see the reverse conversion when saving the output.

Copy link
Contributor

@SeptimiuIoachimNeagaIntel SeptimiuIoachimNeagaIntel left a comment

Choose a reason for hiding this comment

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

Output for i64 was not implemented as it was not request. When requested we might implement also output precision for i64

@fcmiron fcmiron added this pull request to the merge queue Sep 7, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 7, 2025
@fcmiron fcmiron added this pull request to the merge queue Sep 8, 2025
Merged via the queue into openvinotoolkit:master with commit 8625f31 Sep 8, 2025
177 checks passed
@fcmiron fcmiron deleted the add_support_for_i64 branch September 8, 2025 08:55
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.

2 participants