@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 0754ac4c49
Fork 0

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 14, 05:30 UTC

[Misc] Remove cruft file in repo (#25678)

Signed-off-by: NickLucche <nlucches@redhat.com>

Nicolò Lucchesi committed Sep 25, 2025 at 17:05 UTC 0754ac4c492776f33d6092391ad2bf4a9dc32925
1 file changed -61
tests/test_test.py deleted
-61
@@ -1,61 +0,0 @@
1 -# SPDX-License-Identifier: Apache-2.0
2 -# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 -
4 -import pytest
5 -
6 -from vllm import LLM, envs
7 -from vllm.sampling_params import SamplingParams
8 -
9 -if not envs.VLLM_USE_V1:
10 - pytest.skip(
11 - "Skipping V1 tests. Rerun with `VLLM_USE_V1=1` to test.",
12 - allow_module_level=True,
13 - )
14 -
15 -
16 -@pytest.mark.parametrize("model_name", ["Qwen/Qwen2.5-1.5B-Instruct"])
17 -# TODO TPU will appear busy if we fan-out test params here
18 -@pytest.mark.parametrize("n_prompts", [1])
19 -def test_logprobs(model_name: str, n_prompts: int):
20 - """
21 - Request top logprobs with different sampling settings and check
22 - that results contains the requested number, ordered ascendingly.
23 - """
24 -
25 - def check_num_logprobs(logprobs, expected_num: int):
26 - for step in logprobs:
27 - prev_logp = 1.0
28 - # order by rank
29 - sorted_step = dict(
30 - sorted(step.items(), key=lambda item: item[1].rank))
31 -
32 - if len(step) != expected_num:
33 - print("watch out", sorted_step)
34 -
35 - # check results are ordered by prob value
36 - # assert len(step) == expected_num
37 - for rankno, (tid, logp) in enumerate(sorted_step.items()):
38 - assert logp.logprob <= prev_logp
39 - prev_logp = logp.logprob
40 - assert logp.rank == rankno + 1
41 -
42 - llm = LLM(model_name,
43 - enforce_eager=False,
44 - max_num_seqs=1,
45 - max_model_len=128,
46 - max_num_batched_tokens=128)
47 - prompts = [
48 - "Write a short story about a robot that dreams for the first time."
49 - ] * n_prompts
50 - greedy_sampling_params = SamplingParams(temperature=0.0, max_tokens=64,\
51 - logprobs=4)
52 - regular_sampling_params = SamplingParams(temperature=0.4, max_tokens=64,\
53 - logprobs=4)
54 - topkp_sampling_params = SamplingParams(temperature=0.4, max_tokens=64,\
55 - logprobs=4, top_k=12, top_p=0.5)
56 -
57 - for sp in [greedy_sampling_params, regular_sampling_params, \
58 - topkp_sampling_params]:
59 - output = llm.generate(prompts, sp)
60 - for o in output:
61 - check_num_logprobs(o.outputs[0].logprobs, 4)