Skip to content
Draft
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
25 changes: 25 additions & 0 deletions tests/e2e/test_spyre_prompt_logprobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,31 @@ def test_prompt_logprobs(
force_engine_shutdown(llm)


@pytest.mark.parametrize("backend", get_spyre_backend_list())
@pytest.mark.parametrize("model", get_spyre_model_list())
def test_prompt_logprobs_work_with_logprobs(
backend: str,
model: str,
monkeypatch: pytest.MonkeyPatch,
) -> None:
'''
This test checks that prompt_logprobs and logprobs can work together.
'''

prompts = get_chicken_soup_prompts(4)

monkeypatch.setenv("VLLM_SPYRE_DYNAMO_BACKEND", backend)
monkeypatch.setenv("VLLM_SPYRE_ENABLE_PROMPT_LOGPROBS", "1")
llm = LLM(model, tokenizer=model)

responses: list[RequestOutput] = llm.generate(
prompts, sampling_params=SamplingParams(prompt_logprobs=5, logprobs=5))

for r in responses:
assert r.outputs[0].logprobs is not None
force_engine_shutdown(llm)
Copy link
Collaborator

@prashantgupta24 prashantgupta24 Aug 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we add some comments on when we have to use force_engine_shutdown? Also I wonder if we can make it such that it's part of pytest teardown automatically in case someone forgets to add this which would result in the weird addr-in-use error

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, maybe we could make it an auto-use fixture.



@pytest.mark.cpu
@pytest.mark.decoder
def test_prompt_logprobs_must_be_enabled(monkeypatch: pytest.MonkeyPatch):
Expand Down
Loading