Repository navigation
[Reshard] Plan Store KV reuse across TP, PP and host layouts - #4762
Conversation
Define semantic cache identities and immutable source layouts, compute target-driven logical intersections, and lower every token of each page into validated byte ranges. Plans identify source Part indices and relative offsets; Store RPCs, discovery, leases and data transfer are outside this commit. Include independent byte-exact layout and topology tests.
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
| regions = {r.region_id: r for r in binding.regions} | ||
| groups: dict[tuple[int, KVCacheComponent], list[KVCacheResolvedRange]] = {} | ||
| spans: list[tuple[int, int]] = [] | ||
| for item in binding.ranges: |
There was a problem hiding this comment.
- Share the range geometry validation
validate_store_binding() duplicates much of the range validation in resolved.py. Could we extract a shared geometry validator while keeping Store and R2R identity checks separate? This would avoid maintaining the same bounds, stride, and coverage rules twice
There was a problem hiding this comment.
Thanks for catching this. I extracted a shared geometry validator for bounds, strides, alignment, overlap, coverage, and validation limits. Store and R2R retain separate binding types and identity checks, including R2R snapshot validation.
| layout: KVCacheStoreLayout, | ||
| target_placement: KVCachePlacementManifest, | ||
| *, | ||
| runtime_format: KVCacheStoreFormat, |
There was a problem hiding this comment.
- Remove the unused runtime_format parameter
runtime_format is only type-checked and does not affect the plan; destination layout comes from the runtime binding strides. Could we remove this parameter before the API is finalized?
There was a problem hiding this comment.
Agreed. I removed runtime_format from the load-planning API and updated the callers and tests, including the page reader in the follow-up implementation.
… API Keep Store and R2R binding identity checks separate while sharing bounds, stride, coverage and validation-limit checks. Remove the unused runtime_format argument from Store load planning and update its tests. Signed-off-by: huanglong <huanglong@linux.alibaba.com>
…20261021 * upstream/main: (507 commits) [Reshard] Plan Store KV reuse across TP, PP and host layouts (kvcache-ai#4762) [Store] Walk tenants through shard-backed cursors and build the removes on them (kvcache-ai#4796) [Store-RS][Bugfix] Match TENT Request Layout to the C ABI (kvcache-ai#4732) [TransferEngine] Recover auto GID after data-path retry exhaustion (kvcache-ai#4290) [Store] Add the namespace layer over the object route (kvcache-ai#4721) [Store] Fix silent loss of offload keys deferred to the ungrouped pool (kvcache-ai#3006) (kvcache-ai#3009) [Store] Remove redundant alignment headroom from DFS shard allocation (kvcache-ai#4753) [CI/Build] Gate ROCm hardware tests and bound nightly Docker builds (kvcache-ai#4750) [Bugfix][Store] Fix double-counting of segment OpLog metrics in OpLogApplier (kvcache-ai#4771) [Store] Skip hot-cache writeback for device-resident read destinations (kvcache-ai#4764) [Reshard] Add bounded in-flight execution for weight transfers (kvcache-ai#4628) [Store] Avoid racing with detached hot-cache fills during key scans (kvcache-ai#4334) [Store] HA: drain the master on SIGTERM/SIGINT before exit (part 1 of kvcache-ai#4710) (kvcache-ai#4745) TENT: report a notification the receiver could not take (kvcache-ai#4754) [Store] Reach object metadata through a per-key accessor contract (kvcache-ai#4717) [Store][Bugfix] Fix DFS sync client test retry failure (kvcache-ai#4781) [Wheel] Keep integer dtype for typed_ragged rows when a row is an empty list (kvcache-ai#4611) [Doc] Sync README news onto the docs homepage (kvcache-ai#4767) [CI] remove stale Torch version binding after PG JIT (kvcache-ai#4760) [TransferEngine] Add buffer-protocol and page-gathered batch transfer APIs (kvcache-ai#4763) ...
…-ranges-20261021 * upstream/main: (394 commits) [Reshard] Plan Store KV reuse across TP, PP and host layouts (kvcache-ai#4762) [Store] Walk tenants through shard-backed cursors and build the removes on them (kvcache-ai#4796) [Store-RS][Bugfix] Match TENT Request Layout to the C ABI (kvcache-ai#4732) [TransferEngine] Recover auto GID after data-path retry exhaustion (kvcache-ai#4290) [Store] Add the namespace layer over the object route (kvcache-ai#4721) [Store] Fix silent loss of offload keys deferred to the ungrouped pool (kvcache-ai#3006) (kvcache-ai#3009) [Store] Remove redundant alignment headroom from DFS shard allocation (kvcache-ai#4753) [CI/Build] Gate ROCm hardware tests and bound nightly Docker builds (kvcache-ai#4750) [Bugfix][Store] Fix double-counting of segment OpLog metrics in OpLogApplier (kvcache-ai#4771) [Store] Skip hot-cache writeback for device-resident read destinations (kvcache-ai#4764) [Reshard] Add bounded in-flight execution for weight transfers (kvcache-ai#4628) [Store] Avoid racing with detached hot-cache fills during key scans (kvcache-ai#4334) [Store] HA: drain the master on SIGTERM/SIGINT before exit (part 1 of kvcache-ai#4710) (kvcache-ai#4745) TENT: report a notification the receiver could not take (kvcache-ai#4754) [Store] Reach object metadata through a per-key accessor contract (kvcache-ai#4717) [Store][Bugfix] Fix DFS sync client test retry failure (kvcache-ai#4781) [Wheel] Keep integer dtype for typed_ragged rows when a row is an empty list (kvcache-ai#4611) [Doc] Sync README news onto the docs homepage (kvcache-ai#4767) [CI] remove stale Torch version binding after PG JIT (kvcache-ai#4760) [TransferEngine] Add buffer-protocol and page-gathered batch transfer APIs (kvcache-ai#4763) ...
Description
First PR for #4719
Instances with different TP/PP configurations need to map stored KV data to their current placement. This PR adds a standalone Python planner that converts a source manifest and target placement into byte ranges covering every token of each page, ready for subsequent Store execution.
Store execution, manifest publication/discovery, and framework integration follow in separate PRs.
The semantics for 'multipart' have not yet been fully implemented in Mooncake, so the review could be paused.
Suggested Merge Priority
Module
mooncake-transfer-engine)mooncake-store)mooncake-conductor)mooncake-reshard)mooncake-ep)mooncake-pg)mooncake-integration)mooncake-p2p-store)mooncake-wheel)mooncake-common)mooncake-rl)Type of Change
How Has This Been Tested?
Test commands:
Test results:
Checklist
./scripts/code_format.shAI Assistance Disclosure
Codex assisted with implementation, testing, and commit organization. The human submitter is responsible for final review.