Skip to content

Commit 84d1633

Browse files
committed
Merge branch 'main' into fix-scheduler-regression
Signed-off-by: Wallas Santos <[email protected]>
2 parents 5fb35ad + e355aa7 commit 84d1633

21 files changed

+3726
-199
lines changed

.github/workflows/codespell.yml

Lines changed: 0 additions & 50 deletions
This file was deleted.

.github/workflows/ruff.yml renamed to .github/workflows/lint_code.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: ruff
1+
name: lint code
22

33
on:
44
# Trigger the workflow on push or pull request,
@@ -36,17 +36,24 @@ jobs:
3636
steps:
3737
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3838
- name: Set up Python ${{ matrix.python-version }}
39-
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
39+
uses: astral-sh/setup-uv@v5
4040
with:
4141
python-version: ${{ matrix.python-version }}
4242
- name: Install dependencies
43-
run: |
44-
python -m pip install --upgrade pip
45-
pip install -r requirements-lint.txt
43+
run: uv sync --frozen --only-group lint
4644
- name: Analysing the code with ruff
4745
run: |
4846
echo "::add-matcher::.github/workflows/matchers/ruff.json"
4947
ruff check --output-format github .
5048
- name: Run isort
51-
run: |
52-
isort . --check-only
49+
# using `always()` here ensures all the checks run even if previous
50+
# checks fail
51+
if: always()
52+
run: isort . --check-only
53+
- name: run yapf
54+
if: always()
55+
run: yapf --diff --recursive .
56+
- name: Spelling check with codespell
57+
if: always()
58+
run: codespell --toml pyproject.toml
59+

