kai
July 19, 2023, 7:26am
2
Hi @PDDhillon and thanks for the issue.
This was a bug that has been fixed on master. The fix will be included in the upcoming Ray 2.6.0 release. Until then you can install the latest nightly wheels or patch the tune controller yourself to avoid the issue.
The relevant section is here:
ray-project:master
← krfricke:tune/fix-win
opened 10:03AM - 25 May 23 UTC
## Why are these changes needed?
When tune runs in a windows session with leg… acy encoding (e.g. cp-1252), the characters in the new output will result in an encoding error:
```
File "c:\install\ray\python\ray\tune\experimental\output.py", line 700, in experiment_started
print(
File "C:\Miniconda3\lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode characters in position 0-72: character maps to <undefined>
```
This PR detects a non-utf encoding and reverts to ascii characters which are fully compatible with windows. This is equivalent to the old Tune output format:
```
+------------------------------+----------+-------+
| Trial name | status | loc |
|------------------------------+----------+-------|
| LightningTrainer_47320_00000 | PENDING | |
+------------------------------+----------+-------+
```
The PR also adds a small fix in tune controller that came up when debugging this issue on windows.
To reproduce the original issue, use:
```
set PYTHONIOENCODING=windows-1252
set PYTHONLEGACYWINDOWSSTDIO=windows-1252
```
## Related issue number
## Checks
- [ ] I've signed off every commit(by using the -s flag, i.e., `git commit -s`) in this PR.
- [ ] I've run `scripts/format.sh` to lint the changes in this PR.
- [ ] I've included any doc changes needed for https://docs.ray.io/en/master/.
- [ ] I've added any new APIs to the API Reference. For example, if I added a
method in Tune, I've added it in `doc/source/tune/api/` under the
corresponding `.rst` file.
- [ ] I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
- Testing Strategy
- [ ] Unit tests
- [ ] Release tests
- [ ] This PR is not tested :(
1 Like