Refactor eagle bigram key matching (#13714)

This commit is contained in:
Liangsheng Yin
2025-11-22 20:40:42 +08:00
committed by GitHub
parent a92afb00c6
commit ac43822634
7 changed files with 89 additions and 181 deletions
+3 -3
View File
@@ -562,8 +562,8 @@ class Req:
self.host_hit_length = 0
# The node to lock until for swa radix tree lock ref
self.swa_uuid_for_lock: Optional[int] = None
# The prefix length of the last prefix matching
self.last_matched_prefix_len: int = 0
# The prefix length that is inserted into the tree cache
self.cache_protected_len: int = 0
# Whether or not if it is chunked. It increments whenever
# it is chunked, and decrement whenever chunked request is
@@ -775,7 +775,7 @@ class Req:
else {}
),
)
self.last_matched_prefix_len = len(self.prefix_indices)
self.cache_protected_len = len(self.prefix_indices)
self.extend_input_len = len(self.fill_ids) - len(self.prefix_indices)
# Based on https://github.com/vllm-project/vllm/blob/7a64d24aad69e4d2548aa0bf528d9fe63428ab01/vllm/transformers_utils/detokenizer.py#L194-L313