Refactor prefix cache type checking (#17028)

This commit is contained in:
Ke Bao
2026-01-15 11:28:13 +08:00
committed by GitHub
parent 6b065298b5
commit 7f8a58fffb
12 changed files with 71 additions and 36 deletions
@@ -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,