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
34f1a806
Unverified
Commit
34f1a806
authored
Dec 12, 2024
by
Cody Yu
Committed by
GitHub
Dec 13, 2024
Browse files
[Bugfix][V1] Fix 'NoneType' object has no attribute 'hash_value' (#11157)
Signed-off-by:
Cody Yu
<
hao.yu.cody@gmail.com
>
parent
00c1bde5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
9 deletions
+15
-9
vllm/v1/core/kv_cache_manager.py
vllm/v1/core/kv_cache_manager.py
+15
-9
No files found.
vllm/v1/core/kv_cache_manager.py
View file @
34f1a806
...
...
@@ -164,13 +164,14 @@ class KVCacheManager:
new_full_blocks
=
req_blocks
[
num_computed_full_blocks
:
num_full_blocks_after_append
]
self
.
_cache_full_blocks
(
request
=
request
,
blk_start_idx
=
num_computed_full_blocks
,
full_blocks
=
new_full_blocks
,
prev_block
=
req_blocks
[
num_computed_full_blocks
-
1
]
if
num_computed_full_blocks
>=
1
else
None
,
)
if
new_full_blocks
:
self
.
_cache_full_blocks
(
request
=
request
,
blk_start_idx
=
num_computed_full_blocks
,
full_blocks
=
new_full_blocks
,
prev_block
=
req_blocks
[
num_computed_full_blocks
-
1
]
if
num_computed_full_blocks
>=
1
else
None
,
)
return
new_blocks
...
...
@@ -375,8 +376,13 @@ class KVCacheManager:
prev_block: The previous block in the chain.
"""
# Update the new blocks with the block hashes through the chain.
prev_block_hash_value
=
(
prev_block
.
block_hash
.
hash_value
if
prev_block
is
not
None
else
None
)
prev_block_hash_value
=
None
if
prev_block
is
not
None
:
# Previous block must have a block hash because it must be
# a full, cached block.
assert
prev_block
.
block_hash
is
not
None
prev_block_hash_value
=
prev_block
.
block_hash
.
hash_value
for
i
,
blk
in
enumerate
(
full_blocks
):
blk_idx
=
blk_start_idx
+
i
...
...
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