From d75c40734a96a10b30c7b2652d49f2a70030855b Mon Sep 17 00:00:00 2001 From: Nick Hill Date: Sat, 20 Jan 2024 22:36:09 -0800 Subject: [PATCH] [Fix] Keep `scheduler.running` as deque (#2523) --- vllm/core/scheduler.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/vllm/core/scheduler.py b/vllm/core/scheduler.py index b00316ac1fb8c..69e3d5993c37f 100644 --- a/vllm/core/scheduler.py +++ b/vllm/core/scheduler.py @@ -332,10 +332,8 @@ def free_seq(self, seq: Sequence) -> None: self.block_manager.free(seq) def free_finished_seq_groups(self) -> None: - self.running = [ - seq_group for seq_group in self.running - if not seq_group.is_finished() - ] + self.running = deque(seq_group for seq_group in self.running + if not seq_group.is_finished()) def _allocate(self, seq_group: SequenceGroup) -> None: self.block_manager.allocate(seq_group)