EPD Hidden State path and Store type-aware eviction #14
Loading…
Reference in New Issue
No description provided.
Delete Branch "kancel/Mooncake:ccf-track4-submission"
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?
CCF Mooncake Track 4 Submission
This PR archives the CCF Mooncake Track 4 submission materials under
mooncake-track4/.The submission targets two gaps in multimodal EPD serving:
MooncakeStoreECConnectorimplementation so Encoder Hidden State can bewritten to Mooncake Store and consumed by Prefill workers. This complements
the existing Prefill -> Decode KV Cache path.
semantics and type-aware eviction policies so Hidden State and KV Cache can
be managed differently under the same memory pressure.
abstraction patch that responds to Mooncake review feedback about policy
logic accumulating inside
master_service.The full reproduction commands, environment variables, and troubleshooting
notes are kept in the README files under each subdirectory.
Motivation
Multimodal EPD splits one request into Encoder, Prefill, and Decode stages.
Mooncake and vLLM already provide a KV Cache transfer path for Prefill ->
Decode, but Vision Encoder outputs also need to cross process boundaries.
Without treating Hidden State as a first-class Store object, EPD can split the
process topology but cannot reuse Encoder computation across instances.
Once Hidden State enters Mooncake Store, the Store becomes a mixed-object cache
instead of a KV-only cache. KV Cache objects dominate bytes and are reused
frequently. Hidden State objects are smaller in total bytes, but they are more
expensive to recompute and are reused over longer intervals. A single global
lease-time / LRU-like eviction rule can evict valuable Hidden State too early,
while simply protecting Hidden State can hurt the KV hot path. This motivates
type-aware scoring and per-type capacity guardrails.
Relationship To Upstream
The implementation is designed as an additive extension on top of existing
upstream abstractions:
MooncakeStoreECConnectorreuses the V1ECConnectorBaseScheduler / Worker lifecycle. It does not modify the core scheduler loop,
worker execution loop, or multimodal model code.
MooncakeStoreConnector.policy configured, the default global eviction behavior is preserved.
feedback from Mooncake PR #2746 and the follow-up discussion in issue #2791.
Related upstream work:
vllm-project/vllm#47302kvcache-ai/Mooncake#2743to#2746, plus related follow-up#2689https://github.com/kvcache-ai/Mooncake/issues/2791What's Included
Key artifacts:
patches/vllm/patches/vllm-epd-hidden-ec-connector-b4482f0a1-full-feature.patcharchives the vLLM-side
MooncakeStoreECConnector.epd-vllm-demo/mooncake/epd_vllm_v1_proxy_server.pyarchives the EPD demoproxy used for request splitting and transfer metadata forwarding.
patches/mooncake/0001-store-object-type-aware-eviction-policy.patcharchives the Store object type, type-aware scoring, per-type budget, and
eviction_gracechanges.patches/mooncake/0002-store-hierarchical-eviction-policy-abstraction.patcharchives the policy abstraction follow-up.
Design
1. EPD Hidden State Data Path
MooncakeStoreECConnectorfollows the vLLM EC Connector split betweenScheduler-side planning and Worker-side data movement. The Scheduler side
performs lookup, load/save planning, and connector metadata construction. The
Worker side performs the actual Mooncake Store reads and writes. The EPD proxy
is only a control-plane component; it forwards request metadata and does not
carry tensor payloads.
Hidden State uses a separate key namespace that includes model, vision config,
parallel layout, storage layout, and tensor format information. This prevents
incorrect reuse across incompatible configurations. The stored object format is
a fixed metadata header plus a contiguous tensor payload, matching Mooncake
Store's buffer-registration and range-read capabilities.
2. Failure Model And Compatibility
The submission explicitly separates cache-fill failure, cache-load failure, and
Store API compatibility:
finished. Later requests naturally fall back to the miss / recompute path.
failure does not populate local
encoder_cache; the error is surfaced ratherthan allowing an invalid tensor to continue through inference.
prefers the buffer-registration path when available.
Mooncake Store data path.
configured.
3. Store Type-Aware Eviction
The Store patch adds
ObjectDataType.HIDDEN_STATEand extendsBatchEvictcandidate selection with object type information. The policy knobs are:
reuse_scale: adjusts cross-type victim ranking to reflect recomputationvalue.
eviction_grace: adds an extra protection window for object types whose reuseinterval is longer.
budget_ratio: provides a per-type capacity guardrail so one type does notunboundedly squeeze out another.
The ranking uses type-adjusted age:
budget_ratiois a logical budget rather than a physical partition. The Storekeeps a shared memory pool, while over-budget types contribute victims first
under pressure.
4. Hierarchical Eviction Abstraction
The follow-up patch separates policy planning from
master_servicemetadatamutation.
MasterServicestill scans candidates, revalidates metadata, andperforms the actual deletion. The policy module only works on candidate
references and scope indexes.
The abstraction includes:
Assign: assign eviction responsibility by type, tenant, or future priorityscopes.
Evict: select victim candidates within a scope.Fallback: compensate from the parent scope when a child scope cannot meetits target.
The current patch validates a type-level single-layer abstraction. A full
tenant -> type -> priority recursive executor is future work.
Results
Detailed environment settings and raw result summaries are in
mooncake-track4/EVALUATION.md.1. EPD Correctness
The EPD experiment was run on a single-node, three-GPU TCP-only setup with
Qwen/Qwen2.5-VL-7B-Instruct. The result is correctness and reproducibilityevidence, not an RDMA / SHM performance upper bound.
2. TCP-Only Transfer Baseline
3. Type-Aware Eviction Ablation
The Store benchmark simulates 600 continuous multimodal sessions. KV Cache
accounts for about 90.88% of unique bytes, while Hidden State accounts for about
9.12%. KV is reused more frequently; Hidden State is reused more sparsely but
has higher recomputation cost.
Balanced configuration:
4. Hierarchical Eviction Validation
The hierarchical eviction patch is based on official Mooncake
c9896684. Itadds a standalone policy module and focused unit test coverage for type-level
Assign / Evict / Fallbackplanning, candidate-index isolation from metadatamutation, and compatibility with the default eviction semantics.
eviction_policy_testpasses; full commands are inmooncake-track4/patches/mooncake/README.md.How To Test
The test entrypoints are grouped from minimal smoke to full end-to-end
reproduction. Full build and environment details are in the subdirectory
README files.
From the GitLink repository root:
1. Minimal Smoke: Benchmark Harness
No GPU or EPD service is required.
2. Store Policy Module
Apply
patches/mooncake/0001-store-object-type-aware-eviction-policy.patchtoofficial Mooncake
f4f7fd4a03539974fc39acbd045b1ee4ba0ed967, then buildmooncake_masterand the Python binding. Seeobject-type-eviction-bench/README.mdfor the exact build commands.Single policy case:
Full policy suite:
3. Hierarchical Eviction Patch
4. EPD End-To-End
This requires a three-GPU environment and a patched vLLM runtime. If the server
does not already provide a patched vLLM wheel, apply the vLLM patch documented
in
patches/vllm/README.md.Notes And Limitations
is not an RDMA / SHM performance upper bound.
cache retention behavior, not end-to-end model latency.
f4f7fd4a03539974fc39acbd045b1ee4ba0ed967; current officialmainshouldnot be assumed to accept it directly.
single-layer policy boundary. A full multi-layer executor is future work.
connector itself.
Hidden State object path. Multi-node RDMA, sharded Hidden State, and richer
cross-request cache policies are future work.
Step 1:
From your project repository, check out a new branch and test the changes.Step 2:
Merge the changes and update on Gitea.