Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,11 @@ mypy vllm/logging --config-file pyproject.toml
mypy vllm/model_executor --config-file pyproject.toml


# If git diff returns a file that is in the skip list, the file may be checked anyway:
# https://github.com/codespell-project/codespell/issues/1915
# Avoiding the "./" prefix and using "/**" globs for directories appears to solve the problem
CODESPELL_EXCLUDES=(
'--skip' '*docs/source/_build/**,./tests/lora/data'
'--skip' 'tests/prompts/**,./benchmarks/sonnet.txt,tests/lora/data/**,build/**'
)

# check spelling of specified files
Expand Down
41 changes: 0 additions & 41 deletions tests/async_engine/test_merge_async_iterators.py

This file was deleted.

31 changes: 15 additions & 16 deletions tests/async_engine/test_openapi_server_ray.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,22 @@
# and debugging.
import ray

from ..utils import ServerRunner
from ..utils import VLLM_PATH, RemoteOpenAIServer

# any model with a chat template should work here
MODEL_NAME = "facebook/opt-125m"


@pytest.fixture(scope="module")
def server():
ray.init()
server_runner = ServerRunner.remote([
def ray_ctx():
ray.init(runtime_env={"working_dir": VLLM_PATH})
yield
ray.shutdown()


@pytest.fixture(scope="module")
def server(ray_ctx):
yield RemoteOpenAIServer([
"--model",
MODEL_NAME,
# use half precision for speed and memory savings in CI environment
Expand All @@ -24,22 +30,15 @@ def server():
"--enforce-eager",
"--engine-use-ray"
])
ray.get(server_runner.ready.remote())
yield server_runner
ray.shutdown()


@pytest.fixture(scope="module")
def client():
client = openai.AsyncOpenAI(
base_url="http://localhost:8000/v1",
api_key="token-abc123",
)
yield client
def client(server):
yield server.get_async_client()


@pytest.mark.asyncio
async def test_check_models(server, client: openai.AsyncOpenAI):
async def test_check_models(client: openai.AsyncOpenAI):
models = await client.models.list()
models = models.data
served_model = models[0]
Expand All @@ -48,7 +47,7 @@ async def test_check_models(server, client: openai.AsyncOpenAI):


@pytest.mark.asyncio
async def test_single_completion(server, client: openai.AsyncOpenAI):
async def test_single_completion(client: openai.AsyncOpenAI):
completion = await client.completions.create(model=MODEL_NAME,
prompt="Hello, my name is",
max_tokens=5,
Expand All @@ -74,7 +73,7 @@ async def test_single_completion(server, client: openai.AsyncOpenAI):


@pytest.mark.asyncio
async def test_single_chat_session(server, client: openai.AsyncOpenAI):
async def test_single_chat_session(client: openai.AsyncOpenAI):
messages = [{
"role": "system",
"content": "you are a helpful assistant"
Expand Down
2 changes: 0 additions & 2 deletions tests/core/test_block_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ def test_append_slot_cow():
inputs={
"prompt": "one two three",
"prompt_token_ids": [1, 2, 3],
"multi_modal_data": None
},
block_size=block_size)

Expand Down Expand Up @@ -311,7 +310,6 @@ def test_sliding_window_multi_seq():
inputs={
"prompt": "one two three",
"prompt_token_ids": [0, 1, 2],
"multi_modal_data": None
},
block_size=block_size)
seq_group = SequenceGroup(request_id="1",
Expand Down
7 changes: 1 addition & 6 deletions tests/core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ def create_dummy_prompt(
inputs={
"prompt": prompt_str,
"prompt_token_ids": prompt_tokens,
"multi_modal_data": None,
},
block_size=block_size)
seq_group = SequenceGroup(request_id=request_id,
Expand Down Expand Up @@ -57,11 +56,7 @@ def create_seq_group(
for seq_id_offset, output_len in enumerate(seq_output_lens):
seq = Sequence(
seq_id=seq_id_start + seq_id_offset,
inputs={
"prompt": "",
"prompt_token_ids": prompt_token_ids,
"multi_modal_data": None,
},
inputs={"prompt_token_ids": prompt_token_ids},
block_size=16,
)

Expand Down
6 changes: 1 addition & 5 deletions tests/engine/output_processor/test_stop_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@ def sequence_with_eos(text: str, eos_token: str,
"""
seq = Sequence(
seq_id=0,
inputs={
"prompt": "",
"prompt_token_ids": [],
"multi_modal_data": None,
},
inputs={"prompt_token_ids": []},
block_size=16,
eos_token_id=eos_token_id,
)
Expand Down
Loading