Skip to content

Commit bc546f7

Browse files
rzabarazeshhmellor
andauthored
[CI] Move applicable tests to CPU (#24080)
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com> Co-authored-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
1 parent 80608ba commit bc546f7

39 files changed

+136
-28
lines changed

.buildkite/test-pipeline.yaml

Lines changed: 49 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -50,19 +50,28 @@ steps:
5050
mirror_hardwares: [amdexperimental]
5151
source_file_dependencies:
5252
- vllm/
53+
- tests/multimodal
54+
- tests/utils_
55+
commands:
56+
- pytest -v -s -m 'not cpu_test' multimodal
57+
- pytest -v -s utils_
58+
59+
- label: Async Engine, Inputs, Utils, Worker Test (CPU) # 4 mins
60+
timeout_in_minutes: 10
61+
source_file_dependencies:
62+
- vllm/
5363
- tests/test_inputs.py
5464
- tests/test_outputs.py
5565
- tests/multimodal
56-
- tests/utils_
5766
- tests/standalone_tests/lazy_imports.py
5867
- tests/transformers_utils
68+
no_gpu: true
5969
commands:
6070
- python3 standalone_tests/lazy_imports.py
6171
- pytest -v -s test_inputs.py
6272
- pytest -v -s test_outputs.py
63-
- pytest -v -s multimodal
64-
- pytest -v -s utils_ # Utils
65-
- pytest -v -s transformers_utils # transformers_utils
73+
- pytest -v -s -m 'cpu_test' multimodal
74+
- pytest -v -s transformers_utils
6675

6776
- label: Python-only Installation Test # 10min
6877
timeout_in_minutes: 20
@@ -287,23 +296,34 @@ steps:
287296
- tests/v1
288297
commands:
289298
# split the test to avoid interference
290-
- pytest -v -s v1/core
291299
- pytest -v -s v1/executor
292300
- pytest -v -s v1/kv_offload
293301
- pytest -v -s v1/sample
294302
- pytest -v -s v1/logits_processors
295303
- pytest -v -s v1/worker
296-
- pytest -v -s v1/structured_output
297304
- pytest -v -s v1/spec_decode
298-
- pytest -v -s v1/kv_connector/unit
299-
- pytest -v -s v1/metrics
305+
- pytest -v -s -m 'not cpu_test' v1/kv_connector/unit
306+
- pytest -v -s -m 'not cpu_test' v1/metrics
300307
- pytest -v -s v1/test_oracle.py
301308
- pytest -v -s v1/test_request.py
302-
- pytest -v -s v1/test_serial_utils.py
303309
# Integration test for streaming correctness (requires special branch).
304310
- pip install -U git+https://github.com/robertgshaw2-redhat/lm-evaluation-harness.git@streaming-api
305311
- pytest -v -s entrypoints/openai/correctness/test_lmeval.py::test_lm_eval_accuracy_v1_engine
306312

313+
- label: V1 Test others (CPU) # 5 mins
314+
source_file_dependencies:
315+
- vllm/
316+
- tests/v1
317+
no_gpu: true
318+
commands:
319+
# split the test to avoid interference
320+
- pytest -v -s v1/core
321+
- pytest -v -s v1/structured_output
322+
- pytest -v -s v1/test_serial_utils.py
323+
- pytest -v -s -m 'cpu_test' v1/kv_connector/unit
324+
- pytest -v -s -m 'cpu_test' v1/metrics
325+
326+
307327
- label: Examples Test # 30min
308328
timeout_in_minutes: 45
309329
mirror_hardwares: [amdexperimental]
@@ -533,10 +553,17 @@ steps:
533553
source_file_dependencies:
534554
- vllm/
535555
- tests/tool_use
536-
- tests/mistral_tool_use
537556
commands:
538-
- pytest -v -s tool_use
539-
- pytest -v -s mistral_tool_use
557+
- pytest -v -s -m 'not cpu_test' tool_use
558+
559+
- label: OpenAI-Compatible Tool Use (CPU) # 5 mins
560+
timeout_in_minutes: 10
561+
source_file_dependencies:
562+
- vllm/
563+
- tests/tool_use
564+
no_gpu: true
565+
commands:
566+
- pytest -v -s -m 'cpu_test' tool_use
540567

541568
##### models test #####
542569

@@ -576,13 +603,19 @@ steps:
576603
- vllm/
577604
- tests/models/test_transformers.py
578605
- tests/models/test_registry.py
606+
commands:
607+
- pytest -v -s models/test_transformers.py models/test_registry.py
608+
609+
- label: Basic Models Test (Other CPU) # 5min
610+
timeout_in_minutes: 10
611+
torch_nightly: true
612+
source_file_dependencies:
613+
- vllm/
579614
- tests/models/test_utils.py
580615
- tests/models/test_vision.py
616+
no_gpu: true
581617
commands:
582-
- pytest -v -s models/test_transformers.py \
583-
models/test_registry.py \
584-
models/test_utils.py \
585-
models/test_vision.py
618+
- pytest -v -s models/test_utils.py models/test_vision.py
586619

587620
- label: Language Models Tests (Standard)
588621
timeout_in_minutes: 25

.github/mergify.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,6 @@ pull_request_rules:
239239
conditions:
240240
- or:
241241
- files~=^tests/tool_use/
242-
- files~=^tests/mistral_tool_use/
243242
- files~=^tests/entrypoints/openai/tool_parsers/
244243
- files=tests/entrypoints/openai/test_chat_with_tool_reasoning.py
245244
- files~=^vllm/entrypoints/openai/tool_parsers/

docker/Dockerfile.cpu

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ ENV PATH="$VIRTUAL_ENV/bin:$PATH"
4747

4848
ENV UV_HTTP_TIMEOUT=500
4949

50-
# Install Python dependencies
50+
# Install Python dependencies
5151
ENV PIP_EXTRA_INDEX_URL=${PIP_EXTRA_INDEX_URL}
5252
ENV UV_EXTRA_INDEX_URL=${PIP_EXTRA_INDEX_URL}
5353
ENV UV_INDEX_STRATEGY="unsafe-best-match"
@@ -104,7 +104,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \
104104
--mount=type=cache,target=/root/.cache/ccache \
105105
--mount=type=cache,target=/workspace/vllm/.deps,sharing=locked \
106106
--mount=type=bind,source=.git,target=.git \
107-
VLLM_TARGET_DEVICE=cpu python3 setup.py bdist_wheel
107+
VLLM_TARGET_DEVICE=cpu python3 setup.py bdist_wheel
108108

109109
######################### TEST DEPS #########################
110110
FROM base AS vllm-test-deps
@@ -117,7 +117,7 @@ RUN --mount=type=bind,src=requirements/test.in,target=requirements/test.in \
117117
uv pip compile requirements/cpu-test.in -o requirements/cpu-test.txt --index-strategy unsafe-best-match --torch-backend cpu
118118

119119
RUN --mount=type=cache,target=/root/.cache/uv \
120-
uv pip install -r requirements/cpu-test.txt
120+
uv pip install -r requirements/cpu-test.txt
121121

122122
######################### DEV IMAGE #########################
123123
FROM vllm-build AS vllm-dev
@@ -130,12 +130,12 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
130130

131131
# install development dependencies (for testing)
132132
RUN --mount=type=cache,target=/root/.cache/uv \
133-
uv pip install -e tests/vllm_test_utils
133+
uv pip install -e tests/vllm_test_utils
134134

135135
RUN --mount=type=cache,target=/root/.cache/uv \
136136
--mount=type=cache,target=/root/.cache/ccache \
137137
--mount=type=bind,source=.git,target=.git \
138-
VLLM_TARGET_DEVICE=cpu python3 setup.py develop
138+
VLLM_TARGET_DEVICE=cpu python3 setup.py develop
139139

140140
COPY --from=vllm-test-deps /workspace/vllm/requirements/cpu-test.txt requirements/test.txt
141141

@@ -160,11 +160,12 @@ ADD ./benchmarks/ ./benchmarks/
160160
ADD ./vllm/collect_env.py .
161161
ADD ./.buildkite/ ./.buildkite/
162162

163+
# Create symlink for vllm-workspace to maintain CI compatibility
164+
RUN ln -sf /workspace /vllm-workspace
165+
163166
# install development dependencies (for testing)
164167
RUN --mount=type=cache,target=/root/.cache/uv \
165-
uv pip install -e tests/vllm_test_utils
166-
167-
ENTRYPOINT ["bash"]
168+
uv pip install -e tests/vllm_test_utils
168169

169170
######################### RELEASE IMAGE #########################
170171
FROM base AS vllm-openai

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ markers = [
126126
"core_model: enable this model test in each PR instead of only nightly",
127127
"hybrid_model: models that contain mamba layers (including pure SSM and hybrid architectures)",
128128
"cpu_model: enable this model test in CPU tests",
129+
"cpu_test: mark test as CPU-only test",
129130
"split: run this test as part of a split",
130131
"distributed: run this test only in distributed GPU tests",
131132
"skip_v1: do not run this test with v1",

tests/models/test_utils.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
# SPDX-License-Identifier: Apache-2.0
22
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
33

4+
import pytest
45
import torch
56

67
from vllm.model_executor.models.utils import AutoWeightsLoader
78

9+
pytestmark = pytest.mark.cpu_test
10+
811

912
class ModuleWithBatchNorm(torch.nn.Module):
1013

tests/models/test_vision.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
from vllm.platforms import current_platform
1717
from vllm.utils import get_open_port, update_environment_variables
1818

19+
pytestmark = pytest.mark.cpu_test
20+
1921

2022
@pytest.mark.parametrize(
2123
("select_layers", "num_layers_loaded", "max_possible_layers",

tests/multimodal/test_cache.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
MultiModalSharedField)
2020
from vllm.multimodal.processing import PromptInsertion
2121

22+
pytestmark = pytest.mark.cpu_test
23+
2224

2325
def _dummy_elem(
2426
modality: str,

tests/multimodal/test_hasher.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
from vllm.multimodal.hasher import MultiModalHasher
1212

13+
pytestmark = pytest.mark.cpu_test
14+
1315
ASSETS_DIR = Path(__file__).parent / "assets"
1416
assert ASSETS_DIR.exists()
1517

tests/multimodal/test_image.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
from vllm.multimodal.image import ImageMediaIO, convert_image_mode
1010

11+
pytestmark = pytest.mark.cpu_test
12+
1113
ASSETS_DIR = Path(__file__).parent / "assets"
1214
assert ASSETS_DIR.exists()
1315

tests/multimodal/test_inputs.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
# SPDX-License-Identifier: Apache-2.0
22
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
33

4+
import pytest
45
import torch
56

67
from vllm.multimodal.inputs import MultiModalKwargs, NestedTensors
78

9+
pytestmark = pytest.mark.cpu_test
10+
811

912
def assert_nested_tensors_equal(expected: NestedTensors,
1013
actual: NestedTensors):

0 commit comments

Comments
 (0)