Unverified Commit 6e670778 authored by Zebing Lin's avatar Zebing Lin Committed by GitHub
Browse files

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


Signed-off-by: default avatarlinzebing <linzebing1995@gmail.com>
parent df5afa82
......@@ -91,8 +91,7 @@ class BlockTable:
# block_size.
block_table_indices = (req_indices * self.max_num_blocks_per_req +
positions // self.block_size)
block_table_cpu = self.get_cpu_tensor()
block_numbers = block_table_cpu.flatten()[block_table_indices].numpy()
block_numbers = self.block_table_np.ravel()[block_table_indices]
block_offsets = positions % self.block_size
np.add(block_numbers * self.block_size,
block_offsets,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment