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
7e8d97dd
Unverified
Commit
7e8d97dd
authored
Jun 13, 2025
by
Nick Hill
Committed by
GitHub
Jun 13, 2025
Browse files
[BugFix] Honor `enable_caching` in connector-delayed kvcache load case (#19435)
Signed-off-by:
Nick Hill
<
nhill@redhat.com
>
parent
d70bc7c0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
vllm/v1/core/kv_cache_manager.py
vllm/v1/core/kv_cache_manager.py
+5
-4
vllm/v1/core/sched/scheduler.py
vllm/v1/core/sched/scheduler.py
+1
-0
No files found.
vllm/v1/core/kv_cache_manager.py
View file @
7e8d97dd
...
...
@@ -381,10 +381,11 @@ class KVCacheManager:
self
.
coordinator
.
get_blocks
(
request_id
)).
get_block_ids
()
def
cache_blocks
(
self
,
request
:
Request
,
num_computed_tokens
:
int
)
->
None
:
"""Cache the blocks for the request."""
block_hashes
=
self
.
req_to_block_hashes
[
request
.
request_id
]
self
.
coordinator
.
cache_blocks
(
request
,
block_hashes
,
num_computed_tokens
)
"""Cache the blocks for the request, if enabled."""
if
self
.
enable_caching
:
block_hashes
=
self
.
req_to_block_hashes
[
request
.
request_id
]
self
.
coordinator
.
cache_blocks
(
request
,
block_hashes
,
num_computed_tokens
)
def
create_empty_block_list
(
self
)
->
KVCacheBlocks
:
"""Creates a new KVCacheBlocks instance with no blocks."""
...
...
vllm/v1/core/sched/scheduler.py
View file @
7e8d97dd
...
...
@@ -1015,6 +1015,7 @@ class Scheduler(SchedulerInterface):
num_computed_tokens
=
min
(
num_computed_tokens
,
request
.
num_tokens
)
if
num_computed_tokens
==
request
.
num_tokens
:
num_computed_tokens
-=
1
# This will cache the blocks iff caching is enabled.
self
.
kv_cache_manager
.
cache_blocks
(
request
,
num_computed_tokens
)
# Update the request state for scheduling.
...
...
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