mirror of
https://github.com/kvcache-ai/Mooncake.git
synced 2026-11-05 01:17:55 +00:00
[PR #1251] [CLOSED] [Store][Feature] Update KV event publish system #2107
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#2107
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/1251
Author: @Asher-XunZhang
Created: 12/22/2025
Status: ❌ Closed
Base:
main← Head:zmq_event_publisher📝 Commits (7)
b0289e0Update KV event publisher0303c1aFix some CI review suggestions101c2afMerge remote-tracking branch 'upstream/main' into zmq_event_publisher281ac83Merge remote-tracking branch 'upstream/main' into zmq_event_publisher600a29fMerge remote-tracking branch 'upstream/main' into zmq_event_publishercff97a9Merge remote-tracking branch 'upstream/main' into zmq_event_publisherdc597bdMerge remote-tracking branch 'upstream/main' into zmq_event_publisher📊 Changes
31 files changed (+5004 additions, -46 deletions)
View changed files
📝
dependencies.sh(+140 -0)📝
mooncake-integration/store/store_py.cpp(+29 -2)📝
mooncake-store/include/client_service.h(+12 -3)📝
mooncake-store/include/dummy_client.h(+2 -1)➕
mooncake-store/include/kv_event/kv_event.hpp(+214 -0)➕
mooncake-store/include/kv_event/kv_event_consumer.h(+220 -0)➕
mooncake-store/include/kv_event/kv_event_producer.h(+163 -0)➕
mooncake-store/include/kv_event/kv_event_publisher_config.h(+47 -0)➕
mooncake-store/include/kv_event/kv_event_system.h(+161 -0)➕
mooncake-store/include/kv_event/kv_event_types.h(+50 -0)➕
mooncake-store/include/kv_event_publisher.h(+13 -0)📝
mooncake-store/include/master_client.h(+7 -4)📝
mooncake-store/include/master_config.h(+77 -0)📝
mooncake-store/include/master_service.h(+39 -1)📝
mooncake-store/include/pyclient.h(+3 -1)📝
mooncake-store/include/real_client.h(+4 -2)📝
mooncake-store/include/rpc_service.h(+6 -4)📝
mooncake-store/include/thread_pool.h(+7 -1)➕
mooncake-store/include/thread_safe_queue.h(+564 -0)📝
mooncake-store/src/CMakeLists.txt(+7 -1)...and 11 more files
📄 Description
Description
motivation: [RFC]: Mooncake-Conductor: Design and Implementation of a Global Scheduler Module for KV-Cache-Centric Disaggregated Architecture #977
Add a kv event publish system: it consists of events and an asynchronous sender, a kv event publisher based on ZMQ. Co-work with @Liziqi-77 @yejj710
PR Overview
Summary of the KV Event System File Structure
include/kv_event/kv_event.hppKVCacheEvent:Abstract base class for events, defines serialization interfaceBlockStoreEvent:Event for the first time KV cache is storedBlockUpdateEvent:Event for any replica update operationsRemoveAllEvent:Event for clearing all cached dataEventBatch:Event batch class for improving transmission efficiencyStoreEventInfometadatakv_event_types.hQueuedItem:Queue item struct, combines an event and a promise.KVEventPtrandKVEventQueue, implements thread-safe queue based onThreadSafeQueuekv_event_producer.hKVEventProducer:Event producer class, manages event creation and queueingkv_event_consumer.hKVEventConsumer:Event consumer class, processes queued events and publishes them over the networkkv_event_system.hKVEventSystem:Event system facade class, hides internal complexitykv_event_publisher_config.hKVEventPublisherConfig:System configuration structkv_event_publisher.hkv_event/subdirectorythread_safe_queue.hThreadSafeQueue<T>:Core thread-safe queue template class, provides blocking/timeout push/pop operations, batch processing, queue state query, and graceful shutdown functionality, supporting flexible type for template parameter Tsrc/kv_event_publisher.cppSystem Architecture Relationships
KVEventSystem::publishKVEventSystemdelegates toKVEventProducerto create and enqueue eventsKVEventQueueKVEventConsumerconsumes events from the queue, batches them, and publishes viaZeroMQKVEventSystemacts as a facade class, coordinating all componentsKVEventQueuekv_event.hppZeroMQimplementation as the inference engine for high-performance network communicationmsgpackas the inference engine for serializingkv-eventinformationType of Change
How Has This Been Tested?
I've added 2 new UTs: kv_event_publisher_test and thread_safe_queue_test
Checklist
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.