Skip to content

fix(pytorch): include embedding content in prefix-cache identity - #4985

Draft
gokay-ai wants to merge 1 commit into
InternLM:mainfrom
gokay-ai:cursor/fix-prefix-cache-embedding-identity-e23f
Draft

gokay-ai wants to merge 1 commit into
InternLM:mainfrom
gokay-ai:cursor/fix-prefix-cache-embedding-identity-e23f

Conversation

@gokay-ai

Copy link
Copy Markdown

Motivation

Prefix-cache extra identity keyed embedding spans by token range only. Two requests with the same token ids but different input_embeddings could reuse the wrong KV.

Fixes #4933

Modification

Hash embedding content into the trie identity (same idea as the multimodal-span path). Unit coverage in the block-trie tests.

Prefix-cache extra identity previously keyed embedding spans by token
range only. Requests with the same token ids and different
input_embeddings could reuse the wrong KV. Hash embedding content into
the trie identity, matching the multimodal-span path.

Fixes InternLM#4933

Signed-off-by: GokayAI <60583610+gokay-ai@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] input_embeddings are omitted from prefix-cache identity, causing wrong KV reuse

1 participant