mirror of
https://github.com/kvcache-ai/Mooncake.git
synced 2026-11-05 01:17:55 +00:00
[GH-ISSUE #632] [Feature Request]: does mooncacke-store need a cachelib rebalance strategy #207
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#207
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 @wwq2333 on GitHub (Jul 16, 2025).
Original GitHub issue: https://github.com/kvcache-ai/Mooncake/issues/632
Describe your feature request
When the cached obj sizes are not strictly consistent, it leads to poor fragmentation in the cache memory footprint;
This phenomenon occurs when we use mooncacke-store cluster as a large kvcache pool. Even if we remove_all all obj, putting values of different sizes will frequently fail to allocate; So should we set up some rebalance strategy?
Before submitting a new issue...
@ykwd commented on GitHub (Jul 16, 2025):
Thanks for reporting this — the issue you encountered is indeed a bug.
The root cause is that we only integrated a part of the
cachelib. In the current implementation, there are multipleAllocationClass, each responsible for a different size range. When a memory allocation of size S is requested, the system selects anAllocationClasswhose managed size is the smallest one greater than or equal to S. Once memory has been allocated under a specificAllocationClass, it remains tied to that class even after being freed, and cannot be reused for allocations of other sizes.We've identified this issue and are actively working on a fix. Sorry for the inconvenience!
@ykwd commented on GitHub (Jul 24, 2025):
In this pr https://github.com/kvcache-ai/Mooncake/pull/657, we’ve introduced a new memory allocator, the OffsetAllocator, which resolves this issue. The previous CacheLib-based allocator is now optional, and fixes for it are currently in progress.