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 6, 14:30 UTC
[Refactor] Relocate completion and chat completion tests (#37125)
Signed-off-by: sfeng33 <4florafeng@gmail.com>
Flora Feng committed
Mar 16, 2026 at 23:31 UTC
384dc7f77b61ba98555df11c122fae759d6ef97e
26 files changed
+41
-48
.buildkite/scripts/hardware_ci/run-amd-test.sh
+4
-4
@@ -333,15 +333,15 @@ apply_rocm_test_overrides() {
333
# --- Entrypoint ignores ---
334
if [[ $cmds == *" entrypoints/openai "* ]]; then
335
cmds=${cmds//" entrypoints/openai "/" entrypoints/openai \
336
- --ignore=entrypoints/openai/test_audio.py \
337
- --ignore=entrypoints/openai/test_shutdown.py \
336
+ --ignore=entrypoints/openai/chat_completion/test_audio.py \
337
+ --ignore=entrypoints/openai/completion/test_shutdown.py \
338
--ignore=entrypoints/openai/test_completion.py \
339
--ignore=entrypoints/openai/test_models.py \
340
--ignore=entrypoints/openai/test_lora_adapters.py \
341
--ignore=entrypoints/openai/test_return_tokens_as_ids.py \
342
- --ignore=entrypoints/openai/test_root_path.py \
342
+ --ignore=entrypoints/openai/chat_completion/test_root_path.py \
343
--ignore=entrypoints/openai/test_tokenization.py \
344
- --ignore=entrypoints/openai/test_prompt_validation.py "}
344
+ --ignore=entrypoints/openai/completion/test_prompt_validation.py "}
345
fi
346
347
if [[ $cmds == *" entrypoints/llm "* ]]; then
.buildkite/test-amd.yaml
+12
-12
@@ -162,7 +162,7 @@ steps:
162
- tests/entrypoints/test_chat_utils
163
commands:
164
- export VLLM_WORKER_MULTIPROC_METHOD=spawn
165
- - pytest -v -s entrypoints/openai --ignore=entrypoints/openai/test_chat_with_tool_reasoning.py --ignore=entrypoints/openai/test_oot_registration.py --ignore=entrypoints/openai/test_tensorizer_entrypoint.py --ignore=entrypoints/openai/correctness/ --ignore=entrypoints/openai/tool_parsers/ --ignore=entrypoints/openai/responses
165
+ - pytest -v -s entrypoints/openai --ignore=entrypoints/openai/chat_completion/test_chat_with_tool_reasoning.py --ignore=entrypoints/openai/chat_completion/test_oot_registration.py --ignore=entrypoints/openai/completion/test_tensorizer_entrypoint.py --ignore=entrypoints/openai/correctness/ --ignore=entrypoints/openai/tool_parsers/ --ignore=entrypoints/openai/responses
166
- pytest -v -s entrypoints/test_chat_utils.py
167
168
- label: Entrypoints Integration Test (API Server 2)
@@ -674,12 +674,12 @@ steps:
674
- vllm/config/model.py
675
- vllm/model_executor
676
- tests/model_executor
677
- - tests/entrypoints/openai/test_tensorizer_entrypoint.py
677
+ - tests/entrypoints/openai/completion/test_tensorizer_entrypoint.py
678
commands:
679
- apt-get update && apt-get install -y curl libsodium23
680
- export VLLM_WORKER_MULTIPROC_METHOD=spawn
681
- pytest -v -s model_executor
682
- - pytest -v -s entrypoints/openai/test_tensorizer_entrypoint.py
682
+ - pytest -v -s entrypoints/openai/completion/test_tensorizer_entrypoint.py
683
684
- label: Benchmarks # 11min
685
timeout_in_minutes: 20
@@ -1143,7 +1143,7 @@ steps:
1143
- pytest -v -s plugins_tests/test_scheduler_plugins.py
1144
- pip install -e ./plugins/vllm_add_dummy_model
1145
- pytest -v -s distributed/test_distributed_oot.py
1146
- - pytest -v -s entrypoints/openai/test_oot_registration.py
1146
+ - pytest -v -s entrypoints/openai/chat_completion/test_oot_registration.py
1147
- pytest -v -s models/test_oot_registration.py
1148
- pytest -v -s plugins/lora_resolvers
1149
@@ -1502,7 +1502,7 @@ steps:
1502
- tests/entrypoints/test_chat_utils
1503
commands:
1504
- export VLLM_WORKER_MULTIPROC_METHOD=spawn
1505
- - pytest -v -s entrypoints/openai --ignore=entrypoints/openai/test_chat_with_tool_reasoning.py --ignore=entrypoints/openai/test_oot_registration.py --ignore=entrypoints/openai/test_tensorizer_entrypoint.py --ignore=entrypoints/openai/correctness/ --ignore=entrypoints/openai/tool_parsers/ --ignore=entrypoints/openai/responses
1505
+ - pytest -v -s entrypoints/openai --ignore=entrypoints/openai/chat_completion/test_chat_with_tool_reasoning.py --ignore=entrypoints/openai/chat_completion/test_oot_registration.py --ignore=entrypoints/openai/completion/test_tensorizer_entrypoint.py --ignore=entrypoints/openai/correctness/ --ignore=entrypoints/openai/tool_parsers/ --ignore=entrypoints/openai/responses
1506
- pytest -v -s entrypoints/test_chat_utils.py
1507
1508
- label: Entrypoints Integration Test (API Server 2)
@@ -2133,12 +2133,12 @@ steps:
2133
- vllm/config/model.py
2134
- vllm/model_executor
2135
- tests/model_executor
2136
- - tests/entrypoints/openai/test_tensorizer_entrypoint.py
2136
+ - tests/entrypoints/openai/completion/test_tensorizer_entrypoint.py
2137
commands:
2138
- apt-get update && apt-get install -y curl libsodium23
2139
- export VLLM_WORKER_MULTIPROC_METHOD=spawn
2140
- pytest -v -s model_executor
2141
- - pytest -v -s entrypoints/openai/test_tensorizer_entrypoint.py
2141
+ - pytest -v -s entrypoints/openai/completion/test_tensorizer_entrypoint.py
2142
2143
- label: Benchmarks # 11min
2144
timeout_in_minutes: 20
@@ -2735,7 +2735,7 @@ steps:
2735
- pytest -v -s plugins_tests/test_scheduler_plugins.py
2736
- pip install -e ./plugins/vllm_add_dummy_model
2737
- pytest -v -s distributed/test_distributed_oot.py
2738
- - pytest -v -s entrypoints/openai/test_oot_registration.py # it needs a clean process
2738
+ - pytest -v -s entrypoints/openai/chat_completion/test_oot_registration.py # it needs a clean process
2739
- pytest -v -s models/test_oot_registration.py # it needs a clean process
2740
- pytest -v -s plugins/lora_resolvers # unit tests for in-tree lora resolver plugins
2741
@@ -3257,7 +3257,7 @@ steps:
3257
- tests/entrypoints/test_chat_utils
3258
commands:
3259
- export VLLM_WORKER_MULTIPROC_METHOD=spawn
3260
- - pytest -v -s entrypoints/openai --ignore=entrypoints/openai/test_chat_with_tool_reasoning.py --ignore=entrypoints/openai/test_oot_registration.py --ignore=entrypoints/openai/test_tensorizer_entrypoint.py --ignore=entrypoints/openai/correctness/ --ignore=entrypoints/openai/tool_parsers/ --ignore=entrypoints/openai/responses
3260
+ - pytest -v -s entrypoints/openai --ignore=entrypoints/openai/chat_completion/test_chat_with_tool_reasoning.py --ignore=entrypoints/openai/chat_completion/test_oot_registration.py --ignore=entrypoints/openai/completion/test_tensorizer_entrypoint.py --ignore=entrypoints/openai/correctness/ --ignore=entrypoints/openai/tool_parsers/ --ignore=entrypoints/openai/responses
3261
- pytest -v -s entrypoints/test_chat_utils.py
3262
3263
- label: Entrypoints Integration Test (API Server 2)
@@ -3872,12 +3872,12 @@ steps:
3872
- vllm/config/model.py
3873
- vllm/model_executor
3874
- tests/model_executor
3875
- - tests/entrypoints/openai/test_tensorizer_entrypoint.py
3875
+ - tests/entrypoints/openai/completion/test_tensorizer_entrypoint.py
3876
commands:
3877
- apt-get update && apt-get install -y curl libsodium23
3878
- export VLLM_WORKER_MULTIPROC_METHOD=spawn
3879
- pytest -v -s model_executor
3880
- - pytest -v -s entrypoints/openai/test_tensorizer_entrypoint.py
3880
+ - pytest -v -s entrypoints/openai/completion/test_tensorizer_entrypoint.py
3881
3882
- label: Benchmarks # 11min
3883
timeout_in_minutes: 20
@@ -4508,7 +4508,7 @@ steps:
4508
- pytest -v -s plugins_tests/test_scheduler_plugins.py
4509
- pip install -e ./plugins/vllm_add_dummy_model
4510
- pytest -v -s distributed/test_distributed_oot.py
4511
- - pytest -v -s entrypoints/openai/test_oot_registration.py # it needs a clean process
4511
+ - pytest -v -s entrypoints/openai/chat_completion/test_oot_registration.py # it needs a clean process
4512
- pytest -v -s models/test_oot_registration.py # it needs a clean process
4513
- pytest -v -s plugins/lora_resolvers # unit tests for in-tree lora resolver plugins
4514
.buildkite/test_areas/entrypoints.yaml
+1
-1
@@ -34,7 +34,7 @@ steps:
34
- tests/entrypoints/test_chat_utils
35
commands:
36
- export VLLM_WORKER_MULTIPROC_METHOD=spawn
37
- - pytest -v -s entrypoints/openai --ignore=entrypoints/openai/chat_completion/test_chat_with_tool_reasoning.py --ignore=entrypoints/openai/test_oot_registration.py --ignore=entrypoints/openai/test_tensorizer_entrypoint.py --ignore=entrypoints/openai/correctness/ --ignore=entrypoints/openai/tool_parsers/ --ignore=entrypoints/openai/responses
37
+ - pytest -v -s entrypoints/openai --ignore=entrypoints/openai/chat_completion/test_chat_with_tool_reasoning.py --ignore=entrypoints/openai/chat_completion/test_oot_registration.py --ignore=entrypoints/openai/completion/test_tensorizer_entrypoint.py --ignore=entrypoints/openai/correctness/ --ignore=entrypoints/openai/tool_parsers/ --ignore=entrypoints/openai/responses
38
- pytest -v -s entrypoints/test_chat_utils.py
39
mirror:
40
amd:
.buildkite/test_areas/model_executor.yaml
+2
-2
@@ -9,9 +9,9 @@ steps:
9
- vllm/config/model.py
10
- vllm/model_executor
11
- tests/model_executor
12
- - tests/entrypoints/openai/test_tensorizer_entrypoint.py
12
+ - tests/entrypoints/openai/completion/test_tensorizer_entrypoint.py
13
commands:
14
- apt-get update && apt-get install -y curl libsodium23
15
- export VLLM_WORKER_MULTIPROC_METHOD=spawn
16
- pytest -v -s model_executor
17
- - pytest -v -s entrypoints/openai/test_tensorizer_entrypoint.py
17
+ - pytest -v -s entrypoints/openai/completion/test_tensorizer_entrypoint.py
.buildkite/test_areas/plugins.yaml
+1
-1
@@ -36,6 +36,6 @@ steps:
36
- pytest -v -s plugins_tests/test_scheduler_plugins.py
37
- pip install -e ./plugins/vllm_add_dummy_model
38
- pytest -v -s distributed/test_distributed_oot.py
39
- - pytest -v -s entrypoints/openai/test_oot_registration.py # it needs a clean process
39
+ - pytest -v -s entrypoints/openai/chat_completion/test_oot_registration.py # it needs a clean process
40
- pytest -v -s models/test_oot_registration.py # it needs a clean process
41
- pytest -v -s plugins/lora_resolvers # unit tests for in-tree lora resolver plugins
.github/mergify.yml
+1
-1
@@ -381,7 +381,7 @@ pull_request_rules:
381
- or:
382
- files~=^vllm/model_executor/model_loader/tensorizer.py
383
- files~=^vllm/model_executor/model_loader/tensorizer_loader.py
384
- - files~=^tests/entrypoints/openai/test_tensorizer_entrypoint.py
384
+ - files~=^tests/entrypoints/openai/completion/test_tensorizer_entrypoint.py
385
- files~=^tests/model_executor/model_loader/tensorizer_loader/
386
actions:
387
assign:
requirements/rocm-test.txt
+1
-1
@@ -50,7 +50,7 @@ av==16.1.0
50
blobfile==3.0.0
51
# Multi-Modal Models Test
52
decord==0.6.0
53
- # video processing, required by entrypoints/openai/test_video.py
53
+ # video processing, required by entrypoints/openai/chat_completion/test_video.py
54
rapidfuzz==3.12.1
55
56
# OpenAI compatibility and testing
tests/distributed/test_distributed_oot.py
+3
-1
@@ -1,7 +1,9 @@
1
# SPDX-License-Identifier: Apache-2.0
2
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3
4
-from ..entrypoints.openai.test_oot_registration import run_and_test_dummy_opt_api_server
4
+from tests.entrypoints.openai.chat_completion.test_oot_registration import (
5
+ run_and_test_dummy_opt_api_server,
6
+)
7
8
9
def test_distributed_oot(dummy_opt_path: str):
tests/entrypoints/llm/test_chat.py
+1
-2
@@ -4,12 +4,11 @@ import weakref
4
5
import pytest
6
7
+from tests.entrypoints.openai.chat_completion.test_vision import TEST_IMAGE_ASSETS
8
from vllm import LLM
9
from vllm.distributed import cleanup_dist_env_and_memory
10
from vllm.sampling_params import SamplingParams
11
11
-from ..openai.test_vision import TEST_IMAGE_ASSETS
12
-
12
13
@pytest.fixture(scope="function")
14
def text_llm():
tests/entrypoints/llm/test_mm_cache_stats.py
+1
-2
@@ -6,13 +6,12 @@ import logging
6
import pytest
7
import regex as re
8
9
+from tests.entrypoints.openai.chat_completion.test_vision import TEST_IMAGE_ASSETS
10
from vllm import LLM
11
from vllm.entrypoints.chat_utils import ChatCompletionMessageParam
12
from vllm.v1.metrics import loggers as stat_loggers
13
from vllm.v1.metrics.reader import Counter, Metric
14
14
-from ..openai.test_vision import TEST_IMAGE_ASSETS
15
-
15
16
def _make_messages(image_url: str) -> list[ChatCompletionMessageParam]:
17
return [
tests/entrypoints/openai/chat_completion/test_audio.py
renamed
+1
-2
@@ -7,11 +7,10 @@ import openai
7
import pytest
8
import pytest_asyncio
9
10
+from tests.utils import RemoteOpenAIServer
11
from vllm.assets.audio import AudioAsset
12
from vllm.multimodal.utils import encode_audio_base64, encode_audio_url, fetch_audio
13
13
-from ...utils import RemoteOpenAIServer
14
-
14
MODEL_NAME = "fixie-ai/ultravox-v0_5-llama-3_2-1b"
15
TEST_AUDIO_URLS = [
16
AudioAsset("winning_call").url,
tests/entrypoints/openai/chat_completion/test_audio_in_video.py
renamed
+2
-2
@@ -8,8 +8,8 @@ import openai
8
import pytest
9
import pytest_asyncio
10
11
-from ...conftest import VideoTestAssets
12
-from ...utils import RemoteOpenAIServer
11
+from tests.conftest import VideoTestAssets
12
+from tests.utils import RemoteOpenAIServer
13
14
MODEL_NAME = "Qwen/Qwen2.5-Omni-3B"
15
tests/entrypoints/openai/chat_completion/test_default_mm_loras.py
renamed
+2
-2
@@ -8,8 +8,8 @@ import pytest
8
import pytest_asyncio
9
from huggingface_hub import snapshot_download
10
11
-from ...conftest import AudioTestAssets
12
-from ...utils import RemoteOpenAIServer
11
+from tests.conftest import AudioTestAssets
12
+from tests.utils import RemoteOpenAIServer
13
14
# NOTE - the tests in this module are currently analogous to test_chat, but are
15
# separated to avoid OOM killing due to module-scoped servers, since we
tests/entrypoints/openai/chat_completion/test_oot_registration.py
renamed
+1
-1
@@ -1,7 +1,7 @@
1
# SPDX-License-Identifier: Apache-2.0
2
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3
4
-from ...utils import VLLM_PATH, RemoteOpenAIServer
4
+from tests.utils import VLLM_PATH, RemoteOpenAIServer
5
6
chatml_jinja_path = VLLM_PATH / "examples/template_chatml.jinja"
7
assert chatml_jinja_path.exists()
tests/entrypoints/openai/chat_completion/test_root_path.py
renamed
+1
-1
@@ -8,7 +8,7 @@ from typing import Any, NamedTuple
8
import openai # use the official client for correctness check
9
import pytest
10
11
-from ...utils import RemoteOpenAIServer
11
+from tests.utils import RemoteOpenAIServer
12
13
# # any model with a chat template should work here
14
MODEL_NAME = "Qwen/Qwen2-1.5B-Instruct"
tests/entrypoints/openai/chat_completion/test_video.py
renamed
+1
-2
@@ -7,11 +7,10 @@ import openai
7
import pytest
8
import pytest_asyncio
9
10
+from tests.utils import RemoteOpenAIServer
11
from vllm.multimodal.utils import encode_video_url, fetch_video
12
from vllm.platforms import current_platform
13
13
-from ...utils import RemoteOpenAIServer
14
-
14
MODEL_NAME = "llava-hf/llava-onevision-qwen2-0.5b-ov-hf"
15
MAXIMUM_VIDEOS = 3
16
tests/entrypoints/openai/chat_completion/test_vision.py
renamed
+1
-2
@@ -8,12 +8,11 @@ import pytest
8
import pytest_asyncio
9
from transformers import AutoProcessor
10
11
+from tests.utils import ROCM_ENV_OVERRIDES, ROCM_EXTRA_ARGS, RemoteOpenAIServer
12
from vllm.multimodal.media import MediaWithBytes
13
from vllm.multimodal.utils import encode_image_url, fetch_image
14
from vllm.platforms import current_platform
15
15
-from ...utils import ROCM_ENV_OVERRIDES, ROCM_EXTRA_ARGS, RemoteOpenAIServer
16
-
16
MODEL_NAME = "microsoft/Phi-3.5-vision-instruct"
17
MAXIMUM_IMAGES = 2
18
tests/entrypoints/openai/chat_completion/test_vision_embeds.py
renamed
+1
-2
@@ -8,10 +8,9 @@ import pytest
8
import requests
9
import torch
10
11
+from tests.utils import RemoteOpenAIServer
12
from vllm.utils.serial_utils import tensor2base64
13
13
-from ...utils import RemoteOpenAIServer
14
-
14
15
@pytest.mark.parametrize(
16
"model_name", ["ibm-nasa-geospatial/Prithvi-EO-2.0-300M-TL-Sen1Floods11"]
tests/entrypoints/openai/completion/__init__.py
tests/entrypoints/openai/completion/test_completion_error.py
renamed
tests/entrypoints/openai/completion/test_completion_with_prompt_embeds.py
renamed
+1
-1
@@ -14,7 +14,7 @@ import torch
14
from openai import BadRequestError
15
from transformers import AutoConfig
16
17
-from ...utils import RemoteOpenAIServer
17
+from tests.utils import RemoteOpenAIServer
18
19
# any model with a chat template should work here
20
MODEL_NAME = "facebook/opt-125m"
tests/entrypoints/openai/completion/test_lora_resolvers.py
renamed
tests/entrypoints/openai/completion/test_prompt_validation.py
renamed
+1
-2
@@ -11,11 +11,10 @@ import pytest
11
import regex as re
12
import torch
13
14
+from tests.utils import RemoteOpenAIServer
15
from vllm.config import ModelConfig
16
from vllm.renderers.embed_utils import safe_load_prompt_embeds
17
17
-from ...utils import RemoteOpenAIServer
18
-
18
19
@pytest.mark.asyncio
20
async def test_empty_prompt():
tests/entrypoints/openai/completion/test_shutdown.py
renamed
tests/entrypoints/openai/completion/test_tensorizer_entrypoint.py
renamed
+1
-2
@@ -9,6 +9,7 @@ import pytest
9
import pytest_asyncio
10
import torch.cuda
11
12
+from tests.utils import RemoteOpenAIServer
13
from vllm.engine.arg_utils import EngineArgs
14
from vllm.model_executor.model_loader.tensorizer import (
15
TensorizerConfig,
@@ -17,8 +18,6 @@ from vllm.model_executor.model_loader.tensorizer import (
18
)
19
from vllm.platforms import current_platform
20
20
-from ...utils import RemoteOpenAIServer
21
-
21
MODEL_NAME = "unsloth/llama-3.2-1b-Instruct"
22
LORA_PATH = "davzoku/finqa_adapter_1b"
23
tests/entrypoints/openai/completion/test_token_in_token_out.py
renamed
+1
-2
@@ -6,11 +6,10 @@ import tempfile
6
7
import pytest
8
9
+from tests.utils import RemoteOpenAIServer
10
from vllm.model_executor.model_loader.weight_utils import download_weights_from_hf
11
from vllm.tokenizers import get_tokenizer
12
12
-from ...utils import RemoteOpenAIServer
13
-
13
MODEL_NAME = "Qwen/Qwen3-0.6B"
14
MODEL_PATH = os.path.join(tempfile.gettempdir(), "qwen3_06b")
15