-
Notifications
You must be signed in to change notification settings - Fork 2k
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]: ov::cache_dir mechanism is sensitive to the currently set LC_NUMERIC locale #24370
Comments
@RyanMetcalfeInt8 The cache blob can be exported and imported successfully but get incorrect inference result after we set |
Hi @riverlijunjie, Yes, I think your understanding is correct. Although in the reproducer code that I posted, I am not using explicit export / import APIs -- it uses cache directory mechanism (but yes, export / import happens 'under the hood' in this case I believe). |
This issue seems caused by the bug in the pugixml library used in OpenVINO. |
Agree with @zhaixuejun1993 , we have root cause this issue and we did observe that 1 byte was removed during exporting model cache if locale is "de_DE.utf8" comparing to "C". |
### Details: - Check the value of setlocale for export/import, if different with "C" will set to "C" and record the original value, after export/import done will reset to the original. - *Fix the error caused by pugixml library with The setlocale function installs the specified system locale or its portion as the new C locale. different C may return unexpected results with setlocal()* ### Tickets: - #24370 --------- Signed-off-by: Zhai, Xuejun <[email protected]> Co-authored-by: Chen Peter <[email protected]> Co-authored-by: River Li <[email protected]>
The verified message has been provided in PR, close this. |
OpenVINO Version
2024.1
Operating System
Windows System
Device used for inference
CPU
Framework
None
Model used
Whisper Encoder Base (https://huggingface.co/Intel/whisper.cpp-openvino-models/blob/main/ggml-base-models.zip)
Issue description
I've noticed that the OpenVINO caching mechanism is sensitive to the currently set LC_NUMERIC locale. This problem has revealed itself in applications that use OpenVINO, and also support multiple languages.
For example, in our set of AI Plugins for Audacity, there has been many users that have reported an issue that the AI features work the very first time that they are run, but then produce bad results afterward. Here is a good example: intel/openvino-plugins-ai-audacity#1
It took a while to figure out that the problem can easily be reproduced by explicitly setting other locales, and so I have attached a small reproducer that clearly illustrates the problem:
Step-by-step reproduction
Here is the source code to reproduce:
ov_cache_locale_test.zip
This test uses
ggml-base-encoder-openvino.xml/.bin
IR's (but note, the problem is reproduceable for many models). You can grab these IRs from this package on HF: https://huggingface.co/Intel/whisper.cpp-openvino-models/blob/main/ggml-base-models.zip. Copyggml-base-encoder-openvino.xml/.bin
tobuild/Release
folder.Run the compiled, main.exe:
Which illustrates the problem.
For the default locale ("C"), the model produces the same output for the first & second compile + run sequence, where in the first run the blob was created / cached, and the second it was used.
For the 'de_DE.utf8' locale, there is a mismatch.
Relevant log output
No response
Issue submission checklist
The text was updated successfully, but these errors were encountered: