[feat] Add per-block extra_keys to KV events (#33304)
Signed-off-by: zhongdaor-nv <zhongdaor@nvidia.com> Co-authored-by: Nicolò Lucchesi <nlucches@redhat.com> Co-authored-by: Cyrus Leung <tlleungac@connect.ust.hk>
This commit is contained in:
co-authored by
Nicolò Lucchesi
Cyrus Leung
parent
991d6bff38
commit
a0fe7ea2f0
@@ -114,6 +114,9 @@ class Request:
|
||||
|
||||
self.prompt_token_ids = prompt_token_ids
|
||||
self.prompt_embeds = prompt_embeds
|
||||
# Cache per-block prompt-embed hashes to avoid rehashing the same
|
||||
# tensor slices when generating extra keys.
|
||||
self._prompt_embeds_per_block_hashes: dict[tuple[int, int], bytes] = {}
|
||||
self.num_prompt_tokens = length_from_prompt_token_ids_or_embeds(
|
||||
prompt_token_ids, prompt_embeds
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user