Skip to content

Commit 6e67077

Browse files
authored
[Core] direct indexing on self.block_table_np in compute_slot_mapping (#22940)
Signed-off-by: linzebing <[email protected]>
1 parent df5afa8 commit 6e67077

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

vllm/v1/worker/block_table.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,7 @@ def compute_slot_mapping(self, req_indices: np.ndarray,
9191
# block_size.
9292
block_table_indices = (req_indices * self.max_num_blocks_per_req +
9393
positions // self.block_size)
94-
block_table_cpu = self.get_cpu_tensor()
95-
block_numbers = block_table_cpu.flatten()[block_table_indices].numpy()
94+
block_numbers = self.block_table_np.ravel()[block_table_indices]
9695
block_offsets = positions % self.block_size
9796
np.add(block_numbers * self.block_size,
9897
block_offsets,

0 commit comments

Comments
 (0)