File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 7
7
from vllm .utils import Device
8
8
9
9
10
+ # Mapping: logical block number -> physical block.
11
+ BlockTable = List [PhysicalTokenBlock ]
12
+
13
+
10
14
class BlockAllocator :
11
15
"""Manages free physical token blocks for a device.
12
16
@@ -26,7 +30,7 @@ def __init__(
26
30
self .num_blocks = num_blocks
27
31
28
32
# Initialize the free blocks.
29
- self .free_blocks : List [ PhysicalTokenBlock ] = []
33
+ self .free_blocks : BlockTable = []
30
34
for i in range (num_blocks ):
31
35
block = PhysicalTokenBlock (device = device ,
32
36
block_number = i ,
@@ -51,10 +55,6 @@ def get_num_free_blocks(self) -> int:
51
55
return len (self .free_blocks )
52
56
53
57
54
- # Mapping: logical block number -> physical block.
55
- BlockTable = List [PhysicalTokenBlock ]
56
-
57
-
58
58
class AllocStatus (enum .Enum ):
59
59
"""Result for BlockSpaceManager.can_allocate
60
60
You can’t perform that action at this time.
0 commit comments