@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / ee777d9c30
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 16, 15:45 UTC

Fix test_schedule_swapped_simple in test_scheduler.py (#8780)

sroy745 committed Sep 24, 2024 at 21:26 UTC ee777d9c30418ffa9d98f98dd27c0ddea346c49c
1 file changed +10 -4
tests/core/test_scheduler.py
+10 -4
@@ -747,13 +747,19 @@ def test_schedule_decode_blocks_to_copy_update(use_v2_block_manager: bool):
747 assert output.blocks_to_copy == [(2, 3)]
748
749
750 -def test_schedule_swapped_simple():
751 - scheduler = initialize_scheduler()
750 +@pytest.mark.parametrize('use_v2_block_manager', [True, False])
751 +def test_schedule_swapped_simple(use_v2_block_manager: bool):
752 + block_size = 4
753 + scheduler = initialize_scheduler(use_v2_block_manager=use_v2_block_manager,
754 + block_size=block_size)
755 curr_loras = None
756 blocks_to_swap_out: List[Tuple[int, int]] = []
754 - _, seq_group = create_dummy_prompt("1", prompt_length=60, best_of=2)
757 + _, seq_group = create_dummy_prompt("1",
758 + prompt_length=4,
759 + best_of=2,
760 + block_size=block_size)
761 scheduler._allocate_and_set_running(seq_group)
756 - append_new_token_seq_group(60, seq_group, 1)
762 + append_new_token_seq_group(4, seq_group, 1)
763 scheduler._swap_out(seq_group, blocks_to_swap_out)
764 scheduler._add_seq_group_to_swapped(seq_group)
765