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
b10e5198
Unverified
Commit
b10e5198
authored
Apr 06, 2025
by
Woosuk Kwon
Committed by
GitHub
Apr 06, 2025
Browse files
[V1][Minor] Optimize get_cached_block (#16135)
parent
9bde5ba1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
vllm/v1/core/block_pool.py
vllm/v1/core/block_pool.py
+5
-5
No files found.
vllm/v1/core/block_pool.py
View file @
b10e5198
...
...
@@ -67,11 +67,11 @@ class BlockPool:
Returns:
The cached block if it exists, or None.
"""
if
block_hash
in
self
.
cached_block_hash_to_block
:
first_block_id
=
list
(
self
.
cached_block_hash_to_block
[
block_hash
].
keys
())[
0
]
return
self
.
cached_block_hash_to_block
[
block_hash
][
first
_block
_id
]
return
None
cached_blocks
=
self
.
cached_block_hash_to_block
.
get
(
block_hash
)
if
not
cached_blocks
:
return
None
first_block_id
=
next
(
iter
(
cached
_block
s
))
return
cached_blocks
[
first_block_id
]
def
cache_full_blocks
(
self
,
...
...
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