.github/workflows/reminder_comment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
owner: context.repo.owner,
1616
repo: context.repo.repo,
1717
issue_number: context.issue.number,
18-
body: "👋 Hi! Thank you for contributing to vLLM support on Spyre.\n Just a reminder: Make sure that your code passes all the linting checks, otherwise your PR won't be able to be merged. To do so, first install the linting requirements, then run `format.sh` and commit the changes:\n```\npip install -r requirements-lint.txt\nbash format.sh\n```\nNow you are good to go 🚀"
18+
body: "👋 Hi! Thank you for contributing to vLLM support on Spyre.\n Just a reminder: Make sure that your code passes all the linting checks, otherwise your PR won't be able to be merged. To do so, first install the linting requirements, then run `format.sh` and commit the changes. This can be done with `uv` directly: \n```\nuv sync --frozen --group lint\n```\n Or this can be done with `pip`: \n```\nuv pip compile --group lint > requirements-lint.txt\npip install -r requirements-lint.txt\nbash format.sh\n```\nNow you are good to go 🚀"
1919
})
2020
env:
2121
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test-spyre.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- name: Run Spyre tests within docker container
1313
run: |
1414
docker run -i --rm --entrypoint /bin/bash vllm-spyre -c '''
15-
pip install pytest sentence-transformers pytest-timeout pytest-forked && \
15+
source vllm-spyre/.venv/bin/activate && \
1616
python -c "from transformers import pipeline; pipeline(\"text-generation\", model=\"JackFram/llama-160m\")" && \
1717
export VARIANT=$(ls /root/.cache/huggingface/hub/models--JackFram--llama-160m/snapshots/) && \
1818
mkdir -p /models && \

.github/workflows/yapf.yml

Lines changed: 0 additions & 42 deletions
This file was deleted.

.yapfignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
11
vllm_spyre/model_executor/model_loader/spyre_setup.py
2+
.venv
3+
.conda
4+
.mypy_cache
5+
.pytest_cache

Dockerfile.spyre

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,19 @@ RUN microdnf update -y && microdnf install -y \
1515
RUN ln -sf $(which python${PYTHON_VERSION}) /usr/bin/python && \
1616
ln -sf $(which pip${PYTHON_VERSION}) /usr/bin/pip
1717

18-
ENV VLLM_REVISION=5f063a80bda621da09e73fc63d4c59320259131d
19-
# Download and install vllm ###########################################################
20-
RUN git clone --depth 1 https://github.com/vllm-project/vllm.git \
21-
&& cd vllm \
22-
&& git fetch --depth 1 origin ${VLLM_REVISION} \
23-
&& git checkout ${VLLM_REVISION} \
24-
&& python -m pip install --upgrade pip \
25-
&& pip3 install torch=="2.5.1+cpu" --index-url https://download.pytorch.org/whl/cpu \
26-
&& python use_existing_torch.py \
27-
&& pip install -r requirements/build.txt \
28-
&& SETUPTOOLS_SCM_PRETEND_VERSION=0.8.0 VLLM_TARGET_DEVICE=empty pip install --verbose . --no-build-isolation
29-
3018
# Install vllm Spyre plugin ##################################################################
3119
RUN mkdir /workspace/vllm-spyre
3220
COPY . /workspace/vllm-spyre
33-
RUN cd /workspace/vllm-spyre && pip install -v -e .
21+
# Torch must be installed first
22+
RUN pip install torch==2.5.1+cpu --index-url https://download.pytorch.org/whl/cpu
23+
# Install uv
24+
RUN pip install uv
25+
# Install the plugin in a new venv, along with dev deps to test with
26+
RUN cd /workspace/vllm-spyre \
27+
&& uv venv .venv --system-site-packages \
28+
&& source .venv/bin/activate \
29+
&& VLLM_TARGET_DEVICE=empty uv pip install -v -e . --system \
30+
&& uv sync --frozen --group dev
3431
ENV VLLM_PLUGINS=spyre
3532

3633
CMD ["/bin/bash"]

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,17 @@ docker run -it --rm vllm-spyre bash
2222

2323
### In a local environment
2424

25+
We use the [uv](https://docs.astral.sh/uv/) package manager to manage the
26+
installation of the plugin and its dependencies. `uv` provides advanced
27+
dependency resolution which is required to properly install dependencies like
28+
`vllm` without overwriting critical dependencies like `torch`.
29+
2530
```
26-
# Install vllm
27-
pip install vllm==0.8.0
31+
# Install uv
32+
pip install uv
2833
2934
# Install vllm-spyre
30-
cd ..
3135
git clone https://github.com/vllm-project/vllm-spyre.git
3236
cd vllm-spyre
33-
pip install -v -e .
37+
VLLM_TARGET_DEVICE=empty uv pip install -e .
3438
```

format.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ PYMARKDOWNLNT_VERSION=$(pymarkdownlnt version | awk '{print $1}')
4343

4444
# params: tool name, tool version, required version
4545
tool_version_check() {
46-
expected=$(grep "$1" requirements-lint.txt | cut -d'=' -f3)
46+
expected=$(grep "\"$1" pyproject.toml | cut -d'=' -f3 | cut -d'"' -f1)
4747
if [[ "$2" != "$expected" ]]; then
4848
echo "❓❓Wrong $1 version installed: $expected is required, not $2."
4949
exit 1

pyproject.toml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,46 @@
1+
[build-system]
2+
requires = [
3+
"setuptools>=48",
4+
]
5+
build-backend = "setuptools.build_meta"
6+
7+
[project]
8+
name = "vllm-spyre"
9+
description = "vLLM plugin for Spyre hardware support"
10+
readme = "README.md"
11+
license = {text = "Apache 2"}
12+
version = "0.0.0" # TODO dynamic versioning
13+
dependencies = [
14+
"fms-model-optimizer>=0.2.0",
15+
"ibm-fms==0.0.8",
16+
"vllm",
17+
]
18+
19+
[project.entry-points."vllm.platform_plugins"]
20+
spyre = "vllm_spyre:register"
21+
22+
[tool.setuptools.packages.find]
23+
where = ["."] # list of folders that contain the packages (["."] by default)
24+
include = ["vllm_spyre"] # package names should match these glob patterns (["*"] by default)
25+
exclude = [] # exclude packages matching these glob patterns (empty by default)
26+
namespaces = false # to disable scanning PEP 420 namespaces (true by default)
27+
28+
129
[tool.setuptools_scm]
230
# version_file = "vllm_spyre/_version.py" # currently handled by `setup.py:get_version()`
331

32+
[tool.uv]
33+
# Never install torch, so that no dependencies can override it.
34+
# This requires that torch is installed separately in the target environment
35+
override-dependencies = [
36+
"torch; sys_platform == 'never'",
37+
"torchaudio; sys_platform == 'never'",
38+
"torchvision; sys_platform == 'never'",
39+
]
40+
41+
[tool.uv.sources]
42+
vllm = { git = "https://github.com/vllm-project/vllm", rev = "v0.8.0" }
43+
444
[tool.ruff]
545
# Allow lines to be as long as 80.
646
line-length = 80
@@ -78,3 +118,26 @@ plugins.md013.enabled = false # line-length
78118
plugins.md041.enabled = false # first-line-h1
79119
plugins.md033.enabled = false # inline-html
80120
plugins.md024.allow_different_nesting = true # no-duplicate-headers
121+
122+
[dependency-groups]
123+
dev = [
124+
"pytest==8.3.4",
125+
"pytest-forked==1.6.0",
126+
"pytest-timeout==2.3.1",
127+
"requests==2.32.3",
128+
"sentence-transformers==3.4.1",
129+
]
130+
lint = [
131+
"clang-format==18.1.5",
132+
"codespell==2.3.0",
133+
"isort==5.13.2",
134+
"mypy==1.11.1",
135+
"pymarkdownlnt==0.9.26",
136+
"ruff==0.6.5",
137+
"toml==0.10.2",
138+
"tomli==2.0.2",
139+
"types-pyyaml>=6.0.12.20250326",
140+
"types-requests>=2.32.0.20250328",
141+
"types-setuptools>=77.0.2.20250328",
142+
"yapf==0.43.0",
143+
]

0 commit comments

Comments
 (0)