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 17, 01:45 UTC
[CI] Nits for bad initialization of SeqGroup in testing (#4748)
Robert Shaw committed
May 10, 2024 at 16:01 UTC
fcc2994be657a897dd0732928754749048520b28
2 files changed
+16
-8
tests/core/test_block_manager.py
+9
-4
@@ -142,8 +142,10 @@ def test_append_slot_cow():
142
child = prompt.fork(new_seq_id=2)
143
144
# Allocate space for the sequence group.
145
- seq_group = SequenceGroup("1", [prompt, child], SamplingParams(),
146
- time.time(), time.perf_counter)
145
+ seq_group = SequenceGroup(request_id="1",
146
+ seqs=[prompt, child],
147
+ arrival_time=time.time(),
148
+ sampling_params=SamplingParams())
149
block_manager.allocate(seq_group)
150
151
# Fork and append a new token id. We expect a COW to be scheduled.
@@ -303,8 +305,11 @@ def test_sliding_window_multi_seq():
305
assert block_manager.get_num_free_gpu_blocks() == num_gpu_blocks
306
307
parent = Sequence(1, "one two three", [0, 1, 2], block_size)
306
- seq_group = SequenceGroup("1", [parent], SamplingParams(), time.time(),
307
- None)
308
+ seq_group = SequenceGroup(request_id="1",
309
+ seqs=[parent],
310
+ arrival_time=time.time(),
311
+ sampling_params=SamplingParams(),
312
+ lora_request=None)
313
block_manager.allocate(seq_group)
314
315
# assert the number of blocks allocated is correct
tests/core/utils.py
+7
-4
@@ -22,10 +22,13 @@ def create_dummy_prompt(
22
prompt_tokens = list(range(prompt_length))
23
prompt_str = " ".join([str(t) for t in prompt_tokens])
24
prompt = Sequence(int(request_id), prompt_str, prompt_tokens, block_size)
25
- seq_group = SequenceGroup(
26
- request_id, [prompt],
27
- SamplingParams(use_beam_search=use_beam_search, best_of=best_of),
28
- time.time(), lora_request)
25
+ seq_group = SequenceGroup(request_id=request_id,
26
+ seqs=[prompt],
27
+ arrival_time=time.time(),
28
+ sampling_params=SamplingParams(
29
+ use_beam_search=use_beam_search,
30
+ best_of=best_of),
31
+ lora_request=lora_request)
32
33
return prompt, seq_group
34