Unverified Commit b471aad4 authored by Yihua Cheng's avatar Yihua Cheng Committed by GitHub
Browse files

[KVconnector][LMCache] remove the import of legacy LMCache code (#31704)


Signed-off-by: default avatarApostaC <yihua98@uchicago.edu>
parent d5503ca7
...@@ -6,7 +6,6 @@ import threading ...@@ -6,7 +6,6 @@ import threading
from typing import TYPE_CHECKING, Union from typing import TYPE_CHECKING, Union
import torch import torch
from lmcache.config import LMCacheEngineConfig as Config
from lmcache.logging import init_logger from lmcache.logging import init_logger
from lmcache.v1.config import LMCacheEngineConfig as V1Config from lmcache.v1.config import LMCacheEngineConfig as V1Config
...@@ -20,7 +19,7 @@ logger = init_logger(__name__) ...@@ -20,7 +19,7 @@ logger = init_logger(__name__)
ENGINE_NAME = "vllm-instance" ENGINE_NAME = "vllm-instance"
# Thread-safe singleton storage # Thread-safe singleton storage
_config_instance: Config | V1Config | None = None _config_instance: V1Config | None = None
_config_lock = threading.Lock() _config_lock = threading.Lock()
...@@ -29,7 +28,7 @@ def is_false(value: str) -> bool: ...@@ -29,7 +28,7 @@ def is_false(value: str) -> bool:
return value.lower() in ("false", "0", "no", "n", "off") return value.lower() in ("false", "0", "no", "n", "off")
def lmcache_get_or_create_config() -> Config | V1Config: def lmcache_get_or_create_config() -> V1Config:
"""Get the LMCache configuration from the environment variable """Get the LMCache configuration from the environment variable
`LMCACHE_CONFIG_FILE`. If the environment variable is not set, this `LMCACHE_CONFIG_FILE`. If the environment variable is not set, this
function will return the default configuration. function will return the default configuration.
...@@ -43,16 +42,7 @@ def lmcache_get_or_create_config() -> Config | V1Config: ...@@ -43,16 +42,7 @@ def lmcache_get_or_create_config() -> Config | V1Config:
if _config_instance is None: if _config_instance is None:
with _config_lock: with _config_lock:
if _config_instance is None: # Check again within lock if _config_instance is None: # Check again within lock
if is_false(os.getenv("LMCACHE_USE_EXPERIMENTAL", "True")): LMCacheEngineConfig = V1Config # type: ignore[assignment]
logger.warning(
"Detected LMCACHE_USE_EXPERIMENTAL is set to False. "
"Using legacy configuration is deprecated and will "
"be remove soon! Please set LMCACHE_USE_EXPERIMENTAL "
"to True."
)
LMCacheEngineConfig = Config # type: ignore[assignment]
else:
LMCacheEngineConfig = V1Config # type: ignore[assignment]
if "LMCACHE_CONFIG_FILE" not in os.environ: if "LMCACHE_CONFIG_FILE" not in os.environ:
logger.warning( logger.warning(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment