Repository navigation
Make the tests and data tools work on Windows, and run CI there - #71
Merged
Merged
Conversation
open(), read_text() and write_text() fell back to the locale encoding, which is cp1252 on Windows, so reading a UTF-8 file or collecting tests/test_benchmarks.py failed there. Text I/O now names its encoding and writes \n line endings, so the files a run produces are the same on every OS. Binary I/O is unchanged. Not touched yet: exealm/train/pretrain.py, grpo.py and sft.py, which open pull requests are editing.
test_decontam rewrote tokens.bin while a memory map of it was still open, which Windows refuses with Errno 22. It now copies the tokens and releases the map first. The harness and auto-eval fixtures put the datasets cache inside the pytest temp directory; the lock file name repeats that whole path and went past the 260 character limit (WinError 206). They now use a short cache directory from a shared fixture.
The data walkthrough passes data/raw/*.jsonl.gz to quality, dedup, tokenizer and pack, and relies on the shell to expand it. PowerShell and cmd do not, so those four tools now expand patterns themselves. exealm.chat switches stdin and stdout to UTF-8, because model output can contain characters the Windows console code page cannot encode.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I'm on Windows, and the test suite didn't run for me. Plain
pytestcrashed while collecting tests, and withPYTHONUTF8=1five tests still failed. This PR fixes both and adds a Windows job to CI so it stays fixed.What was broken
tests/test_benchmarks.pywas the one that broke collection.test_decontamrewrotetokens.binwhile a memory map of it was still open. Windows doesn't allow that (Errno 22).test_harnessand bothtest_auto_evaltests put the datasets cache inside the pytest temp folder. The cache's lock file name repeats that path and went past the 260-character limit (WinError 206).data/raw/*.jsonl.gz. PowerShell and cmd don't.What changed
\nline endings. Binary reads and writes are unchanged.test_decontamcopies the tokens and closes the map before writing. The harness and auto-eval tests get a short cache folder from a new fixture intests/conftest.py. No test was skipped or loosened.quality,dedup,tokenizerandpackexpand file patterns themselves (exealm/data/files.py, with 2 tests).exealm.chatprints UTF-8.pytest-windowsjob in.github/workflows/tests.ymlruns the same steps as the Ubuntu job. The README and CONTRIBUTING have a short Windows note.How I tested it
Windows 11, Python 3.13, CPU torch.
python -m pytest -qwith no environment variables: 236 passed, 1 skipped. Before, it crashed at collection.PYTHONUTF8=1 python -m pytest -q: 236 passed, 1 skipped. Before, 229 passed, 5 failed, 1 skipped.*.jsonl.gzpattern.faiss,eval,board). If one of them has no Windows wheel, I'll fix the job.Left out on purpose
exealm/train/pretrain.py,grpo.py,sft.pyand their tests, because Train swarm SFT through the shared board #63, Train whole swarms with GRPO #65 and Train in several processes with DDP (#17) #68 are editing them. I'll add the encoding there after those merge.README.ja.mdstill needs the new to-do line and Windows note from someone who reads Japanese.