Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
6e670778
Unverified
Commit
6e670778
authored
Aug 15, 2025
by
Zebing Lin
Committed by
GitHub
Aug 15, 2025
Browse files
[Core] direct indexing on self.block_table_np in compute_slot_mapping (#22940)
Signed-off-by:
linzebing
<
linzebing1995@gmail.com
>
parent
df5afa82
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
2 deletions
+1
-2
vllm/v1/worker/block_table.py
vllm/v1/worker/block_table.py
+1
-2
No files found.
vllm/v1/worker/block_table.py
View file @
6e670778
...
@@ -91,8 +91,7 @@ class BlockTable:
...
@@ -91,8 +91,7 @@ class BlockTable:
# block_size.
# block_size.
block_table_indices
=
(
req_indices
*
self
.
max_num_blocks_per_req
+
block_table_indices
=
(
req_indices
*
self
.
max_num_blocks_per_req
+
positions
//
self
.
block_size
)
positions
//
self
.
block_size
)
block_table_cpu
=
self
.
get_cpu_tensor
()
block_numbers
=
self
.
block_table_np
.
ravel
()[
block_table_indices
]
block_numbers
=
block_table_cpu
.
flatten
()[
block_table_indices
].
numpy
()
block_offsets
=
positions
%
self
.
block_size
block_offsets
=
positions
%
self
.
block_size
np
.
add
(
block_numbers
*
self
.
block_size
,
np
.
add
(
block_numbers
*
self
.
block_size
,
block_offsets
,
block_offsets
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment