Repository navigation
[rl] Fix RL CPU unit tests resolving a month-old torch nightly - #5083
Conversation
The RL CPU job installed the Verifiers example requirements first and used them as constraints for the torch/vLLM nightly install. verifiers==0.3.1 requires mcp<2, but vLLM nightlies since ~2026-10-01 require mcp>=2, so uv fell back to vllm 1.0.0.dev20260830, which pins torch 2.15.0.dev20260830. That torch lacks torch.distributed.pipelining.analyze_pipeline_activation_liveness (used by dist_moe since pytorch#4541), so four test modules failed at collection. Install the nightlies the same way as the RL GPU jobs, run the CPU suite, then install the Verifiers requirements with torch/torchvision/vLLM held fixed and run the two Verifiers test files. Add the importorskip guard that test_verifiers_example.py already has to test_verifiers.py so the first run skips it, and drop the mcp pin that only existed to constrain the nightly install (verifiers==0.3.1 already requires mcp<2).
test_dapo_math.py imports math_verify through the DAPO math rubric. It used to come from the Verifiers requirements, which now install after the main suite. Install torchtitan/rl/examples/dapo_math/requirements.txt up front and constrain the nightly install with it; math-verify==0.9.0 resolves with the current torch/vLLM nightlies.
|
@claude review this PR |
|
Claude finished @tianyu-l's task in 1m 23s —— View job PR Review: Fix RL CPU unit tests resolving a month-old torch nightly
I think this PR is good to merge. The diagnosis holds up: Suggestion1. Second install doesn't use uv pip install -r torchtitan/rl/examples/verifiers/dapo_math/requirements.txt \
--constraint "${RUNNER_TEMP}/nightly-constraints.txt"Only torch, torchvision and vllm are pinned here. Nothing stops Verifiers from moving other packages the repo pins, such as uv pip install -r torchtitan/rl/examples/verifiers/dapo_math/requirements.txt \
--constraint .ci/docker/requirements.txt \
--constraint "${RUNNER_TEMP}/nightly-constraints.txt"
(I can't push changes under Nits
What looks good
|
tianyu-l
left a comment
There was a problem hiding this comment.
please see if what claude says makes sense
Why
RL CPU Unit Tests is red on
mainand on every PR that runs it. Four test modules fail at collection:The cause is the torch the job ends up with. The CPU job resolves
torch 2.15.0.dev20260830+vllm 1.0.0.dev20260830, while the RL GPU jobs in the same run get20261005for both. The CPU job installs the Verifiers example requirements first and then passes them as a--constraintto the nightly install:verifiers==0.3.1requiresmcp>=1.24.0,<2.mcp>=2.0.0,<3.0.0.uv therefore falls back to the newest vLLM that accepts mcp 1.x (
1.0.0.dev20260830), which pins a torch from the same day. That torch predatesanalyze_pipeline_activation_liveness, whichdist_moestarted importing in #4541.To reproduce, force a current vLLM next to the Verifiers requirements:
What
torchtitan/rl/examples/dapo_math/requirements.txt, i.e.math-verify==0.9.0fortest_dapo_math.py) are still installed first and passed as a constraint. They resolve fine with the current nightlies.test_verifiers.pyandtest_verifiers_example.py. Verifiers only changes its own dependencies: uv swapsmcp2.x -> 1.30.0 andwebsockets17.1 -> 16.1.1 and leaves the nightlies alone.pytest.importorskip("verifiers")totest_verifiers.py, the same guardtest_verifiers_example.pyalready has, so the first run skips it instead of failing at collection.mcp>=1.24.0,<2line fromdapo_math/requirements.txt. It only existed to constrain the nightly install, andverifiers==0.3.1already requires the same bound.Tests
Run locally with torch
2.15.0.dev20260926and vLLM1.0.0.dev20260926(mcp 2.2.0):pytest tests/rl/unit_tests/cpugives 474 passed, 6 skipped. That includes the three non-Verifiers modules above; both Verifiers files skip with "could not import 'verifiers'".verifiers==0.3.1installed on top:test_verifiers.pyandtest_verifiers_example.pygive 11 passed, and vLLM still imports with mcp 1.30.0.uv pip install -r .../requirements.txt --constraint <nightly pins>against that env: it installs 19 packages, changes onlymcpandwebsockets, and leaves torch/torchvision/vLLM untouched.uv pip compileof the nightlies plusmath-verify==0.9.0resolves to torch/vLLM20261005.20261005, buttest_dapo_math.pyfailed to collect becausemath_verifywas missing. That's fixed by the DAPO requirements step above.Follow-up
Outside CI, the Verifiers example still can't share an environment with current vLLM nightlies, since
verifiers==0.3.1needsmcp<2. Theverifiers0.3.2 dev releases move tomcp==2.0.0, but they also requirerenderers>=0.1.12.dev2, while torchtitan pinsrenderers==0.1.11. Bumpingverifiersmakes sense once a 0.3.2 release is out.