[Fix] DSV4 cached_loc invalidated when SWA mapping is rebuilt (#25889)

Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Cheng Wan
2026-05-20 22:38:12 -07:00
committed by GitHub
co-authored by Claude Sonnet 4.6
parent 3a6de13cd8
commit 888a8794ef
4 changed files with 462 additions and 0 deletions
@@ -492,6 +492,10 @@ class DeepSeekV4TokenToKVPool(BaseSWAKVPool):
def register_mapping(self, full_to_swa_index_mapping: torch.Tensor):
self.full_to_swa_index_mapping = full_to_swa_index_mapping
self.cached_loc = None # mapping replaced; discard any cached translation
def invalidate_loc_cache(self) -> None:
self.cached_loc = None
def get_ring_size(self, compress_ratio: int) -> int:
server_args = get_global_server_args()