Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Varun Sundar Rabindranath committed Sep 16, 2024
1 parent c0efbc8 commit f240b10
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/multi_step/test_correctness_async_llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,19 @@
"16",
]

def skip_test(is_chunked_prefill: bool,
tp_size: int,
pp_size: int,
attn_backend: str) -> bool:
if not is_chunked_prefill:
return False

if tp_size == 1 and \
pp_size == 1 and \
attn_backend == "FLASH_ATTN":
return False

return True

@pytest.mark.parametrize("model", MODELS)
@pytest.mark.parametrize(("tp_size, pp_size"), [
Expand All @@ -37,6 +50,7 @@
@pytest.mark.parametrize("num_logprobs", [5])
@pytest.mark.parametrize("is_async", [True])
@pytest.mark.parametrize("attention_backend", ["FLASHINFER", "FLASH_ATTN"])
@pytest.mark.parametrize("with_chunked_prefill", [True, False])
@pytest.mark.asyncio
async def test_multi_step(
example_prompts,
Expand All @@ -49,6 +63,7 @@ async def test_multi_step(
is_async: bool,
num_logprobs: Optional[int],
attention_backend: str,
with_chunked_prefill: bool,
monkeypatch,
) -> None:
"""Test vLLM engine with multi-step scheduling in an OpenAI-protocol
Expand All @@ -75,6 +90,12 @@ async def test_multi_step(
completions endpoint; `None` -> no logprobs
"""

if skip_test(is_chunked_prefill = with_chunked_prefill,
tp_size = tp_size,
pp_size = pp_size,
attn_backend = attention_backend):
return

override_backend_env_variable(monkeypatch, attention_backend)

prompts = example_prompts
Expand All @@ -93,6 +114,9 @@ async def test_multi_step(
if eager_mode:
ms_server_args.append("--enforce-eager")

if with_chunked_prefill:
ms_server_args.append("--enable-chunked-prefill")

distributed_args = [
"--tensor-parallel-size",
str(tp_size),
Expand Down

0 comments on commit f240b10

Please sign in to comment.