-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Custom Build Python Backend Locale Error #5321
Custom Build Python Backend Locale Error #5321
Comments
same problem |
Linking a couple relevant threads, maybe some upstream issue such as NVRTC is changing the locale as a part of the python backend stub build dependencies?
@Tabrizian I don't directly see NVRTC used in the build, but I figured you'd be more familiar @s402621342 @lajiyuan as a WAR in the meantime, can you set the encoding on the function call? ex:
or maybe
I tried playing with this locally in a python environment and found some similar behavior when setting locale to C/POSIX, no Triton components included at all:
Even if the locale was being changed during the build, I'm not sure why it would only change after copying your build artifact ( |
Thank you for replying @rmccorm4 I have tried
or
both would work, but I have a lot of python model providing by different person running on the triton server , so I don't think it's a goods idea to check every model and add such code Python backend require the custom build triton_python_backend_stub to place like this
That's the reason why after ( By the way, I have tried building custom python backend on r21.12, and it would not have the same problem, I'm not sure what change between r21.12 and r22.12 cause the difference. I found the problem when I tried to upgrade the triton server from r21.12 to r22.12 to use the new feature, and when trying to build the triton server, the same problem would happen. The build script like this
But the python backend on the nvcr.io/nvidia/tritonserver:22.12-py3 do not have the same problem I also tried build r22.07 after and not have the same problem, maybe the change is between r22.07 and r22.12 |
I was able to reproduce this issue locally. The strange thing is that the environment variable is propagated to the Python model so I'm not sure what is the issue here. We are not using |
Sure, filed DLIS-4568 @Tabrizian |
it was able to reproduce in 23.02 too. |
@nnshah1 Has a fix for this here: triton-inference-server/python_backend#260 Looks like it is due to a bug in pybind11. |
Description
I custom build a python backend, but when using the open function to open a file, the encoding is set to ascii while the LC_ALL is C.UTF-8,and i try to print(_locale.nl_langinfo(_locale.CODESET)), it returns ANSI_X3.4-1968, but when i directly use python3 and print , it returns UTF-8
Triton Information
What version of Triton are you using?
r22.12
Are you using the Triton container or did you build it yourself?
using the Triton container , but when i build it myself, i face the same problem
To Reproduce
Steps to reproduce the behavior.
before cp triton_python_backend_stub, it returns UTF-8 ,but when i change the triton_python_backend_stub it returns ANSI_X3.4-1968
the sample model.py is
Describe the models (framework, inputs, outputs), ideally include the model configuration file (if using an ensemble include the model configuration file for that as well).
Expected behavior
A clear and concise description of what you expected to happen.
open function can use the LC_ALL config , and opening file with UTF-8
The text was updated successfully, but these errors were encountered: