mirror of
https://github.com/kvcache-ai/Mooncake.git
synced 2026-11-05 01:17:55 +00:00
[GH-ISSUE #2946] [RFC]: Store-to-TENT QoS Integration Boundary for Foreground Transfers and Background Offload #762
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#762
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 @catyans on GitHub (Jul 16, 2026).
Original GitHub issue: https://github.com/kvcache-ai/Mooncake/issues/2946
Changes proposed
Summary
This RFC discusses how Mooncake Store traffic should participate in TENT QoS so that latency-sensitive transfers are protected from background offload traffic.
A representative serving workload has two priority classes:
The main contention is on NIC TX and accelerator PCIe outbound bandwidth. A background Store write should not delay a foreground KV handoff that gates time-to-first-token. This RFC compares three integration boundaries:
The proposed rollout is C first, then B if PCIe-side interference remains measurable. Option A should remain a longer-term choice only if TENT is intentionally expanded into a general data-movement runtime.
This RFC is an integration proposal. It does not redefine the intent schema, QoS contract, budget scheduler, execution plan, or local admission queue proposed in #2865, #2856, #2866, #2863, and #2132. Instead, it asks how Mooncake Store should consume those mechanisms and where the ownership boundary should be.
Motivation
Consider the following traffic classes:
Foreground prefix fetch often uses the opposite direction from background writes, so it should remain concurrent when the resources do not conflict. The scheduler must therefore reason about resources and direction; a single global HIGH/LOW gate would unnecessarily serialize independent RX/IN and TX/OUT work.
The required behavior is cooperative preemption:
Already-posted WQEs and already-submitted DMA or NVMe operations generally cannot be revoked. Therefore, the protection bound depends on both slice size and the global LOW in-flight window, not on queue ordering alone.
Current code shape
The observations below use commit
9c6125f.Store traffic does not have one execution path
Store
Putdispatches disk writes toPutToLocalFile, while memory and NoF replicas go throughTransferSubmitter(client_service.cpp).TransferSubmitterthen selects local memcpy, Transfer Engine, SPDK NoF, or file-read execution depending on replica type and locality (transfer_task.cpp). These executors do not share one priority scheduler.The file-put path performs synchronous accelerator-to-host copying into a pinned buffer before submitting
StorageBackend::StoreObjectto the write pool (client_service.cpp). Deferring this copy requires an explicit buffer-lifetime contract; queueing a raw pointer after the caller may reuse it would be unsafe.Store priority is not propagated to TENT
Remote memory replica transfers construct the legacy
Transport::TransferRequest(transfer_task.cpp). The legacy request has no intent or QoS priority field (transport.h), and the adapter does not populate those fields when creatingtent::Request(transfer_engine.cpp). The effective result is the TENT default priority rather than Store-aware classification.TENT already contains useful QoS primitives
TENT RDMA slicing preserves request priority and passes it into device selection and worker dispatch (
rdma_transport.cpp). RDMA workers maintain three priority queues and select HIGH before MEDIUM before LOW (workers.cpp,workers.cpp).However:
SharedSlotManagerprovides cross-process slot visibility/gating, not a cross-process priority queue or global LOW in-flight budget.Hardware QoS is a QP-pool decision
SL/traffic class is associated with configured QP pools and selected by policy. A practical design uses distinct HIGH and LOW named QP pools. It should not claim per-WQE hardware preemption. End-to-end network differentiation also requires matching switch DCB/PFC/ETS configuration.
Goals
Non-goals
Common semantic contract
All three options need the same semantic plumbing:
The concrete names and ABI should reuse #2865 and #2856 rather than introduce a second public schema. The important integration requirement is end-to-end propagation:
Unknown legacy callers should be visible as
UNKNOWNin metrics. A compatibility default may be necessary during rollout, but silently treating every Store request as HIGH should not be the steady state.Resource accounting should distinguish at least:
A non-GDR remote write is a staged pipeline rather than one resource charge:
Option A: route all storage data movement through TENT
Design
Expand TENT into a general data-movement runtime. P2D, remote memory, remote SSD, local SSD, accelerator/host copies, and prefix fetches are represented as logical transfer DAGs scheduled by one resource-aware runtime.
A logical request would contain ordered stages, stable buffer ownership, resource charges, priority/intent, completion, and cancellation metadata. The Execution Plan work in #2863 is the natural representation boundary.
Scheduling rules:
Required implementation work
Benefits
Risks
Option B: layered QoS with unified admission and existing executors
Design
Keep TENT, memcpy workers, file workers, SPDK/NoF, and storage backends as execution owners. Extend the Admission Queue from #2132, or a shared layer above it, so every executor must acquire a resource-scoped permit before submitting its next slice.
Example permit:
Rules:
high_pending[resource]; new conflicting LOW permits stop.Cross-process shared state should include:
The uncontended path should remain an atomic fast path. Heartbeats/generations reclaim leaked permits after process failure.
Buffer-lifetime boundary
This option still cannot defer the synchronous file-put D2H safely without source retention or owned staging memory. The path should remain explicitly
unmanageduntil that contract exists. Network and stable-buffer paths can be integrated first.Benefits
Risks
Option C: route only remote Store network traffic through TENT
Design
Address the clearest conflict first: foreground handoff and background remote Store writes sharing NIC TX.
“Remote Store” must first be classified:
StorageBackend. TENT cannot directly schedule it. The backend must expose bounded slices, completion, stable buffers, and endpoint/resource metadata; otherwise only coarse external rate limiting is possible.Minimum changes for case 1:
global_low_inflight_bytes, per-process LOW bytes, per-QP outstanding WRs, and LOW slice size;high_pendingfor processes sharing the selected NIC;The cooperative yield bound is approximately:
Reducing slice size without limiting the total number of posted LOW WQEs does not provide this bound.
Coverage boundary
Option C protects the TENT-managed network portion. It does not guarantee that:
These limitations must be visible in metrics and documentation.
Benefits
Risks
Comparison
Proposed rollout
Phase 0: semantics and observability
UNKNOWNandunmanaged_transfer_bytesmetrics.Phase 1: Option C
high_pendingand global LOW in-flight accounting.Phase 2: evaluate the remaining interference
Phase 3: Option B
Phase 4: reconsider Option A
Only proceed if maintainers want TENT to own general data movement and the executor/lifetime refactor is justified by broader use cases.
Metrics and validation
Required metrics
Validation matrix
Proposed initial acceptance targets, subject to benchmark agreement:
Relationship to existing RFCs
Open questions
Before submitting a new issue...
@github-actions[bot] commented on GitHub (Jul 16, 2026):
Thanks for opening this issue, @catyans!
18214026A maintainer will triage this when possible. To help us respond faster, please include:
Useful links: Documentation · Contributing guide
@github-actions[bot] commented on GitHub (Oct 15, 2026):
This issue has had no activity for 90 days and will be closed in 7 days if there is no further activity. Please comment or react if it should stay open.
@github-actions[bot] commented on GitHub (Oct 22, 2026):
Closing due to 3 months of inactivity. If this is still relevant, please comment and we can reopen.