Fix radix cache key to include generated tokens in multi-turn (regression) (#16521)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
This commit is contained in:
Yi-Chia Chen
2026-02-11 06:08:34 +08:00
committed by GitHub
parent 4262f5259b
commit 2bfab1bb67

View File

@@ -463,7 +463,7 @@ class RadixCache(BasePrefixCache):
]
# Maybe convert to bigram keys for EAGLE
keys = convert_to_bigram_key(req.fill_ids) if self.is_eagle else req.fill_ids
keys = convert_to_bigram_key(token_ids) if self.is_eagle else token_ids
keys = self._page_align_keys(keys)
values = kv_indices[: len(keys)].to(dtype=torch.int64, copy=True)
radix_key = RadixKey(keys, req.extra_key, is_bigram=self.is_eagle)
@@ -501,7 +501,7 @@ class RadixCache(BasePrefixCache):
]
# Maybe convert to bigram keys for EAGLE
keys = convert_to_bigram_key(req.fill_ids) if self.is_eagle else req.fill_ids
keys = convert_to_bigram_key(token_ids) if self.is_eagle else token_ids
keys = self._page_align_keys(keys)
values = kv_indices[: len(keys)].to(dtype=torch.int64, copy=True)
radix_key = RadixKey(keys, req.extra_key, is_bigram=self.is_eagle)