Repository navigation
[requirements] Split requirements into different tiers [build_base] - #36808
Conversation
Signed-off-by: Kai Fricke <[email protected]>
Signed-off-by: Kai Fricke <[email protected]>
Signed-off-by: Kai Fricke <[email protected]>
Signed-off-by: Kai Fricke <[email protected]>
Signed-off-by: Kai Fricke <[email protected]>
Signed-off-by: Kai Fricke <[email protected]>
Signed-off-by: Kai Fricke <[email protected]>
Signed-off-by: Kai Fricke <[email protected]>
Signed-off-by: Kai Fricke <[email protected]>
There was a problem hiding this comment.
It probably doesn't make sense to have all these in an air directory, I wonder if we can just put these directly in requirements instead.
@pcmoritz PTAL and leave any suggestions on how to organize this.
Signed-off-by: Kai Fricke <[email protected]>
|
I feel that this setup is going to be quite hard to maintain over time. like if I add a dependency, or require pinning a transient dependency, how do I know / keep track which file I should update? I think in the long run:
if we use bazel to compile the dependencies, this is basically what bazel will do. sadly, bazel does not have ver great support for multi-python+multi-platform, or at least it will take a lot of efforts. that said, the dependency graph compilation for third-party dependencies is basically done by pip, which means we can do it in our own way if we want to. maybe the challenging part is actually "properly splitting ray into sub components". |
Signed-off-by: Kai Fricke <[email protected]>
It's what we're doing right now, but the renaming actually enables e.g. dependabot to make updates easier in the future.
Again no real change here, usually we pin these where the core dependency is defined.
The goal of these restructurings is not to solve the dependency issues for different ray components. It is mostly about improving the state of our docker containers. We are shipping docker containers, and we ship installed dependencies in them. Users are asking for lists of these dependencies to be able to install them in their own setups, and they expect that these dependency versions are also tested - which is currently not the case. This renaming and the follow-up (pip-compile) will ensure consistent versions between the docker images and CI. For actual test-only dependencies (in this PR the |
Signed-off-by: Kai Fricke <[email protected]>
Signed-off-by: Kai Fricke <[email protected]>
Signed-off-by: Kai Fricke <[email protected]>
# Conflicts: # docker/ray-ml/Dockerfile # python/requirements/ml/dl-cpu-requirements.txt
Signed-off-by: Kai Fricke <[email protected]>
Signed-off-by: Kai Fricke <[email protected]>
Signed-off-by: Kai Fricke <[email protected]>
Signed-off-by: Kai Fricke <[email protected]>
Signed-off-by: Kai Fricke <[email protected]>
…ld_base] (#36983) Following up from #36808, this PR now uses the compiled constraints file in the installation of the dependencies in CI and in the ray-ml docker images. In result, both environments will share the same versions of (sub)dependencies. Signed-off-by: Kai Fricke <[email protected]>
…ld_base] (ray-project#36983) Following up from ray-project#36808, this PR now uses the compiled constraints file in the installation of the dependencies in CI and in the ray-ml docker images. In result, both environments will share the same versions of (sub)dependencies. Signed-off-by: Kai Fricke <[email protected]>
…ld_base] (ray-project#36983) Following up from ray-project#36808, this PR now uses the compiled constraints file in the installation of the dependencies in CI and in the ray-ml docker images. In result, both environments will share the same versions of (sub)dependencies. Signed-off-by: Kai Fricke <[email protected]>
…ld_base] (ray-project#36983) Following up from ray-project#36808, this PR now uses the compiled constraints file in the installation of the dependencies in CI and in the ray-ml docker images. In result, both environments will share the same versions of (sub)dependencies. Signed-off-by: Kai Fricke <[email protected]> Signed-off-by: NripeshN <[email protected]>
…ay-project#36808) This PR splits the requirements files into different tiers: - `air/core-requirements.txt` - these are the most important requirements (tier 1) - `air/[library]-requirements.txt` - these are pinned dependencies for libraries (tier 2+3) - `air/[library]-test-requirements.txt` - these are pinned test-dependencies for libraries (tier 4) (tier 2 and 3 may get merged into one tier, tbd). This does not change any packages and should not affect installed packages in docker or CI. The naming format was chosen to be compatible with dependabot. In a follow-up PR, we will compile the tier 1-3 dependencies to ensure all CI runners and Docker images run on the same dependency versions. This PR will split existing requirement files. In total, there will be 4 more such files (`rllib-test-requirements.txt`, `tune-test-requirements.txt`, `train-test-requirements.txt`, `docker/ray-docker-requirements.txt` Signed-off-by: Kai Fricke <[email protected]> Signed-off-by: e428265 <[email protected]>
…ld_base] (ray-project#36983) Following up from ray-project#36808, this PR now uses the compiled constraints file in the installation of the dependencies in CI and in the ray-ml docker images. In result, both environments will share the same versions of (sub)dependencies. Signed-off-by: Kai Fricke <[email protected]> Signed-off-by: e428265 <[email protected]>
…ld_base] (ray-project#36983) Following up from ray-project#36808, this PR now uses the compiled constraints file in the installation of the dependencies in CI and in the ray-ml docker images. In result, both environments will share the same versions of (sub)dependencies. Signed-off-by: Kai Fricke <[email protected]> Signed-off-by: Victor <[email protected]>
…ch 2.7 special case (#65909) ## Description Bumps the repo-wide torch pin from **2.9.0 to 2.10.0** (torchvision 0.24.0 → 0.25.0) across CI, the release BYOD images and the compiled constraints, and retires the Windows-only torch 2.7 special case that the 2.9 pin forced. Why now: torch 2.8/2.9 Windows wheels were built without libuv, so `torch.distributed`'s gloo backend could not initialize on Windows (pytorch/pytorch#150381). The fix (pytorch/gloo#472) ships in torch 2.10, and `windows-requirements.txt` carried the instruction *"Keep Windows CI on 2.7.0 until the repo-wide torch pin reaches >=2.10, then delete this file and the windows torch2.7 depsets."* This PR does exactly that. ### Pins moved - `python/requirements/ml/dl-cpu-requirements.txt`: `torch==2.10.0`, `torchvision==0.25.0`, `torch-scatter==2.1.2+cpu.torch.2.10` (Astral), `torch-sparse==0.6.18+pt210cpu` (PyG `torch-2.10.0+cpu` page). `nvidia-nccl-cu12==2.27.5` is unchanged — torch 2.10.0+cu128 still requires exactly that. - `dl-gpu-requirements.txt`: `torch==2.10.0+cu128`, `torchvision==0.25.0+cu128`, `torch-scatter==2.1.2+cu.12.8.torch.2.10`, `torch-sparse==0.6.18+pt210cu128`. - `data-test-requirements.txt`: `torchvision==0.25.0`; **`torchcodec` cap flipped from `<0.10` to `>=0.10,<0.11`** — its `libtorchcodec` is ABI-bound to a torch minor and declares no torch requirement, so the line has to be pinned by hand: 0.9.x was built for torch 2.9 and would fail to load, 0.10.x is the torch 2.10 line (lerobot 0.5.1 allows `<0.11`). - Release BYOD: `requirements_ml_byod_3.10.in` (`torch==2.10.0`, `triton==3.6.0` — torch 2.10 requires triton 3.6), `requirements_ml_byod_3.13.in` (`torch==2.10.0`), `requirements_gpu_cu130.in` (`2.9.1` → `2.10.0`). - `requirements_compiled_py3.14.txt`: `torch==2.10.0`, `torchvision==0.25.0`, PyG find-links → `torch-2.10.0+cpu` — mirrored by hand as always for this file. Note torch 2.10 is the first line with cp314 wheels, so this snapshot's torch pin is now actually satisfiable on py3.14 (it pinned 2.7.0, which has none); unifying `docker/ray-torch/torch-constraints-py3.14.txt` onto it is a possible follow-up, not done here. ### ray-torch image: py3.14 now shares the compiled constraints (closes the TODO in `ray_torch.depsets.yaml`) `ray_torch.depsets.yaml` carried two copies of the same depset because `requirements_compiled_py3.14.txt` pinned torch 2.7.0 (no cp314 wheels), so the py3.14 image had to pin torch itself in `docker/ray-torch/torch-constraints-py3.14.txt`. With the snapshot on 2.10.0 every pin in that side file (`torch`, `torchvision`, `cupy-cuda12x`, `llvmlite`, `numba`, `dm-tree`) is supplied identically by the snapshot, so the two entries collapse into one constrained by `/tmp/ray-deps/requirements_compiled_py${PYTHON_VERSION}.txt` and the side file is deleted. Two things had to move for that to resolve: - `nvidia-nccl-cu12` in the py3.14 snapshot: `2.26.2` → `2.27.5` — the torch-2.7-era value was never mirrored; torch 2.10.0 requires 2.27.5 exactly (same as `requirements_compiled.txt` / `dl-cpu-requirements.txt`). - **Effect on the py3.14 ray-torch lock:** it was previously unconstrained apart from the six side-file pins, so ~100 of its packages floated to whatever was newest at compile time; they are now held to the py3.14 compiled snapshot the same way the py3.11 image is held to `requirements_compiled.txt`. Most of the ~109 moved lines are exactly that (e.g. `pytest` 9.0.3 → 8.3.3, `numpy` 2.4.6 → 2.3.3, `sentence-transformers` 5.5.1 → 3.0.1). Caveat worth knowing: `requirements_compiled_py3.14.txt` is a hand-maintained snapshot and differs from `requirements_compiled.txt` in 28 of 607 shared pins (mixed direction — `transformers` 4.36.2 vs 5.11.0 and `datasets` 3.6.0 vs 4.8.5 older, `numpy`/`pytest`/`urllib3`/`grpcio`/`pydantic` newer) plus 15 py3.14-only pins, so the two ray-torch images are aligned in *policy* but not yet byte-for-byte in versions. Refreshing that snapshot toward `requirements_compiled.txt` (now that torch 2.10 makes it possible) is the natural follow-up. The py3.11 lock only gains `langchain-text-splitters` and its closure plus the jsonpatch bump. - **`jsonpatch==1.32` → `1.33`** in `test-requirements.txt`. `langchain-text-splitters` (in the ray-torch image since #65114) needs a `langchain-core` requiring `jsonpatch>=1.33`; 1.32 was a 2023 tier-split snapshot pin (#36808), 1.33 is the last release, and the only other consumer (`cfn-lint`) takes any version. This also removes the reason `langchain-text-splitters` was excluded from the py3.11 ray-torch image, so that `python_version >= "3.12"` marker is dropped and both images match. ### Windows special case removed - `python/requirements/windows-requirements.txt` deleted. - `ci_windows.depsets.yaml`: `relaxed_windows_tests_ci_depset` and `windows_tests_torch27_ci_depset` removed; their two locks deleted. - `ci/docker/windows.build.wanda.yaml` and `ci/ray_ci/windows/build_base.sh` now consume `windows-tests-ci_depset_py3.10.lock` directly (the lock the torch27 one was derived from). ### Not moved (deliberately) - LLM stack (`python/requirements/llm`, `python/deplocks/llm/*`): pinned by `vllm==0.27.0` to torch 2.13; independent of this pin. - `doc/source/templates/**` (torch 2.0.1): legacy template examples, out of scope. - `docker/ray-torch/torch-constraints-py3.14.txt` already pins torch 2.10.0 / torchvision 0.25.0. ### What moved in the locks Aggregated across the 38 changed locks — nothing outside torch's own closure: `torch` 2.9.0→2.10.0 (+cpu/+cu128), `torchvision` 0.24.0→0.25.0, `torch-scatter`/`torch-sparse` to the torch-2.10 builds, `triton` 3.5.0→3.6.0 (13 GPU locks), `torchcodec` 0.9.1→0.10.0 (3 data locks), `nvidia-nvshmem-cu12` 3.3.20→3.4.5 (13 GPU locks), and the `cuda-bindings`/`cuda-python`/`cuda-pathfinder` set that torch 2.10's cu128 wheel pulls in (torch 2.10.0+cu128 declares `cuda-bindings==12.9.4` exactly, which brings `cuda-pathfinder` and moves the five py3.12 GPU locks that previously resolved `cuda-bindings`/`cuda-python` 12.9.6 down to 12.9.4). `deepspeed` stays `0.18.9`. ### Verified locally - torch 2.10.0 has cp310/cp312/cp314 wheels on `download.pytorch.org/whl/{cpu,cu128,cu130}` and win_amd64 on PyPI; torchvision 0.25.0 likewise (and the repo's ray-torch py3.14 constraints already pair 2.10.0 with 0.25.0). - PyG publishes `torch_sparse 0.6.18+pt210{cpu,cu128}` for cp310/cp312 (linux + win); Astral publishes `torch-scatter 2.1.2+cpu.torch.2.10` / `+cu.12.8.torch.2.10`. - No caps in the way: `torchtext 0.18.0` requires `torch>=2.3.0`; `pytorch-lightning 1.8.6` requires `torch>=1.9.0`; `torchft-nightly` requires `torch>=2.7`. - `./ci/ci.sh compile_pip_dependencies` → exit 0; diff vs base is exactly the find-links URL, `torch==2.10.0`, `torchvision==0.25.0` - `bazel run //ci/raydepsets:raydepsets -- build --all-configs` → exit 0, 105 depsets; 38 locks modified, 2 deleted (the Windows torch27 pair); every non-LLM lock now pins `torch==2.10.0` - `bazel run //ci/raydepsets:raydepsets -- build --all-configs --check` → exit 0, all 105 depsets regenerate byte-identically Follows #65899 (Astral index / PyG cleanup), which has merged; this PR is rebased on top of it. ## Related issues pytorch/pytorch#150381, pytorch/gloo#472. Follows #65899. ## Additional information Not a duplicate: open dependabot PRs (#64868, #64860, #64005) bump torch in single requirement files without the Windows/PyG/torchcodec/lock changes, and each carries a failing check; no open PR bumps the fleet pin coherently. AI assistance (Claude Code) was used for this change; every changed line was reviewed by the submitter. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: elliot-barn <[email protected]> Co-authored-by: Claude Fable 5.1 <[email protected]>
…ch 2.7 special case (ray-project#65909) ## Description Bumps the repo-wide torch pin from **2.9.0 to 2.10.0** (torchvision 0.24.0 → 0.25.0) across CI, the release BYOD images and the compiled constraints, and retires the Windows-only torch 2.7 special case that the 2.9 pin forced. Why now: torch 2.8/2.9 Windows wheels were built without libuv, so `torch.distributed`'s gloo backend could not initialize on Windows (pytorch/pytorch#150381). The fix (pytorch/gloo#472) ships in torch 2.10, and `windows-requirements.txt` carried the instruction *"Keep Windows CI on 2.7.0 until the repo-wide torch pin reaches >=2.10, then delete this file and the windows torch2.7 depsets."* This PR does exactly that. ### Pins moved - `python/requirements/ml/dl-cpu-requirements.txt`: `torch==2.10.0`, `torchvision==0.25.0`, `torch-scatter==2.1.2+cpu.torch.2.10` (Astral), `torch-sparse==0.6.18+pt210cpu` (PyG `torch-2.10.0+cpu` page). `nvidia-nccl-cu12==2.27.5` is unchanged — torch 2.10.0+cu128 still requires exactly that. - `dl-gpu-requirements.txt`: `torch==2.10.0+cu128`, `torchvision==0.25.0+cu128`, `torch-scatter==2.1.2+cu.12.8.torch.2.10`, `torch-sparse==0.6.18+pt210cu128`. - `data-test-requirements.txt`: `torchvision==0.25.0`; **`torchcodec` cap flipped from `<0.10` to `>=0.10,<0.11`** — its `libtorchcodec` is ABI-bound to a torch minor and declares no torch requirement, so the line has to be pinned by hand: 0.9.x was built for torch 2.9 and would fail to load, 0.10.x is the torch 2.10 line (lerobot 0.5.1 allows `<0.11`). - Release BYOD: `requirements_ml_byod_3.10.in` (`torch==2.10.0`, `triton==3.6.0` — torch 2.10 requires triton 3.6), `requirements_ml_byod_3.13.in` (`torch==2.10.0`), `requirements_gpu_cu130.in` (`2.9.1` → `2.10.0`). - `requirements_compiled_py3.14.txt`: `torch==2.10.0`, `torchvision==0.25.0`, PyG find-links → `torch-2.10.0+cpu` — mirrored by hand as always for this file. Note torch 2.10 is the first line with cp314 wheels, so this snapshot's torch pin is now actually satisfiable on py3.14 (it pinned 2.7.0, which has none); unifying `docker/ray-torch/torch-constraints-py3.14.txt` onto it is a possible follow-up, not done here. ### ray-torch image: py3.14 now shares the compiled constraints (closes the TODO in `ray_torch.depsets.yaml`) `ray_torch.depsets.yaml` carried two copies of the same depset because `requirements_compiled_py3.14.txt` pinned torch 2.7.0 (no cp314 wheels), so the py3.14 image had to pin torch itself in `docker/ray-torch/torch-constraints-py3.14.txt`. With the snapshot on 2.10.0 every pin in that side file (`torch`, `torchvision`, `cupy-cuda12x`, `llvmlite`, `numba`, `dm-tree`) is supplied identically by the snapshot, so the two entries collapse into one constrained by `/tmp/ray-deps/requirements_compiled_py${PYTHON_VERSION}.txt` and the side file is deleted. Two things had to move for that to resolve: - `nvidia-nccl-cu12` in the py3.14 snapshot: `2.26.2` → `2.27.5` — the torch-2.7-era value was never mirrored; torch 2.10.0 requires 2.27.5 exactly (same as `requirements_compiled.txt` / `dl-cpu-requirements.txt`). - **Effect on the py3.14 ray-torch lock:** it was previously unconstrained apart from the six side-file pins, so ~100 of its packages floated to whatever was newest at compile time; they are now held to the py3.14 compiled snapshot the same way the py3.11 image is held to `requirements_compiled.txt`. Most of the ~109 moved lines are exactly that (e.g. `pytest` 9.0.3 → 8.3.3, `numpy` 2.4.6 → 2.3.3, `sentence-transformers` 5.5.1 → 3.0.1). Caveat worth knowing: `requirements_compiled_py3.14.txt` is a hand-maintained snapshot and differs from `requirements_compiled.txt` in 28 of 607 shared pins (mixed direction — `transformers` 4.36.2 vs 5.11.0 and `datasets` 3.6.0 vs 4.8.5 older, `numpy`/`pytest`/`urllib3`/`grpcio`/`pydantic` newer) plus 15 py3.14-only pins, so the two ray-torch images are aligned in *policy* but not yet byte-for-byte in versions. Refreshing that snapshot toward `requirements_compiled.txt` (now that torch 2.10 makes it possible) is the natural follow-up. The py3.11 lock only gains `langchain-text-splitters` and its closure plus the jsonpatch bump. - **`jsonpatch==1.32` → `1.33`** in `test-requirements.txt`. `langchain-text-splitters` (in the ray-torch image since ray-project#65114) needs a `langchain-core` requiring `jsonpatch>=1.33`; 1.32 was a 2023 tier-split snapshot pin (ray-project#36808), 1.33 is the last release, and the only other consumer (`cfn-lint`) takes any version. This also removes the reason `langchain-text-splitters` was excluded from the py3.11 ray-torch image, so that `python_version >= "3.12"` marker is dropped and both images match. ### Windows special case removed - `python/requirements/windows-requirements.txt` deleted. - `ci_windows.depsets.yaml`: `relaxed_windows_tests_ci_depset` and `windows_tests_torch27_ci_depset` removed; their two locks deleted. - `ci/docker/windows.build.wanda.yaml` and `ci/ray_ci/windows/build_base.sh` now consume `windows-tests-ci_depset_py3.10.lock` directly (the lock the torch27 one was derived from). ### Not moved (deliberately) - LLM stack (`python/requirements/llm`, `python/deplocks/llm/*`): pinned by `vllm==0.27.0` to torch 2.13; independent of this pin. - `doc/source/templates/**` (torch 2.0.1): legacy template examples, out of scope. - `docker/ray-torch/torch-constraints-py3.14.txt` already pins torch 2.10.0 / torchvision 0.25.0. ### What moved in the locks Aggregated across the 38 changed locks — nothing outside torch's own closure: `torch` 2.9.0→2.10.0 (+cpu/+cu128), `torchvision` 0.24.0→0.25.0, `torch-scatter`/`torch-sparse` to the torch-2.10 builds, `triton` 3.5.0→3.6.0 (13 GPU locks), `torchcodec` 0.9.1→0.10.0 (3 data locks), `nvidia-nvshmem-cu12` 3.3.20→3.4.5 (13 GPU locks), and the `cuda-bindings`/`cuda-python`/`cuda-pathfinder` set that torch 2.10's cu128 wheel pulls in (torch 2.10.0+cu128 declares `cuda-bindings==12.9.4` exactly, which brings `cuda-pathfinder` and moves the five py3.12 GPU locks that previously resolved `cuda-bindings`/`cuda-python` 12.9.6 down to 12.9.4). `deepspeed` stays `0.18.9`. ### Verified locally - torch 2.10.0 has cp310/cp312/cp314 wheels on `download.pytorch.org/whl/{cpu,cu128,cu130}` and win_amd64 on PyPI; torchvision 0.25.0 likewise (and the repo's ray-torch py3.14 constraints already pair 2.10.0 with 0.25.0). - PyG publishes `torch_sparse 0.6.18+pt210{cpu,cu128}` for cp310/cp312 (linux + win); Astral publishes `torch-scatter 2.1.2+cpu.torch.2.10` / `+cu.12.8.torch.2.10`. - No caps in the way: `torchtext 0.18.0` requires `torch>=2.3.0`; `pytorch-lightning 1.8.6` requires `torch>=1.9.0`; `torchft-nightly` requires `torch>=2.7`. - `./ci/ci.sh compile_pip_dependencies` → exit 0; diff vs base is exactly the find-links URL, `torch==2.10.0`, `torchvision==0.25.0` - `bazel run //ci/raydepsets:raydepsets -- build --all-configs` → exit 0, 105 depsets; 38 locks modified, 2 deleted (the Windows torch27 pair); every non-LLM lock now pins `torch==2.10.0` - `bazel run //ci/raydepsets:raydepsets -- build --all-configs --check` → exit 0, all 105 depsets regenerate byte-identically Follows ray-project#65899 (Astral index / PyG cleanup), which has merged; this PR is rebased on top of it. ## Related issues pytorch/pytorch#150381, pytorch/gloo#472. Follows ray-project#65899. ## Additional information Not a duplicate: open dependabot PRs (ray-project#64868, ray-project#64860, ray-project#64005) bump torch in single requirement files without the Windows/PyG/torchcodec/lock changes, and each carries a failing check; no open PR bumps the fleet pin coherently. AI assistance (Claude Code) was used for this change; every changed line was reviewed by the submitter. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: elliot-barn <[email protected]> Co-authored-by: Claude Fable 5.1 <[email protected]>

Why are these changes needed?
This PR splits the requirements files into different tiers:
air/core-requirements.txt- these are the most important requirements (tier 1)air/[library]-requirements.txt- these are pinned dependencies for libraries (tier 2+3)air/[library]-test-requirements.txt- these are pinned test-dependencies for libraries (tier 4)(tier 2 and 3 may get merged into one tier, tbd).
This does not change any packages and should not affect installed packages in docker or CI.
The naming format was chosen to be compatible with dependabot.
In a follow-up PR, we will compile the tier 1-3 dependencies to ensure all CI runners and Docker images run on the same dependency versions.
This PR will split existing requirement files. In total, there will be 4 more such files (
rllib-test-requirements.txt,tune-test-requirements.txt,train-test-requirements.txt,docker/ray-docker-requirements.txtBackground
We currently ship different subdependencies in different environments. The packages installed in CI differ between jobs, and the packages in the docker images differ between python versions and image type (ray vs ray-ml).
The reason for that is in those environments only a subset of dependencies are installed. Generally the more dependencies are installed in one go, the more restrictive the subdependencies are and the older the shipped versions. This can lead to a situation where we ship packages in our docker images that are not tested on CI and can actually fail.
The plan going forward is to pip-compile the full list of dependencies into a constraints file. This constraints file is then used in subsequent jobs to install the packages. By utilizing the constraints file we can ensure that the package versions match between CI and docker containers, but we don't have to install all packages in all environments.
Related issue number
Checks
git commit -s) in this PR.scripts/format.shto lint the changes in this PR.method in Tune, I've added it in
doc/source/tune/api/under thecorresponding
.rstfile.