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)