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
8b1f3beb
Unverified
Commit
8b1f3beb
authored
Apr 20, 2026
by
Cao Qian
Committed by
GitHub
Apr 20, 2026
Browse files
[LMCache MP Connector] Add num_lmcache_extra_cached_token in KVTransferParams (#39843)
Signed-off-by:
aeon-x
<
talexcao@gmail.com
>
parent
2390caf1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
1 deletion
+20
-1
vllm/distributed/kv_transfer/kv_connector/v1/lmcache_mp_connector.py
...buted/kv_transfer/kv_connector/v1/lmcache_mp_connector.py
+20
-1
No files found.
vllm/distributed/kv_transfer/kv_connector/v1/lmcache_mp_connector.py
View file @
8b1f3beb
...
...
@@ -930,12 +930,31 @@ class LMCacheMPConnector(KVConnectorBase_V1):
Optional KVTransferParams to be included in the request outputs
returned by the engine.
"""
params
:
dict
[
str
,
Any
]
|
None
=
getattr
(
request
,
"kv_transfer_params"
,
None
)
return_params
:
dict
[
str
,
Any
]
|
None
=
{}
if
params
is
not
None
else
None
if
(
params
is
not
None
and
return_params
is
not
None
and
"num_lmcache_extra_cached_tokens"
in
params
):
request_tracker
=
self
.
_get_request_tracker
(
request
.
request_id
)
num_extra_cached_blocks
=
max
(
0
,
request_tracker
.
num_lmcache_hit_blocks
-
request_tracker
.
num_vllm_hit_blocks
,
)
return_params
[
"num_lmcache_extra_cached_tokens"
]
=
(
num_extra_cached_blocks
*
self
.
vllm_block_size
)
# Clean up request tracker to prevent memory leak
self
.
_cleanup_request_tracker
(
request
.
request_id
)
# Notify LMCache to end the session for this request
self
.
scheduler_adapter
.
end_session
(
request
.
request_id
)
return
True
,
None
return
True
,
return_params
def
take_events
(
self
)
->
Iterable
[
"KVCacheEvent"
]:
"""
...
...
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