Refactor prefix cache type checking (#17028)
This commit is contained in:
@@ -30,6 +30,9 @@ class ChunkCache(BasePrefixCache):
|
||||
|
||||
self.protected_size_ = 0
|
||||
|
||||
def is_chunk_cache(self) -> bool:
|
||||
return True
|
||||
|
||||
# NOTE (csy): this is to determine if a cache has prefix matching feature.
|
||||
# Chunk cache always return True to indicate no prefix matching.
|
||||
# TODO (csy): Using a prefix cache trait to replace this
|
||||
@@ -106,6 +109,9 @@ class SWAChunkCache(ChunkCache):
|
||||
|
||||
self.chunked_prefill_size = params.chunked_prefill_size
|
||||
|
||||
def supports_swa(self) -> bool:
|
||||
return True
|
||||
|
||||
def evict_swa(
|
||||
self,
|
||||
req: Req,
|
||||
|
||||
Reference in New Issue
Block a user