Skip to content

Commit 6ed068a

Browse files
Use the type BlockTable (#1791)
1 parent 708e6c1 commit 6ed068a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

vllm/core/block_manager.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
from vllm.utils import Device
88

99

10+
# Mapping: logical block number -> physical block.
11+
BlockTable = List[PhysicalTokenBlock]
12+
13+
1014
class BlockAllocator:
1115
"""Manages free physical token blocks for a device.
1216
@@ -26,7 +30,7 @@ def __init__(
2630
self.num_blocks = num_blocks
2731

2832
# Initialize the free blocks.
29-
self.free_blocks: List[PhysicalTokenBlock] = []
33+
self.free_blocks: BlockTable = []
3034
for i in range(num_blocks):
3135
block = PhysicalTokenBlock(device=device,
3236
block_number=i,
@@ -51,10 +55,6 @@ def get_num_free_blocks(self) -> int:
5155
return len(self.free_blocks)
5256

5357

54-
# Mapping: logical block number -> physical block.
55-
BlockTable = List[PhysicalTokenBlock]
56-
57-
5858
class AllocStatus(enum.Enum):
5959
"""Result for BlockSpaceManager.can_allocate
6060

0 commit comments

Comments
 (0)