mirror of
https://github.com/kvcache-ai/Mooncake.git
synced 2026-11-05 01:17:55 +00:00
[GH-ISSUE #644] [Usage]: MooncakeStore #209
Labels
No labels
ascend
auto-closed
bug
bug
CI/Build
Common
documentation
enhancement
feature request
good first issue
help wanted
high priority
MetaX
nightly-failure
pull-request
PyTorch Backend
question
RFC
Roadmap
stale
Store
Tests
Transfer Engine
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
kvcache-ai/Mooncake#209
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @longyuetang on GitHub (Jul 19, 2025).
Original GitHub issue: https://github.com/kvcache-ai/Mooncake/issues/644
Describe your usage question
In MooncakeStore, the hash value of the input tokens is truncated and used as the key. What if a hash collision occurs? Wouldn't that corrupt the KV cache data?
Before submitting a new issue...
@ykwd commented on GitHub (Jul 20, 2025):
As far as I know, the prefix hash of the input tokens, which is used as the key for KV-cache indexing, is not truncated. Could you clarify where exactly the truncation is happening?
@longyuetang commented on GitHub (Jul 20, 2025):
@ykwd commented on GitHub (Jul 21, 2025):
@ShangmingCai Could you take a look? Thanks.
@ShangmingCai commented on GitHub (Jul 21, 2025):
@jialei-jialei Yeah, this is possible, all hash method has this issue, but the chance is very tiny. Just like the block hash in vllm page attention. BTW, if
current_tokensof different requests are identical, it means their prompts are identical, that's when we reuse kvcache. You'd better check whatinput_tokens_tensorreally means.@longyuetang commented on GitHub (Jul 23, 2025):
My point is, if different current_tokens end up with identical hash values, MoonStore would retrieve the wrong data. This is what I'm questioning. I’d like to understand—even if the probability is extremely low, would such a case still be negligible in practice?
@ShangmingCai commented on GitHub (Jul 23, 2025):
@jialei-jialei Yes, I think it is negligible. Although we didn't split kvcache at the block level for this version, you can refer to the content-hash-based impl of https://github.com/vllm-project/vllm/blob/main/vllm/core/block/prefix_caching_block.py#L54-L67, which shares a similar hash-based design.