@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 6e670778cd
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 14, 05:30 UTC

[Core] direct indexing on self.block_table_np in compute_slot_mapping (#22940)

Signed-off-by: linzebing <linzebing1995@gmail.com>

Zebing Lin committed Aug 15, 2025 at 15:12 UTC 6e670778cdd87c282c42002a2304cb0a4a165904
1 file changed +1 -2
vllm/v1/worker/block_table.py
+1 -2
@@ -91,8 +91,7 @@ class BlockTable:
91 # block_size.
92 block_table_indices = (req_indices * self.max_num_blocks_per_req +
93 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]
95 block_offsets = positions % self.block_size
96 np.add(block_numbers * self.block_size,
97 block_offsets,