mirror of
https://github.com/kvcache-ai/Mooncake.git
synced 2026-11-05 01:17:55 +00:00
[PR #587] [MERGED] [Store] Soft Pin for Important Object #1672
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#1672
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?
📋 Pull Request Information
Original PR: https://github.com/kvcache-ai/Mooncake/pull/587
Author: @ykwd
Created: 7/3/2025
Status: ✅ Merged
Merged: 7/8/2025
Merged by: @ykwd
Base:
main← Head:feature/vip_kv📝 Commits (10+)
0842a25Basic implementation with unit testsfdf08feBug fixbad6935Optimize the eviciton algorithm851875eAdd flag to configure allowing evict oft pinned objects or not9187cbcUpdate docs for soft pinc1c443cBug fix and Minor updatese399d7bMerge main9bfc61cMinor updateab455a0merge main89e47bcFix ci error: Only enable ssd offload feature in test_ssd_offload_in_evict.py📊 Changes
18 files changed (+613 additions, -102 deletions)
View changed files
📝
.github/workflows/ci.yml(+1 -30)📝
doc/en/mooncake-store-preview.md(+15 -1)📝
doc/zh/mooncake-store-preview.md(+15 -1)📝
docs/source/design/mooncake-store-preview.md(+15 -1)📝
mooncake-store/include/ha_helper.h(+6 -2)📝
mooncake-store/include/master_metric_manager.h(+4 -0)📝
mooncake-store/include/master_service.h(+56 -13)📝
mooncake-store/include/rpc_service.h(+6 -1)📝
mooncake-store/include/types.h(+5 -0)📝
mooncake-store/src/ha_helper.cpp(+9 -5)📝
mooncake-store/src/master.cpp(+13 -2)📝
mooncake-store/src/master_metric_manager.cpp(+12 -1)📝
mooncake-store/src/master_service.cpp(+174 -25)📝
mooncake-store/tests/allocation_strategy_test.cpp(+9 -9)📝
mooncake-store/tests/client_integration_test.cpp(+3 -3)📝
mooncake-store/tests/master_service_test.cpp(+263 -2)📝
mooncake-wheel/tests/test_ssd_offload_in_evict.py(+1 -3)📝
scripts/run_tests.sh(+6 -3)📄 Description
Contents
This PR adds a soft pin mechanism for important and frequently used objects, such as system prompts. When putting an object, it can be configured to enable soft pin. During eviction, objects that are not soft pinned are prioritized for eviction. Soft pinned objects are only evicted when memory is insufficient and no other objects are eligible for eviction.
If a soft pinned object is not accessed for an extended period, its soft pin status will be removed. If it is accessed again later, it will automatically be soft pinned once more.
There are two startup parameters in
master_servicerelated to the soft pin mechanism:default_kv_soft_pin_ttl: The duration (in milliseconds) after which a soft pinned object will have its soft pin status removed if not accessed. The default value is30 minutes.allow_evict_soft_pinned_objects: Whether soft pinned objects are allowed to be evicted. The default value istrue.Notably, soft pinned objects can still be removed using APIs such as
RemoveorRemoveAll.P.S.
Currently, the soft pin cannot be set via Python APIs, as the
PutorBatchPutAPIs in Python do not have configuration parameters. Therefore, the soft pin mechanism is marked as "Upcoming" in the docs.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.