SWA Prefix Cache (#7367)

Co-authored-by: Ying Sheng <sqy1415@gmail.com>
This commit is contained in:
Hanming LuandYing Sheng authored and GitHub committed 2025-07-13 12:31:07 -07:00
1 parent 0c55cbcfc5
commit 9379da77de
16 files changed
+1742 -158

No files matched your search

+9 -1
View File
@@ -439,7 +439,15 @@ class DecodePreallocQueue:
else 0
)
allocatable_tokens = self.token_to_kv_pool_allocator.available_size() - max(
if self.scheduler.model_config.is_hybrid:
available_size = min(
self.token_to_kv_pool_allocator.full_available_size(),
self.token_to_kv_pool_allocator.swa_available_size(),
)
else:
available_size = self.token_to_kv_pool_allocator.available_size()
allocatable_tokens = available_size - max(
# preserve some space for future decode
self.num_reserved_decode_tokens
* (