[mypy] Add mypy type annotation part 1 (#4006)

This commit is contained in:
SangBin Cho
2024-04-12 14:35:50 -07:00
committed by GitHub
parent d4ec9ffb95
commit 09473ee41c
25 changed files with 171 additions and 72 deletions
+3 -1
View File
@@ -1,4 +1,5 @@
"""A block manager that manages token blocks."""
from collections.abc import Sequence as GenericSequence
from typing import Dict, List, Optional
from vllm.core.block.block_table import BlockTable
@@ -205,7 +206,8 @@ class BlockSpaceManagerV2(BlockSpaceManager):
# as computed.
self.block_allocator.mark_blocks_as_computed()
def get_common_computed_block_ids(self, seqs: List[Sequence]) -> List[int]:
def get_common_computed_block_ids(
self, seqs: List[Sequence]) -> GenericSequence[int]:
"""Determine which blocks for which we skip prefill.
With prefix caching we can skip prefill for previously-generated blocks.