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

[Bug]: The prediction results using the PaddleOCR model are inconsistent between CPU and GPU inference in version 2024.04. #27532

Closed
3 tasks done
Algabeno opened this issue Nov 13, 2024 · 6 comments
Assignees
Labels
bug Something isn't working category: GPU OpenVINO GPU plugin support_request

Comments

@Algabeno
Copy link

Algabeno commented Nov 13, 2024

OpenVINO Version

2024.04

Operating System

Windows System

Device used for inference

CPU

Framework

ONNX

Model used

PadleOCR

Issue description

When using the 2024.04 version of the C++ OpenVINO framework for image inference, I found that the results vary significantly between CPU and Intel GPU. Additionally, I observed that different Intel GPUs produce different results, while the CPU results remain consistent.

model use

inference.zip

Step-by-step reproduction

Due to confidentiality requirements, I am unable to provide my code. However, I found that when I switch between CPU and GPU, the results are inconsistent.

compiled_model_ = core_.compile_model(model, "GPU", compile_options);

use intel GPU Intel® Iris® Xe Graphics eligible
企业微信截图_17314069478227
use intel GPU Intel@ UHD Graphics for 10th Gen Intel@ Processors
851a53e5ac5d2da4d8f2107a3dfa655

use intel CPU
a2357bee9754a83b44119c37cd7d982

Relevant log output

No response

Issue submission checklist

  • I'm reporting an issue. It's not a question.
  • I checked the problem with the documentation, FAQ, open issues, Stack Overflow, etc., and have not found a solution.
  • There is reproducer code and related data files such as images, videos, models, etc.
@Algabeno Algabeno added bug Something isn't working support_request labels Nov 13, 2024
@andrei-kochin andrei-kochin added the category: GPU OpenVINO GPU plugin label Nov 13, 2024
@vladimir-paramuzov
Copy link
Contributor

@Algabeno Could you try to run GPU with f32 precision? You need to add ov::hint::inference_precision(ov::element::f32) to model compile options. Note that GPU by default uses f16 precision, so maybe that causes difference between GPU and CPU inference results if model is sensitive to the precision of intermediate tensors

@Algabeno
Copy link
Author

@Algabeno Could you try to run GPU with f32 precision? You need to add ov::hint::inference_precision(ov::element::f32) to model compile options. Note that GPU by default uses f16 precision, so maybe that causes difference between GPU and CPU inference results if model is sensitive to the precision of intermediate tensors

Thank you very much for your response. This issue has been successfully resolved.

@vladimir-paramuzov
Copy link
Contributor

@Algabeno FYI, we have an ongoing work on activations scaling feature (#27265) which may help to improve accuracy with fp16 inference precision in some cases. Might be useful if fp32 latency is not good enough.

@Algabeno
Copy link
Author

@Algabeno FYI, we have an ongoing work on activations scaling feature (#27265) which may help to improve accuracy with fp16 inference precision in some cases. Might be useful if fp32 latency is not good enough.

Great! I was just troubled by the fact that using FP32 makes the model's inference speed several times slower than FP16. I'll give this a try.

@Algabeno Algabeno reopened this Nov 20, 2024
@Algabeno
Copy link
Author

Algabeno commented Nov 20, 2024

@Algabeno FYI, we have an ongoing work on activations scaling feature (#27265) which may help to improve accuracy with fp16 inference precision in some cases. Might be useful if fp32 latency is not good enough.

Hello, how can I use the code from (#27265)? I tried compiling the code from https://github.com/e-ddykim/openvino/tree/static_scaling, but I encountered errors during the compilation:

Error:

C:\Users\Administrator\Desktop\openvino\src\core\include\openvino\op\asinh.hpp(16,41): error C2504: “UnaryElementwiseArithmetic”: base class undefined [C:\Users\Administrator\Desktop\openvino\build\src\common\transformations\openvino_transformations_obj.vcxproj]

@vladimir-paramuzov
Copy link
Contributor

@Algabeno The error doesn't seem to be related to the changes on the branch. Does the build work for ov master in your environment? If no, please check the documentation page here https://github.com/openvinotoolkit/openvino/blob/master/docs/dev/build.md

@e-ddykim FYI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working category: GPU OpenVINO GPU plugin support_request
Projects
None yet
Development

No branches or pull requests

4 participants