@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 206e2577fa
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 15, 19:45 UTC

Move requirements into their own directory (#12547)

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>

Harry Mellor committed Mar 8, 2025 at 17:44 UTC 206e2577fa9c73f0d8019210e36905ba970fe036
50 files changed +125 -128
.buildkite/nightly-benchmarks/scripts/run-nightly-benchmarks.sh
+1 -1
@@ -426,7 +426,7 @@ main() {
426
427 pip install -U transformers
428
429 - pip install -r requirements-dev.txt
429 + pip install -r requirements/dev.txt
430 which genai-perf
431
432 # check storage
.buildkite/run-cpu-test.sh
+1 -1
@@ -35,7 +35,7 @@ function cpu_tests() {
35 # Run basic model test
36 docker exec cpu-test-"$BUILDKITE_BUILD_NUMBER"-"$NUMA_NODE" bash -c "
37 set -e
38 - pip install -r vllm/requirements-test.txt
38 + pip install -r vllm/requirements/test.txt
39 pytest -v -s tests/models/decoder_only/language -m cpu_model
40 pytest -v -s tests/models/embedding/language -m cpu_model
41 pytest -v -s tests/models/encoder_decoder/language -m cpu_model
.buildkite/test-pipeline.yaml
+1 -1
@@ -35,7 +35,7 @@ steps:
35 fast_check: true
36 no_gpu: True
37 commands:
38 - - pip install -r requirements-docs.txt
38 + - pip install -r ../../requirements/docs.txt
39 - SPHINXOPTS=\"-W\" make html
40 # Check API reference (if it fails, you may have missing mock imports)
41 - grep \"sig sig-object py\" build/html/api/inference_params.html
.github/workflows/publish.yml
+1 -1
@@ -50,7 +50,7 @@ jobs:
50 # matrix:
51 # os: ['ubuntu-20.04']
52 # python-version: ['3.9', '3.10', '3.11', '3.12']
53 - # pytorch-version: ['2.4.0'] # Must be the most recent version that meets requirements-cuda.txt.
53 + # pytorch-version: ['2.4.0'] # Must be the most recent version that meets requirements/cuda.txt.
54 # cuda-version: ['11.8', '12.1']
55
56 # steps:
.github/workflows/scripts/build.sh
+1 -1
@@ -9,7 +9,7 @@ PATH=${cuda_home}/bin:$PATH
9 LD_LIBRARY_PATH=${cuda_home}/lib64:$LD_LIBRARY_PATH
10
11 # Install requirements
12 -$python_executable -m pip install -r requirements-build.txt -r requirements-cuda.txt
12 +$python_executable -m pip install -r requirements/build.txt -r requirements/cuda.txt
13
14 # Limit the number of parallel jobs to avoid OOM
15 export MAX_JOBS=1
.pre-commit-config.yaml
+2 -2
@@ -44,8 +44,8 @@ repos:
44 rev: 0.6.2
45 hooks:
46 - id: pip-compile
47 - args: [requirements-test.in, -o, requirements-test.txt]
48 - files: ^requirements-test\.(in|txt)$
47 + args: [requirements/test.in, -o, requirements/test.txt]
48 + files: ^requirements/test\.(in|txt)$
49 - repo: local
50 hooks:
51 - id: mypy-local
.readthedocs.yaml
+1 -1
@@ -18,4 +18,4 @@ formats: []
18 # Optionally declare the Python requirements required to build your docs
19 python:
20 install:
21 - - requirements: docs/requirements-docs.txt
21 + - requirements: requirements/docs.txt
Dockerfile
+12 -12
@@ -55,10 +55,10 @@ RUN --mount=type=cache,target=/root/.cache/uv \
55 uv pip install --index-url https://download.pytorch.org/whl/nightly/cu126 "torch==2.7.0.dev20250121+cu126" "torchvision==0.22.0.dev20250121"; \
56 fi
57
58 -COPY requirements-common.txt requirements-common.txt
59 -COPY requirements-cuda.txt requirements-cuda.txt
58 +COPY requirements/common.txt requirements/common.txt
59 +COPY requirements/cuda.txt requirements/cuda.txt
60 RUN --mount=type=cache,target=/root/.cache/uv \
61 - uv pip install -r requirements-cuda.txt
61 + uv pip install -r requirements/cuda.txt
62
63 # cuda arch list used by torch
64 # can be useful for both `dev` and `test`
@@ -76,14 +76,14 @@ FROM base AS build
76 ARG TARGETPLATFORM
77
78 # install build dependencies
79 -COPY requirements-build.txt requirements-build.txt
79 +COPY requirements/build.txt requirements/build.txt
80
81 # This timeout (in seconds) is necessary when installing some dependencies via uv since it's likely to time out
82 # Reference: https://github.com/astral-sh/uv/pull/1694
83 ENV UV_HTTP_TIMEOUT=500
84
85 RUN --mount=type=cache,target=/root/.cache/uv \
86 - uv pip install -r requirements-build.txt
86 + uv pip install -r requirements/build.txt
87
88 COPY . .
89 ARG GIT_REPO_CHECK=0
@@ -151,11 +151,11 @@ FROM base as dev
151 # Reference: https://github.com/astral-sh/uv/pull/1694
152 ENV UV_HTTP_TIMEOUT=500
153
154 -COPY requirements-lint.txt requirements-lint.txt
155 -COPY requirements-test.txt requirements-test.txt
156 -COPY requirements-dev.txt requirements-dev.txt
154 +COPY requirements/lint.txt requirements/lint.txt
155 +COPY requirements/test.txt requirements/test.txt
156 +COPY requirements/dev.txt requirements/dev.txt
157 RUN --mount=type=cache,target=/root/.cache/uv \
158 - uv pip install -r requirements-dev.txt
158 + uv pip install -r requirements/dev.txt
159 #################### DEV IMAGE ####################
160
161 #################### vLLM installation IMAGE ####################
@@ -230,9 +230,9 @@ COPY examples examples
230 # some issues w.r.t. JIT compilation. Therefore we need to
231 # install build dependencies for JIT compilation.
232 # TODO: Remove this once FlashInfer AOT wheel is fixed
233 -COPY requirements-build.txt requirements-build.txt
233 +COPY requirements/build.txt requirements/build.txt
234 RUN --mount=type=cache,target=/root/.cache/uv \
235 - uv pip install -r requirements-build.txt
235 + uv pip install -r requirements/build.txt
236
237 #################### vLLM installation IMAGE ####################
238
@@ -249,7 +249,7 @@ ENV UV_HTTP_TIMEOUT=500
249
250 # install development dependencies (for testing)
251 RUN --mount=type=cache,target=/root/.cache/uv \
252 - uv pip install -r requirements-dev.txt
252 + uv pip install -r requirements/dev.txt
253
254 # install development dependencies (for testing)
255 RUN --mount=type=cache,target=/root/.cache/uv \
Dockerfile.arm
+5 -5
@@ -26,18 +26,18 @@ WORKDIR /workspace
26 ARG PIP_EXTRA_INDEX_URL="https://download.pytorch.org/whl/cpu"
27 ENV PIP_EXTRA_INDEX_URL=${PIP_EXTRA_INDEX_URL}
28 RUN --mount=type=cache,target=/root/.cache/pip \
29 - --mount=type=bind,src=requirements-build.txt,target=requirements-build.txt \
29 + --mount=type=bind,src=requirements/build.txt,target=requirements/build.txt \
30 pip install --upgrade pip && \
31 - pip install -r requirements-build.txt
31 + pip install -r requirements/build.txt
32
33 FROM cpu-test-arm AS build
34
35 WORKDIR /workspace/vllm
36
37 RUN --mount=type=cache,target=/root/.cache/pip \
38 - --mount=type=bind,src=requirements-common.txt,target=requirements-common.txt \
39 - --mount=type=bind,src=requirements-cpu.txt,target=requirements-cpu.txt \
40 - pip install -v -r requirements-cpu.txt
38 + --mount=type=bind,src=requirements/common.txt,target=requirements/common.txt \
39 + --mount=type=bind,src=requirements/cpu.txt,target=requirements/cpu.txt \
40 + pip install -v -r requirements/cpu.txt
41
42 COPY . .
43 ARG GIT_REPO_CHECK=0
Dockerfile.cpu
+5 -5
@@ -29,18 +29,18 @@ WORKDIR /workspace
29 ARG PIP_EXTRA_INDEX_URL="https://download.pytorch.org/whl/cpu"
30 ENV PIP_EXTRA_INDEX_URL=${PIP_EXTRA_INDEX_URL}
31 RUN --mount=type=cache,target=/root/.cache/pip \
32 - --mount=type=bind,src=requirements-build.txt,target=requirements-build.txt \
32 + --mount=type=bind,src=requirements/build.txt,target=requirements/build.txt \
33 pip install --upgrade pip && \
34 - pip install -r requirements-build.txt
34 + pip install -r requirements/build.txt
35
36 FROM cpu-test-1 AS build
37
38 WORKDIR /workspace/vllm
39
40 RUN --mount=type=cache,target=/root/.cache/pip \
41 - --mount=type=bind,src=requirements-common.txt,target=requirements-common.txt \
42 - --mount=type=bind,src=requirements-cpu.txt,target=requirements-cpu.txt \
43 - pip install -v -r requirements-cpu.txt
41 + --mount=type=bind,src=requirements/common.txt,target=requirements/common.txt \
42 + --mount=type=bind,src=requirements/cpu.txt,target=requirements/cpu.txt \
43 + pip install -v -r requirements/cpu.txt
44
45 COPY . .
46 ARG GIT_REPO_CHECK=0
Dockerfile.hpu
+1 -1
@@ -4,7 +4,7 @@ COPY ./ /workspace/vllm
4
5 WORKDIR /workspace/vllm
6
7 -RUN pip install -v -r requirements-hpu.txt
7 +RUN pip install -v -r requirements/hpu.txt
8
9 ENV no_proxy=localhost,127.0.0.1
10 ENV PT_HPU_ENABLE_LAZY_COLLECTIVES=true
Dockerfile.neuron
+1 -1
@@ -36,7 +36,7 @@ RUN --mount=type=bind,source=.git,target=.git \
36
37 RUN python3 -m pip install -U \
38 'cmake>=3.26' ninja packaging 'setuptools-scm>=8' wheel jinja2 \
39 - -r requirements-neuron.txt
39 + -r requirements/neuron.txt
40
41 ENV VLLM_TARGET_DEVICE neuron
42 RUN --mount=type=bind,source=.git,target=.git \
Dockerfile.openvino
+1 -1
@@ -16,7 +16,7 @@ RUN --mount=type=bind,source=.git,target=.git \
16
17 RUN python3 -m pip install -U pip
18 # install build requirements
19 -RUN PIP_EXTRA_INDEX_URL="https://download.pytorch.org/whl/cpu" python3 -m pip install -r /workspace/requirements-build.txt
19 +RUN PIP_EXTRA_INDEX_URL="https://download.pytorch.org/whl/cpu" python3 -m pip install -r /workspace/requirements/build.txt
20 # build vLLM with OpenVINO backend
21 RUN PIP_EXTRA_INDEX_URL="https://download.pytorch.org/whl/cpu" VLLM_TARGET_DEVICE="openvino" python3 -m pip install /workspace
22
Dockerfile.ppc64le
+2 -2
@@ -6,7 +6,7 @@ ENV PATH="/usr/local/cargo/bin:$PATH:/opt/conda/bin/"
6
7 RUN apt-get update -y && apt-get install -y git wget kmod curl vim libnuma-dev libsndfile-dev libprotobuf-dev build-essential ffmpeg libsm6 libxext6 libgl1 libssl-dev
8
9 -# Some packages in requirements-cpu are installed here
9 +# Some packages in requirements/cpu are installed here
10 # IBM provides optimized packages for ppc64le processors in the open-ce project for mamba
11 # Currently these may not be available for venv or pip directly
12 RUN micromamba install -y -n base -c https://ftp.osuosl.org/pub/open-ce/1.11.0-p10/ -c defaults python=3.10 rust && micromamba clean --all --yes
@@ -21,7 +21,7 @@ RUN --mount=type=bind,source=.git,target=.git \
21 RUN --mount=type=cache,target=/root/.cache/pip \
22 RUSTFLAGS='-L /opt/conda/lib' pip install -v --prefer-binary --extra-index-url https://repo.fury.io/mgiessing \
23 'cmake>=3.26' ninja packaging 'setuptools-scm>=8' wheel jinja2 \
24 - -r requirements-cpu.txt \
24 + -r requirements/cpu.txt \
25 xformers uvloop==0.20.0
26
27 RUN --mount=type=bind,source=.git,target=.git \
Dockerfile.rocm
+3 -3
@@ -38,7 +38,7 @@ FROM fetch_vllm AS build_vllm
38 ARG USE_CYTHON
39 # Build vLLM
40 RUN cd vllm \
41 - && python3 -m pip install -r requirements-rocm.txt \
41 + && python3 -m pip install -r requirements/rocm.txt \
42 && python3 setup.py clean --all \
43 && if [ ${USE_CYTHON} -eq "1" ]; then python3 setup_cython.py build_ext --inplace; fi \
44 && python3 setup.py bdist_wheel --dist-dir=dist
@@ -60,7 +60,7 @@ RUN python3 -m pip install --upgrade pip && rm -rf /var/lib/apt/lists/*
60 # Install vLLM
61 RUN --mount=type=bind,from=export_vllm,src=/,target=/install \
62 cd /install \
63 - && pip install -U -r requirements-rocm.txt \
63 + && pip install -U -r requirements/rocm.txt \
64 && pip uninstall -y vllm \
65 && pip install *.whl
66
@@ -99,7 +99,7 @@ RUN if [ ${BUILD_RPD} -eq "1" ]; then \
99 # Install vLLM
100 RUN --mount=type=bind,from=export_vllm,src=/,target=/install \
101 cd /install \
102 - && pip install -U -r requirements-rocm.txt \
102 + && pip install -U -r requirements/rocm.txt \
103 && pip uninstall -y vllm \
104 && pip install *.whl
105
Dockerfile.s390x
+4 -4
@@ -58,7 +58,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \
58 cd ../../python && \
59 export PYARROW_PARALLEL=4 && \
60 export ARROW_BUILD_TYPE=release && \
61 - uv pip install -r requirements-build.txt && \
61 + uv pip install -r requirements/build.txt && \
62 python setup.py build_ext --build-type=$ARROW_BUILD_TYPE --bundle-arrow-cpp bdist_wheel
63
64 FROM python-install AS numa-build
@@ -120,7 +120,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \
120 --mount=type=bind,from=rust,source=/root/.rustup,target=/root/.rustup,rw \
121 --mount=type=bind,from=pyarrow,source=/tmp/arrow/python/dist,target=/tmp/arrow-wheels \
122 --mount=type=bind,from=torch-vision,source=/tmp/vision/dist,target=/tmp/vision-wheels/ \
123 - sed -i '/^torch/d' requirements-build.txt && \
123 + sed -i '/^torch/d' requirements/build.txt && \
124 ARROW_WHL_FILE=$(ls /tmp/arrow-wheels/pyarrow-*.whl | head -n 1) && \
125 VISION_WHL_FILE=$(ls /tmp/vision-wheels/*.whl | head -n 1) && \
126 uv pip install -v \
@@ -128,8 +128,8 @@ RUN --mount=type=cache,target=/root/.cache/uv \
128 $VISION_WHL_FILE \
129 --extra-index-url https://download.pytorch.org/whl/nightly/cpu \
130 --index-strategy unsafe-best-match \
131 - -r requirements-build.txt \
132 - -r requirements-cpu.txt
131 + -r requirements/build.txt \
132 + -r requirements/cpu.txt
133
134 # Build and install vllm
135 RUN --mount=type=cache,target=/root/.cache/uv \
Dockerfile.tpu
+1 -1
@@ -19,7 +19,7 @@ ENV VLLM_TARGET_DEVICE="tpu"
19 RUN --mount=type=cache,target=/root/.cache/pip \
20 --mount=type=bind,source=.git,target=.git \
21 python3 -m pip install \
22 - -r requirements-tpu.txt
22 + -r requirements/tpu.txt
23 RUN python3 setup.py develop
24
25 # install development dependencies (for testing)
Dockerfile.xpu
+3 -3
@@ -25,12 +25,12 @@ RUN apt-get update -y && \
25 wget
26
27 WORKDIR /workspace/vllm
28 -COPY requirements-xpu.txt /workspace/vllm/requirements-xpu.txt
29 -COPY requirements-common.txt /workspace/vllm/requirements-common.txt
28 +COPY requirements/xpu.txt /workspace/vllm/requirements/xpu.txt
29 +COPY requirements/common.txt /workspace/vllm/requirements/common.txt
30
31 RUN --mount=type=cache,target=/root/.cache/pip \
32 pip install --no-cache-dir \
33 - -r requirements-xpu.txt
33 + -r requirements/xpu.txt
34
35 RUN git clone https://github.com/intel/pti-gpu && \
36 cd pti-gpu/sdk && \
MANIFEST.in
+5 -5
@@ -1,9 +1,9 @@
1 include LICENSE
2 -include requirements-common.txt
3 -include requirements-cuda.txt
4 -include requirements-rocm.txt
5 -include requirements-neuron.txt
6 -include requirements-cpu.txt
2 +include requirements/common.txt
3 +include requirements/cuda.txt
4 +include requirements/rocm.txt
5 +include requirements/neuron.txt
6 +include requirements/cpu.txt
7 include CMakeLists.txt
8
9 recursive-include cmake *
docs/README.md
+1 -1
@@ -4,7 +4,7 @@
4
5 ```bash
6 # Install dependencies.
7 -pip install -r requirements-docs.txt
7 +pip install -r ../requirements/docs.txt
8
9 # Build the docs.
10 make clean
docs/source/contributing/overview.md
+1 -1
@@ -23,7 +23,7 @@ Check out the [building from source](#build-from-source) documentation for detai
23 ## Testing
24
25 ```bash
26 -pip install -r requirements-dev.txt
26 +pip install -r requirements/dev.txt
27
28 # Linting, formatting and static type checking
29 pre-commit install --hook-type pre-commit --hook-type commit-msg
docs/source/getting_started/installation/ai_accelerator/hpu-gaudi.inc.md
+2 -2
@@ -63,7 +63,7 @@ To build and install vLLM from source, run:
63 ```console
64 git clone https://github.com/vllm-project/vllm.git
65 cd vllm
66 -pip install -r requirements-hpu.txt
66 +pip install -r requirements/hpu.txt
67 python setup.py develop
68 ```
69
@@ -73,7 +73,7 @@ Currently, the latest features and performance optimizations are developed in Ga
73 git clone https://github.com/HabanaAI/vllm-fork.git
74 cd vllm-fork
75 git checkout habana_main
76 -pip install -r requirements-hpu.txt
76 +pip install -r requirements/hpu.txt
77 python setup.py develop
78 ```
79
docs/source/getting_started/installation/ai_accelerator/neuron.inc.md
+1 -1
@@ -116,7 +116,7 @@ Once neuronx-cc and transformers-neuronx packages are installed, we will be able
116 ```console
117 git clone https://github.com/vllm-project/vllm.git
118 cd vllm
119 -pip install -U -r requirements-neuron.txt
119 +pip install -U -r requirements/neuron.txt
120 VLLM_TARGET_DEVICE="neuron" pip install .
121 ```
122
docs/source/getting_started/installation/ai_accelerator/openvino.inc.md
+1 -1
@@ -32,7 +32,7 @@ Second, clone vLLM and install prerequisites for the vLLM OpenVINO backend insta
32 ```console
33 git clone https://github.com/vllm-project/vllm.git
34 cd vllm
35 -pip install -r requirements-build.txt --extra-index-url https://download.pytorch.org/whl/cpu
35 +pip install -r requirements/build.txt --extra-index-url https://download.pytorch.org/whl/cpu
36 ```
37
38 Finally, install vLLM with OpenVINO backend:
docs/source/getting_started/installation/ai_accelerator/tpu.inc.md
+1 -1
@@ -151,7 +151,7 @@ pip uninstall torch torch-xla -y
151 Install build dependencies:
152
153 ```bash
154 -pip install -r requirements-tpu.txt
154 +pip install -r requirements/tpu.txt
155 sudo apt-get install libopenblas-base libopenmpi-dev libomp-dev
156 ```
157
docs/source/getting_started/installation/cpu/apple.inc.md
+1 -1
@@ -25,7 +25,7 @@ After installation of XCode and the Command Line Tools, which include Apple Clan
25 ```console
26 git clone https://github.com/vllm-project/vllm.git
27 cd vllm
28 -pip install -r requirements-cpu.txt
28 +pip install -r requirements/cpu.txt
29 pip install -e .
30 ```
31
docs/source/getting_started/installation/cpu/build.inc.md
+1 -1
@@ -18,7 +18,7 @@ Third, install Python packages for vLLM CPU backend building:
18 ```console
19 pip install --upgrade pip
20 pip install "cmake>=3.26" wheel packaging ninja "setuptools-scm>=8" numpy
21 -pip install -v -r requirements-cpu.txt --extra-index-url https://download.pytorch.org/whl/cpu
21 +pip install -v -r requirements/cpu.txt --extra-index-url https://download.pytorch.org/whl/cpu
22 ```
23
24 Finally, build and install vLLM CPU backend:
docs/source/getting_started/installation/gpu/cuda.inc.md
+1 -1
@@ -148,7 +148,7 @@ To build vLLM using an existing PyTorch installation:
148 git clone https://github.com/vllm-project/vllm.git
149 cd vllm
150 python use_existing_torch.py
151 -pip install -r requirements-build.txt
151 +pip install -r requirements/build.txt
152 pip install -e . --no-build-isolation
153 ```
154
docs/source/getting_started/installation/gpu/rocm.inc.md
+1 -1
@@ -84,7 +84,7 @@ Currently, there are no pre-built ROCm wheels.
84 # Install dependencies
85 $ pip install --upgrade numba scipy huggingface-hub[cli,hf_transfer] setuptools_scm
86 $ pip install "numpy<2"
87 - $ pip install -r requirements-rocm.txt
87 + $ pip install -r requirements/rocm.txt
88
89 # Build vLLM for MI210/MI250/MI300.
90 $ export PYTORCH_ROCM_ARCH="gfx90a;gfx942"
docs/source/getting_started/installation/gpu/xpu.inc.md
+1 -1
@@ -25,7 +25,7 @@ Currently, there are no pre-built XPU wheels.
25 ```console
26 source /opt/intel/oneapi/setvars.sh
27 pip install --upgrade pip
28 -pip install -v -r requirements-xpu.txt
28 +pip install -v -r requirements/xpu.txt
29 ```
30
31 - Finally, build and install vLLM XPU backend:
format.sh
+1 -1
@@ -1,6 +1,6 @@
1 #!/bin/bash
2
3 echo "vLLM linting system has been moved from format.sh to pre-commit hook."
4 -echo "Please run 'pip install -r requirements-lint.txt', followed by"
4 +echo "Please run 'pip install -r requirements/lint.txt', followed by"
5 echo "'pre-commit install --hook-type pre-commit --hook-type commit-msg' to install the pre-commit hook."
6 echo "Then linters will run automatically before each commit."
pyproject.toml
+1 -1
@@ -1,5 +1,5 @@
1 [build-system]
2 -# Should be mirrored in requirements-build.txt
2 +# Should be mirrored in requirements/build.txt
3 requires = [
4 "cmake>=3.26",
5 "ninja",
requirements/build.txt renamed
requirements/common.txt renamed
requirements/cpu.txt renamed
+1 -1
@@ -1,5 +1,5 @@
1 # Common dependencies
2 --r requirements-common.txt
2 +-r common.txt
3
4 # Dependencies for CPUs
5 torch==2.5.1+cpu; platform_machine != "ppc64le" and platform_machine != "aarch64" and platform_system != "Darwin" and platform_machine != "s390x"
requirements/cuda.txt renamed
+1 -1
@@ -1,5 +1,5 @@
1 # Common dependencies
2 --r requirements-common.txt
2 +-r common.txt
3
4 numba == 0.60.0 # v0.61 doesn't support Python 3.9. Required for N-gram speculative decoding
5
requirements/dev.txt renamed
+2 -2
@@ -1,5 +1,5 @@
1 --r requirements-lint.txt
2 --r requirements-test.txt
1 +-r lint.txt
2 +-r test.txt
3
4 # Avoid adding requirements directly to this file.
5 # Instead, modify the two files referenced above.
requirements/docs.txt renamed
requirements/hpu.txt renamed
+1 -1
@@ -1,5 +1,5 @@
1 # Common dependencies
2 --r requirements-common.txt
2 +-r common.txt
3
4 # Dependencies for HPU code
5 ray
requirements/lint.txt renamed
requirements/neuron.txt renamed
+1 -1
@@ -1,5 +1,5 @@
1 # Common dependencies
2 --r requirements-common.txt
2 +-r common.txt
3
4 # Dependencies for Neuron devices
5 torch-neuronx >= 2.5.0
requirements/openvino.txt renamed
+1 -1
@@ -1,5 +1,5 @@
1 # Common dependencies
2 --r requirements-common.txt
2 +-r common.txt
3
4 torch == 2.5.1 # should be aligned with "common" vLLM torch version
5 openvino >= 2024.4.0 # since 2024.4.0 both CPU and GPU support Paged Attention
requirements/rocm-build.txt renamed
+1 -1
@@ -1,5 +1,5 @@
1 # Common dependencies
2 --r requirements-common.txt
2 +-r common.txt
3
4 --extra-index-url https://download.pytorch.org/whl/rocm6.2
5 torch==2.5.1
requirements/rocm.txt renamed
+1 -1
@@ -1,5 +1,5 @@
1 # Common dependencies
2 --r requirements-common.txt
2 +-r common.txt
3
4 numba == 0.60.0 # v0.61 doesn't support Python 3.9. Required for N-gram speculative decoding
5
requirements/test.in renamed
requirements/test.txt renamed
+36 -36
@@ -1,5 +1,5 @@
1 # This file was autogenerated by uv via the following command:
2 -# uv pip compile requirements-test.in -o requirements-test.txt
2 +# uv pip compile requirements/test.in -o requirements/test.txt
3 absl-py==2.1.0
4 # via rouge-score
5 accelerate==1.0.1
@@ -32,9 +32,9 @@ attrs==24.2.0
32 audioread==3.0.1
33 # via librosa
34 awscli==1.35.23
35 - # via -r requirements-test.in
35 + # via -r requirements/test.in
36 bitsandbytes==0.45.0
37 - # via -r requirements-test.in
37 + # via -r requirements/test.in
38 black==24.10.0
39 # via datamodel-code-generator
40 boto3==1.35.57
@@ -47,7 +47,7 @@ botocore==1.35.57
47 bounded-pool-executor==0.0.3
48 # via pqdm
49 buildkite-test-collector==0.1.9
50 - # via -r requirements-test.in
50 + # via -r requirements/test.in
51 certifi==2024.8.30
52 # via
53 # httpcore
@@ -79,7 +79,7 @@ cupy-cuda12x==13.3.0
79 cycler==0.12.1
80 # via matplotlib
81 datamodel-code-generator==0.26.3
82 - # via -r requirements-test.in
82 + # via -r requirements/test.in
83 dataproperty==1.0.1
84 # via
85 # pytablewriter
@@ -91,7 +91,7 @@ datasets==3.0.2
91 decorator==5.1.1
92 # via librosa
93 decord==0.6.0
94 - # via -r requirements-test.in
94 + # via -r requirements/test.in
95 dill==0.3.8
96 # via
97 # datasets
@@ -104,7 +104,7 @@ docutils==0.16
104 # via awscli
105 einops==0.8.0
106 # via
107 - # -r requirements-test.in
107 + # -r requirements/test.in
108 # encodec
109 # vector-quantize-pytorch
110 # vocos
@@ -145,7 +145,7 @@ fsspec==2024.9.0
145 # huggingface-hub
146 # torch
147 genai-perf==0.0.8
148 - # via -r requirements-test.in
148 + # via -r requirements/test.in
149 genson==1.3.0
150 # via datamodel-code-generator
151 h11==0.14.0
@@ -155,7 +155,7 @@ hiredis==3.0.0
155 httpcore==1.0.6
156 # via httpx
157 httpx==0.27.2
158 - # via -r requirements-test.in
158 + # via -r requirements/test.in
159 huggingface-hub==0.26.2
160 # via
161 # accelerate
@@ -187,7 +187,7 @@ jinja2==3.1.4
187 # datamodel-code-generator
188 # torch
189 jiwer==3.0.5
190 - # via -r requirements-test.in
190 + # via -r requirements/test.in
191 jmespath==1.0.1
192 # via
193 # boto3
@@ -214,11 +214,11 @@ lazy-loader==0.4
214 libnacl==2.1.0
215 # via tensorizer
216 librosa==0.10.2.post1
217 - # via -r requirements-test.in
217 + # via -r requirements/test.in
218 llvmlite==0.43.0
219 # via numba
220 lm-eval==0.4.4
221 - # via -r requirements-test.in
221 + # via -r requirements/test.in
222 lxml==5.3.0
223 # via sacrebleu
224 markdown-it-py==3.0.0
@@ -226,7 +226,7 @@ markdown-it-py==3.0.0
226 markupsafe==3.0.2
227 # via jinja2
228 matplotlib==3.9.2
229 - # via -r requirements-test.in
229 + # via -r requirements/test.in
230 mbstrdecoder==1.1.3
231 # via
232 # dataproperty
@@ -235,7 +235,7 @@ mbstrdecoder==1.1.3
235 mdurl==0.1.2
236 # via markdown-it-py
237 mistral-common==1.5.1
238 - # via -r requirements-test.in
238 + # via -r requirements/test.in
239 more-itertools==10.5.0
240 # via lm-eval
241 mpmath==1.3.0
@@ -264,7 +264,7 @@ numexpr==2.10.1
264 # via lm-eval
265 numpy==1.26.4
266 # via
267 - # -r requirements-test.in
267 + # -r requirements/test.in
268 # accelerate
269 # bitsandbytes
270 # contourpy
@@ -366,7 +366,7 @@ patsy==1.0.1
366 # via statsmodels
367 peft==0.13.2
368 # via
369 - # -r requirements-test.in
369 + # -r requirements/test.in
370 # lm-eval
371 pillow==10.4.0
372 # via
@@ -388,7 +388,7 @@ pooch==1.8.2
388 portalocker==2.10.1
389 # via sacrebleu
390 pqdm==0.2.0
391 - # via -r requirements-test.in
391 + # via -r requirements/test.in
392 propcache==0.2.0
393 # via yarl
394 protobuf==5.28.3
@@ -426,7 +426,7 @@ pytablewriter==1.2.0
426 # via lm-eval
427 pytest==8.3.3
428 # via
429 - # -r requirements-test.in
429 + # -r requirements/test.in
430 # buildkite-test-collector
431 # genai-perf
432 # pytest-asyncio
@@ -435,15 +435,15 @@ pytest==8.3.3
435 # pytest-rerunfailures
436 # pytest-shard
437 pytest-asyncio==0.24.0
438 - # via -r requirements-test.in
438 + # via -r requirements/test.in
439 pytest-forked==1.6.0
440 - # via -r requirements-test.in
440 + # via -r requirements/test.in
441 pytest-mock==3.14.0
442 # via genai-perf
443 pytest-rerunfailures==14.0
444 - # via -r requirements-test.in
444 + # via -r requirements/test.in
445 pytest-shard==0.1.2
446 - # via -r requirements-test.in
446 + # via -r requirements/test.in
447 python-dateutil==2.9.0.post0
448 # via
449 # botocore
@@ -473,7 +473,7 @@ pyyaml==6.0.2
473 rapidfuzz==3.12.1
474 # via jiwer
475 ray==2.43.0
476 - # via -r requirements-test.in
476 + # via -r requirements/test.in
477 redis==5.2.0
478 # via tensorizer
479 referencing==0.35.1
@@ -512,9 +512,9 @@ rpds-py==0.20.1
512 rsa==4.7.2
513 # via awscli
514 runai-model-streamer==0.11.0
515 - # via -r requirements-test.in
515 + # via -r requirements/test.in
516 runai-model-streamer-s3==0.11.0
517 - # via -r requirements-test.in
517 + # via -r requirements/test.in
518 s3transfer==0.10.3
519 # via
520 # awscli
@@ -540,7 +540,7 @@ scipy==1.13.1
540 # statsmodels
541 # vocos
542 sentence-transformers==3.2.1
543 - # via -r requirements-test.in
543 + # via -r requirements/test.in
544 sentencepiece==0.2.0
545 # via mistral-common
546 setuptools==75.8.0
@@ -557,7 +557,7 @@ sniffio==1.3.1
557 # httpx
558 soundfile==0.12.1
559 # via
560 - # -r requirements-test.in
560 + # -r requirements/test.in
561 # librosa
562 soxr==0.5.0.post1
563 # via librosa
@@ -580,7 +580,7 @@ tenacity==9.0.0
580 # lm-eval
581 # plotly
582 tensorizer==2.9.0
583 - # via -r requirements-test.in
583 + # via -r requirements/test.in
584 threadpoolctl==3.5.0
585 # via scikit-learn
586 tiktoken==0.7.0
@@ -588,12 +588,12 @@ tiktoken==0.7.0
588 # lm-eval
589 # mistral-common
590 timm==1.0.11
591 - # via -r requirements-test.in
591 + # via -r requirements/test.in
592 tokenizers==0.21.0
593 # via transformers
594 torch==2.5.1
595 # via
596 - # -r requirements-test.in
596 + # -r requirements/test.in
597 # accelerate
598 # bitsandbytes
599 # encodec
@@ -609,7 +609,7 @@ torch==2.5.1
609 # vocos
610 torchaudio==2.5.1
611 # via
612 - # -r requirements-test.in
612 + # -r requirements/test.in
613 # encodec
614 # vocos
615 torchvision==0.20.1
@@ -630,19 +630,19 @@ tqdm-multiprocess==0.0.11
630 # via lm-eval
631 transformers==4.48.2
632 # via
633 - # -r requirements-test.in
633 + # -r requirements/test.in
634 # genai-perf
635 # lm-eval
636 # peft
637 # sentence-transformers
638 # transformers-stream-generator
639 transformers-stream-generator==0.0.5
640 - # via -r requirements-test.in
640 + # via -r requirements/test.in
641 triton==3.1.0
642 # via torch
643 tritonclient==2.51.0
644 # via
645 - # -r requirements-test.in
645 + # -r requirements/test.in
646 # genai-perf
647 typepy==1.3.2
648 # via
@@ -668,9 +668,9 @@ urllib3==2.2.3
668 # responses
669 # tritonclient
670 vector-quantize-pytorch==1.21.2
671 - # via -r requirements-test.in
671 + # via -r requirements/test.in
672 vocos==0.1.0
673 - # via -r requirements-test.in
673 + # via -r requirements/test.in
674 word2number==1.1
675 # via lm-eval
676 xxhash==3.5.0
requirements/tpu.txt renamed
+1 -1
@@ -1,5 +1,5 @@
1 # Common dependencies
2 --r requirements-common.txt
2 +-r common.txt
3
4 # Dependencies for TPU
5 cmake>=3.26
requirements/xpu.txt renamed
+1 -1
@@ -1,5 +1,5 @@
1 # Common dependencies
2 --r requirements-common.txt
2 +-r common.txt
3
4 ray >= 2.9
5 cmake>=3.26
setup.py
+12 -15
@@ -27,7 +27,7 @@ def load_module_from_path(module_name, path):
27 return module
28
29
30 -ROOT_DIR = os.path.dirname(__file__)
30 +ROOT_DIR = Path(__file__).parent
31 logger = logging.getLogger(__name__)
32
33 # cannot import envs directly because it depends on vllm,
@@ -520,10 +520,6 @@ def get_nvcc_cuda_version() -> Version:
520 return nvcc_cuda_version
521
522
523 -def get_path(*filepath) -> str:
524 - return os.path.join(ROOT_DIR, *filepath)
525 -
526 -
523 def get_gaudi_sw_version():
524 """
525 Returns the driver version.
@@ -591,9 +587,10 @@ def get_vllm_version() -> str:
587
588 def get_requirements() -> list[str]:
589 """Get Python package dependencies from requirements.txt."""
590 + requirements_dir = ROOT_DIR / "requirements"
591
592 def _read_requirements(filename: str) -> list[str]:
596 - with open(get_path(filename)) as f:
593 + with open(requirements_dir / filename) as f:
594 requirements = f.read().strip().split("\n")
595 resolved_requirements = []
596 for line in requirements:
@@ -606,9 +603,9 @@ def get_requirements() -> list[str]:
603 return resolved_requirements
604
605 if _no_device():
609 - requirements = _read_requirements("requirements-common.txt")
606 + requirements = _read_requirements("common.txt")
607 elif _is_cuda():
611 - requirements = _read_requirements("requirements-cuda.txt")
608 + requirements = _read_requirements("cuda.txt")
609 cuda_major, cuda_minor = torch.version.cuda.split(".")
610 modified_requirements = []
611 for req in requirements:
@@ -619,19 +616,19 @@ def get_requirements() -> list[str]:
616 modified_requirements.append(req)
617 requirements = modified_requirements
618 elif _is_hip():
622 - requirements = _read_requirements("requirements-rocm.txt")
619 + requirements = _read_requirements("rocm.txt")
620 elif _is_neuron():
624 - requirements = _read_requirements("requirements-neuron.txt")
621 + requirements = _read_requirements("neuron.txt")
622 elif _is_hpu():
626 - requirements = _read_requirements("requirements-hpu.txt")
623 + requirements = _read_requirements("hpu.txt")
624 elif _is_openvino():
628 - requirements = _read_requirements("requirements-openvino.txt")
625 + requirements = _read_requirements("openvino.txt")
626 elif _is_tpu():
630 - requirements = _read_requirements("requirements-tpu.txt")
627 + requirements = _read_requirements("tpu.txt")
628 elif _is_cpu():
632 - requirements = _read_requirements("requirements-cpu.txt")
629 + requirements = _read_requirements("cpu.txt")
630 elif _is_xpu():
634 - requirements = _read_requirements("requirements-xpu.txt")
631 + requirements = _read_requirements("xpu.txt")
632 else:
633 raise ValueError(
634 "Unsupported platform, please use CUDA, ROCm, Neuron, HPU, "
use_existing_torch.py
+1 -1
@@ -2,7 +2,7 @@
2
3 import glob
4
5 -requires_files = glob.glob('requirements*.txt')
5 +requires_files = glob.glob('requirements/*.txt')
6 requires_files += ["pyproject.toml"]
7 for file in requires_files:
8 print(f">>> cleaning {file}")