Repository navigation
[ci][windows] Fix all failing Windows tests: torch 2.7 pin, MSVC compile error, streaming-generator timeout, uv test - #64865
Conversation
…o collective tests) test_experimental_collective fails on Windows since #64257 bumped torch 2.7.0 -> 2.9.0: torch 2.8/2.9 Windows wheels are built without libuv, and gloo's TCP transport is Linux-only, so torch.distributed's gloo backend cannot initialize ("makeDeviceForHostname(): unsupported gloo device", pytorch/pytorch#150381; fixed upstream in torch 2.10, not cherry-picked into 2.9.x). The windowsbuild image previously pip-installed its test deps constrained by requirements_compiled.txt directly, so it had no depset to override. Bring it under raydepsets (ci_windows.depsets.yaml): - windows_tests_ci_depset_310: compile requirements.txt + test-requirements.txt + dl-cpu-requirements.txt for windows/py3.10, constrained by requirements_compiled (same inputs build_base.sh used). - relaxed_windows_tests_ci_depset_310: relax torch, torchvision and the ABI-coupled PyG binaries. - windows_tests_torch27_ci_depset_310: expand with python/requirements/windows-requirements.txt pinning torch==2.7.0, torchvision==0.22.0 and the +pt27cpu PyG builds. build_base.sh now installs the final lock (hash-stripped, --no-deps, same pattern as macos_ci.sh). The lock differs from the base resolution by exactly the torch six-pack. Delete windows-requirements.txt and the torch2.7 depsets once the repo-wide torch pin reaches >=2.10. Co-Authored-By: Claude Fable 5 <[email protected]> Signed-off-by: elliot-barn <[email protected]>
There was a problem hiding this comment.
Code Review
This pull request updates the Windows CI build environment to use a dependency lockfile instead of installing directly from raw requirements files. It pins PyTorch to version 2.7.0 and torchvision to 0.22.0 (along with compatible PyG extensions) on Windows to avoid a known issue in PyTorch 2.8/2.9 where the Gloo backend fails to initialize due to missing libuv support. Feedback was provided regarding the use of sed on Windows, where CRLF line endings could prevent trailing backslashes from being correctly stripped, and the potential unavailability of /tmp in some Windows container environments. A suggestion was made to strip carriage returns and use a local temporary file instead.
| sed 's/ \\$//; s/ --hash[^ ]*//g' \ | ||
| python/deplocks/ci/windows-tests-torch27-ci_depset_py3.10.lock \ | ||
| > /tmp/windows_tests_depset_no_hashes.txt | ||
| pip install -U --ignore-installed --no-deps -r /tmp/windows_tests_depset_no_hashes.txt |
There was a problem hiding this comment.
On Windows, files are often checked out with CRLF (\r\n) line endings depending on the user's or CI's git configuration. If the lockfile has CRLF line endings, the $ anchor in sed 's/ \\$//' will not match the trailing backslash because of the carriage return (\r) character preceding the newline. This will prevent the backslashes from being stripped, causing pip install to fail with syntax or parsing errors.
Additionally, /tmp may not be guaranteed to exist or be writable in all Windows container environments. Writing to a local temporary file in the current working directory and cleaning it up afterward is more robust.
We can resolve both issues by stripping \r first and using a local temporary file.
| sed 's/ \\$//; s/ --hash[^ ]*//g' \ | |
| python/deplocks/ci/windows-tests-torch27-ci_depset_py3.10.lock \ | |
| > /tmp/windows_tests_depset_no_hashes.txt | |
| pip install -U --ignore-installed --no-deps -r /tmp/windows_tests_depset_no_hashes.txt | |
| sed 's/\\r//g; s/ \\$//; s/ --hash[^ ]*//g' \ | |
| python/deplocks/ci/windows-tests-torch27-ci_depset_py3.10.lock \ | |
| > windows_tests_depset_no_hashes.txt | |
| pip install -U --ignore-installed --no-deps -r windows_tests_depset_no_hashes.txt | |
| rm windows_tests_depset_no_hashes.txt |
Three independent Windows-only breaks, all verified against postmerge builds 18675/18684: - generator_waiter_test.cc: MSVC C2131 — a by-ref-captured constexpr local used as an array bound inside a lambda is not a constant expression to MSVC. Make the test constants static constexpr. Broken since #64383. - test_streaming_generator: move from the medium to the large shard. Passing Windows runs take ~296s against the moderate 300s limit (build 18675: PASSED in 296.2s; build 18684: TIMEOUT at 300s in 2/2 attempts, mid-suite at test 21-22 of 23) — it is slow, not hung. - test_runtime_env_uv::test_uv_with_version_and_check: use importlib.metadata instead of pkg_resources. virtualenv >= 21 (bumped in #64257) no longer seeds setuptools into the venvs Ray creates, and setuptools >= 83 removed pkg_resources entirely, so the test must not depend on it regardless of the virtualenv pin decision in #64739. Co-Authored-By: Claude Fable 5 <[email protected]> Signed-off-by: elliot-barn <[email protected]>
The Windows cpp-tests job enumerates //src/... test targets explicitly,
and Bazel errors on explicitly-requested incompatible targets
('command succeeded, but not all targets were analyzed'). The four
RocksDB store-client tests are target_compatible_with linux but were
missing the no_windows tag the job filters on —
chaos_redis_store_client_test in the same file shows the convention.
This was the second, previously-masked failure in the Windows cpp job:
postmerge build 18688 shows generator_waiter_test now compiling and
passing on Windows, with only this analysis error remaining.
Co-Authored-By: Claude Fable 5 <[email protected]>
Signed-off-by: elliot-barn <[email protected]>
…ile error, streaming-generator timeout, uv test (ray-project#64865) ## Why are these changes needed? Fixes all four Windows test failures on master postmerge (builds 18675/18684). Windows tests run only on release-automation-triggered postmerge builds, so these landed silently. ### 1. `test_experimental_collective` — torch gloo broken on Windows (pin torch 2.7.0) Fails since ray-project#64257 bumped torch `2.7.0 → 2.9.0`: ``` RuntimeError: makeDeviceForHostname(): unsupported gloo device ``` torch 2.8/2.9 stock Windows wheels are built **without libuv**, and gloo's TCP transport is Linux-only, so `torch.distributed`'s gloo backend cannot initialize at all on Windows (pytorch/pytorch#150381). Fixed upstream via pytorch/gloo#472, shipped in torch **2.10** and explicitly not cherry-picked into 2.9.x. Ray's own postmerge bisection (builds 18569–18574) confirmed ray-project#64257 as first-bad; Linux/macOS are unaffected. The windowsbuild image previously pip-installed its test deps constrained by `requirements_compiled.txt` directly, so there was no depset to override. This brings it under raydepsets (`ci_windows.depsets.yaml`), mirroring the relax/expand pattern from `ci_data.depsets.yaml`: - `windows_tests_ci_depset_310` — compile `requirements.txt` + `test-requirements.txt` + `dl-cpu-requirements.txt` for windows/py3.10 constrained by `requirements_compiled` (same inputs `build_base.sh` used). - `relaxed_windows_tests_ci_depset_310` — relax torch, torchvision, and the ABI-coupled PyG binaries. - `windows_tests_torch27_ci_depset_310` — expand with `python/requirements/windows-requirements.txt`: `torch==2.7.0`, `torchvision==0.22.0`, and the `+pt27cpu` PyG local builds (explicit local tags because the relaxed lock still emits the torch-2.9.0 find-links and unsafe-best-match would otherwise re-pick `+pt29cpu`). `build_base.sh` installs the final lock hash-stripped with `--no-deps` (same pattern as `ci/ray_ci/macos/macos_ci.sh`). The wanda srcs now key on the lock instead of the four requirements files. The final lock differs from the base resolution by exactly the six torch packages. Windows **wheel** builds are unaffected (hermetic `uv run` env in `build-wheel-windows.sh`). Delete `windows-requirements.txt` and the torch2.7 depsets once the repo-wide torch pin reaches ≥2.10. ### 2. `generator_waiter_test` — MSVC C2131 compile error (cpp tests job) Broken since ray-project#64383: a by-ref-captured `constexpr` local used as an array bound inside a lambda is not a constant expression to MSVC. Make the test constants `static constexpr`. ### 3. `test_streaming_generator` — timeout, moved to the large shard Passing Windows runs take ~296s against the moderate (300s) limit (build 18675: PASSED in 296.2s; build 18684: TIMEOUT at 300s in 2/2 attempts, dying mid-suite at test 21–22 of 23) — legitimately slow, not hung. The Windows job selects `//python/ray/tests/...` by path, so the size-tag move keeps Windows coverage. ### 4. `test_runtime_env_uv::test_uv_with_version_and_check` — pkg_resources removed Use `importlib.metadata` instead of `pkg_resources`: virtualenv ≥21 (bumped in ray-project#64257) no longer seeds setuptools into the venvs Ray creates, and setuptools ≥83 removed `pkg_resources` entirely, so the test must not depend on it regardless of the virtualenv pin decision in ray-project#64739. Ray's non-test code has zero pkg_resources usage. ## Related issue number Root causes: upstream pytorch/pytorch#150381 (item 1); regressions introduced by ray-project#64257 (items 1, 4) and ray-project#64383 (item 2). ## Checks - Not a duplicate: searched open PRs — none address the Windows gloo/torch failure, the MSVC break, or the streaming-generator timeout. ray-project#64739 (virtualenv pin) is complementary: item 4 here makes the test independent of that decision. - Tests run locally: `bazel run //ci/raydepsets:raydepsets -- build ci/raydepsets/configs/ci_windows.depsets.yaml` (all depsets compile; final lock pins `torch==2.7.0+cpu`, diff vs base is exactly the six torch packages); `bazel query` confirms `test_streaming_generator` is a unique target with `size = large`; `pre-commit` passed on all changed files. Windows image build + test runs can only be validated in CI — watch `windowsbuild` (cold rebuild expected) and the Windows cpp/python test jobs on this PR. - AI assistance was used for this change (diagnosis and implementation); reviewed and submitted by a human. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: elliot-barn <[email protected]> Co-authored-by: Claude Fable 5 <[email protected]> Signed-off-by: 400Ping <[email protected]>
Why are these changes needed?
Fixes all four Windows test failures on master postmerge (builds 18675/18684). Windows tests run only on release-automation-triggered postmerge builds, so these landed silently.
1.
test_experimental_collective— torch gloo broken on Windows (pin torch 2.7.0)Fails since #64257 bumped torch
2.7.0 → 2.9.0:torch 2.8/2.9 stock Windows wheels are built without libuv, and gloo's TCP transport is Linux-only, so
torch.distributed's gloo backend cannot initialize at all on Windows (pytorch/pytorch#150381). Fixed upstream via pytorch/gloo#472, shipped in torch 2.10 and explicitly not cherry-picked into 2.9.x. Ray's own postmerge bisection (builds 18569–18574) confirmed #64257 as first-bad; Linux/macOS are unaffected.The windowsbuild image previously pip-installed its test deps constrained by
requirements_compiled.txtdirectly, so there was no depset to override. This brings it under raydepsets (ci_windows.depsets.yaml), mirroring the relax/expand pattern fromci_data.depsets.yaml:windows_tests_ci_depset_310— compilerequirements.txt+test-requirements.txt+dl-cpu-requirements.txtfor windows/py3.10 constrained byrequirements_compiled(same inputsbuild_base.shused).relaxed_windows_tests_ci_depset_310— relax torch, torchvision, and the ABI-coupled PyG binaries.windows_tests_torch27_ci_depset_310— expand withpython/requirements/windows-requirements.txt:torch==2.7.0,torchvision==0.22.0, and the+pt27cpuPyG local builds (explicit local tags because the relaxed lock still emits the torch-2.9.0 find-links and unsafe-best-match would otherwise re-pick+pt29cpu).build_base.shinstalls the final lock hash-stripped with--no-deps(same pattern asci/ray_ci/macos/macos_ci.sh). The wanda srcs now key on the lock instead of the four requirements files. The final lock differs from the base resolution by exactly the six torch packages. Windows wheel builds are unaffected (hermeticuv runenv inbuild-wheel-windows.sh). Deletewindows-requirements.txtand the torch2.7 depsets once the repo-wide torch pin reaches ≥2.10.2.
generator_waiter_test— MSVC C2131 compile error (cpp tests job)Broken since #64383: a by-ref-captured
constexprlocal used as an array bound inside a lambda is not a constant expression to MSVC. Make the test constantsstatic constexpr.3.
test_streaming_generator— timeout, moved to the large shardPassing Windows runs take ~296s against the moderate (300s) limit (build 18675: PASSED in 296.2s; build 18684: TIMEOUT at 300s in 2/2 attempts, dying mid-suite at test 21–22 of 23) — legitimately slow, not hung. The Windows job selects
//python/ray/tests/...by path, so the size-tag move keeps Windows coverage.4.
test_runtime_env_uv::test_uv_with_version_and_check— pkg_resources removedUse
importlib.metadatainstead ofpkg_resources: virtualenv ≥21 (bumped in #64257) no longer seeds setuptools into the venvs Ray creates, and setuptools ≥83 removedpkg_resourcesentirely, so the test must not depend on it regardless of the virtualenv pin decision in #64739. Ray's non-test code has zero pkg_resources usage.Related issue number
Root causes: upstream pytorch/pytorch#150381 (item 1); regressions introduced by #64257 (items 1, 4) and #64383 (item 2).
Checks
bazel run //ci/raydepsets:raydepsets -- build ci/raydepsets/configs/ci_windows.depsets.yaml(all depsets compile; final lock pinstorch==2.7.0+cpu, diff vs base is exactly the six torch packages);bazel queryconfirmstest_streaming_generatoris a unique target withsize = large;pre-commitpassed on all changed files. Windows image build + test runs can only be validated in CI — watchwindowsbuild(cold rebuild expected) and the Windows cpp/python test jobs on this PR.🤖 Generated with Claude Code