-
Notifications
You must be signed in to change notification settings - Fork 26.3k
[Bugfix] UnicodeDecodeError: 'utf-8' codec can't decode byte #139062
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
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/139062
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit d8432de with merge base b9618c9 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
I'd like to accept this but I can't tell what the old code was trying to do |
Thank you for your reply. What do I need to do? |
This function is called to create the JSON for perfetto/chrome tracer. If it sees that the user is trying to export to a .gz file, it creates a temporary file, exports the data to it using the autograd export_chrome_trace function, and then does compressed writes to the desired .gz file. I think in this case it makes the most sense to write in binary mode instead of text |
|
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Merge failedReason: 1 mandatory check(s) failed. The first few are: Dig deeper by viewing the failures on hud |
|
@pytorchbot merge -r |
|
@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here |
|
Successfully rebased |
482a966 to
d8432de
Compare
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
…#139062) Fixes pytorch#113564 When I used PyTorch's profiler to analyze the performance of vLLM, I encountered the following error. This error is similar to pytorch#113564. After analysis and troubleshooting, I changed the temporary file from text mode to binary mode, and it no longer reported an error and ran normally. ```bash ERROR 10-28 10:25:50 engine.py:160] File "/usr/local/lib/python3.12/dist-packages/torch/profiler/profiler.py", line 722, in stop ERROR 10-28 10:25:50 engine.py:160] self._transit_action(self.current_action, None) ERROR 10-28 10:25:50 engine.py:160] File "/usr/local/lib/python3.12/dist-packages/torch/profiler/profiler.py", line 751, in _transit_action ERROR 10-28 10:25:50 engine.py:160] action() ERROR 10-28 10:25:50 engine.py:160] File "/usr/local/lib/python3.12/dist-packages/torch/profiler/profiler.py", line 745, in _trace_ready ERROR 10-28 10:25:50 engine.py:160] self.on_trace_ready(self) ERROR 10-28 10:25:50 engine.py:160] File "/usr/local/lib/python3.12/dist-packages/torch/profiler/profiler.py", line 444, in handler_fn ERROR 10-28 10:25:50 engine.py:160] prof.export_chrome_trace(os.path.join(dir_name, file_name)) ERROR 10-28 10:25:50 engine.py:160] File "/usr/local/lib/python3.12/dist-packages/torch/profiler/profiler.py", line 220, in export_chrome_trace ERROR 10-28 10:25:50 engine.py:160] fout.writelines(fin) ERROR 10-28 10:25:50 engine.py:160] File "<frozen codecs>", line 322, in decode ERROR 10-28 10:25:50 engine.py:160] UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8e in position 5896: invalid start byte ``` Pull Request resolved: pytorch#139062 Approved by: https://github.com/ezyang
|
thanks for fixing this bug! @Abatom. Do you know when it will be released? |
sorry I don't know |
|
Also encountering this bug, will this fix be included in a release soon? |
Fixes #113564
When I used PyTorch's profiler to analyze the performance of vLLM, I encountered the following error. This error is similar to #113564. After analysis and troubleshooting, I changed the temporary file from text mode to binary mode, and it no longer reported an error and ran normally.