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
e7ef61c1
Unverified
Commit
e7ef61c1
authored
May 14, 2025
by
majianpeng
Committed by
GitHub
May 13, 2025
Browse files
[Bugfix][Example] make lmcache v0 work. (#18051)
Signed-off-by:
Ma, Jianpeng
<
jianpeng.ma@intel.com
>
parent
d4154c35
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
examples/lmcache/cpu_offload_lmcache.py
examples/lmcache/cpu_offload_lmcache.py
+4
-2
No files found.
examples/lmcache/cpu_offload_lmcache.py
View file @
e7ef61c1
...
...
@@ -34,7 +34,7 @@ from vllm.config import KVTransferConfig
from
vllm.engine.arg_utils
import
EngineArgs
def
setup_environment_variables
():
def
setup_environment_variables
(
vllm_version
:
str
):
# LMCache-related environment variables
# Use experimental features in LMCache
os
.
environ
[
"LMCACHE_USE_EXPERIMENTAL"
]
=
"True"
...
...
@@ -44,6 +44,8 @@ def setup_environment_variables():
os
.
environ
[
"LMCACHE_LOCAL_CPU"
]
=
"True"
# Set local CPU memory limit to 5.0 GB
os
.
environ
[
"LMCACHE_MAX_LOCAL_CPU_SIZE"
]
=
"5.0"
if
vllm_version
==
"v0"
:
os
.
environ
[
"VLLM_USE_V1"
]
=
"0"
@
contextlib
.
contextmanager
...
...
@@ -120,7 +122,7 @@ def main():
lmcache_connector
=
"LMCacheConnectorV1"
model
=
"meta-llama/Meta-Llama-3.1-8B-Instruct"
setup_environment_variables
()
setup_environment_variables
(
args
.
version
)
with
build_llm_with_lmcache
(
lmcache_connector
,
model
,
args
.
version
)
as
llm
:
...
...
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