[ROCm][CI] Solidify entrypoint LLM lifecycle (#51280)

Signed-off-by: Andreas Karatzas <Andreas.Karatzas@amd.com>
Signed-off-by: Andreas Karatzas <akaratza@amd.com>
This commit is contained in:
Andreas Karatzas
2026-08-13 12:24:02 -05:00
committed by GitHub
parent 69d4c3a06b
commit b96bcd0b47
24 changed files with 1002 additions and 1103 deletions
+22 -17
View File
@@ -4,30 +4,35 @@
import pytest
import torch
from vllm import LLM
from vllm.exceptions import VLLMValidationError
def test_empty_prompt():
llm = LLM(model="openai-community/gpt2", enforce_eager=True)
with pytest.raises(VLLMValidationError, match="decoder prompt cannot be empty"):
llm.generate([""])
def test_empty_prompt(vllm_runner):
with (
vllm_runner("openai-community/gpt2", enforce_eager=True) as runner,
pytest.raises(VLLMValidationError, match="decoder prompt cannot be empty"),
):
runner.llm.generate([""])
def test_out_of_vocab_token():
llm = LLM(model="openai-community/gpt2", enforce_eager=True)
with pytest.raises(VLLMValidationError, match="out of vocabulary"):
llm.generate({"prompt_token_ids": [999999]})
def test_out_of_vocab_token(vllm_runner):
with (
vllm_runner("openai-community/gpt2", enforce_eager=True) as runner,
pytest.raises(VLLMValidationError, match="out of vocabulary"),
):
runner.llm.generate({"prompt_token_ids": [999999]})
def test_require_mm_embeds():
llm = LLM(
model="llava-hf/llava-1.5-7b-hf",
enforce_eager=True,
enable_mm_embeds=False,
)
with pytest.raises(ValueError, match="--enable-mm-embeds"):
llm.generate(
def test_require_mm_embeds(vllm_runner):
with (
vllm_runner(
"llava-hf/llava-1.5-7b-hf",
enforce_eager=True,
enable_mm_embeds=False,
) as runner,
pytest.raises(ValueError, match="--enable-mm-embeds"),
):
runner.llm.generate(
{
"prompt": "<image>",
"multi_modal_data": {"image": torch.empty(1, 1, 1)},