[Core] Support reseting all running requests' KV while calling reset_prefix_cache (#28827)
Signed-off-by: Zhuohan Li <zhuohan123@gmail.com> Signed-off-by: Nick Hill <nhill@redhat.com> Co-authored-by: Nick Hill <nhill@redhat.com>
This commit is contained in:
@@ -138,7 +138,7 @@ class EngineCoreClient(ABC):
|
||||
def reset_mm_cache(self) -> None:
|
||||
raise NotImplementedError
|
||||
|
||||
def reset_prefix_cache(self) -> None:
|
||||
def reset_prefix_cache(self, reset_running_requests: bool = False) -> bool:
|
||||
raise NotImplementedError
|
||||
|
||||
def sleep(self, level: int = 1) -> None:
|
||||
@@ -208,7 +208,9 @@ class EngineCoreClient(ABC):
|
||||
async def reset_mm_cache_async(self) -> None:
|
||||
raise NotImplementedError
|
||||
|
||||
async def reset_prefix_cache_async(self) -> None:
|
||||
async def reset_prefix_cache_async(
|
||||
self, reset_running_requests: bool = False
|
||||
) -> bool:
|
||||
raise NotImplementedError
|
||||
|
||||
async def sleep_async(self, level: int = 1) -> None:
|
||||
@@ -287,8 +289,8 @@ class InprocClient(EngineCoreClient):
|
||||
def reset_mm_cache(self) -> None:
|
||||
self.engine_core.reset_mm_cache()
|
||||
|
||||
def reset_prefix_cache(self) -> None:
|
||||
self.engine_core.reset_prefix_cache()
|
||||
def reset_prefix_cache(self, reset_running_requests: bool = False) -> bool:
|
||||
return self.engine_core.reset_prefix_cache(reset_running_requests)
|
||||
|
||||
def sleep(self, level: int = 1) -> None:
|
||||
self.engine_core.sleep(level)
|
||||
@@ -751,8 +753,8 @@ class SyncMPClient(MPClient):
|
||||
def reset_mm_cache(self) -> None:
|
||||
self.call_utility("reset_mm_cache")
|
||||
|
||||
def reset_prefix_cache(self) -> None:
|
||||
self.call_utility("reset_prefix_cache")
|
||||
def reset_prefix_cache(self, reset_running_requests: bool = False) -> bool:
|
||||
return self.call_utility("reset_prefix_cache", reset_running_requests)
|
||||
|
||||
def add_lora(self, lora_request: LoRARequest) -> bool:
|
||||
return self.call_utility("add_lora", lora_request)
|
||||
@@ -955,8 +957,12 @@ class AsyncMPClient(MPClient):
|
||||
async def reset_mm_cache_async(self) -> None:
|
||||
await self.call_utility_async("reset_mm_cache")
|
||||
|
||||
async def reset_prefix_cache_async(self) -> None:
|
||||
await self.call_utility_async("reset_prefix_cache")
|
||||
async def reset_prefix_cache_async(
|
||||
self, reset_running_requests: bool = False
|
||||
) -> bool:
|
||||
return await self.call_utility_async(
|
||||
"reset_prefix_cache", reset_running_requests
|
||||
)
|
||||
|
||||
async def sleep_async(self, level: int = 1) -> None:
|
||||
await self.call_utility_async("sleep", level)
|
||||
|
||||
Reference in New Issue
Block a user