mirror of
https://github.com/kvcache-ai/Mooncake.git
synced 2026-11-05 01:17:55 +00:00
[GH-ISSUE #2863] [RFC]: TENT Backend Capability Model and First-Class Execution Plan #744
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#744
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 12, 2026).
Original GitHub issue: https://github.com/kvcache-ai/Mooncake/issues/2863
Summary
This RFC proposes a versioned backend capability model and a first-class
ExecutionPlanintermediate representation for TENT.Today TENT can select a transport, choose devices, stage unsupported memory pairs through host memory, and retry with another transport. However, these decisions are represented across
TransportSelector,TransferEngineImpl,ProxyManager, transport-specific capability booleans, and failover state. There is no single object that answers:The proposed model makes the result of path selection explicit and explainable before execution:
The first implementation milestone is intentionally behavior-preserving: add the data model, validation, candidate generation, legacy-path adaptation, and JSON explain output. It must not change the default transport selection or scheduling behavior.
Motivation
This is intended to implement the declarative and dynamic-path parts of the TENT roadmap in #1058 without replacing the transport executors that already work.
The current building blocks are useful but incomplete as a planning model:
Transport::Capabilitiescurrently expresses six memory-pair booleans (dram_to_dram,gpu_to_gpu, and related pairs).ProxyManager.This creates several problems.
1. Selection is implicit
A request can be direct, staged, retried, or degraded, but there is no immutable record of the complete decision. Debugging requires reconstructing decisions from multiple logs and code paths.
2. Capabilities do not describe execution semantics
Two backends that both report
gpu_to_gpu=truecan still differ in:These differences currently live in backend code and special cases rather than in a common contract.
3. Admission cannot charge one consistent resource vector
Direct RDMA, staged GPU→Host→RDMA→Host→GPU, and TCP fallback consume different combinations of NIC bandwidth, QP/CQ capacity, staging buffers, receiver bytes/slots, CPU work, and device-copy bandwidth. Admission and receiver-credit logic need the chosen plan before they can account for those resources consistently.
4. Health and fallback are difficult to explain
A rail or backend may become unavailable after the initial choice. The runtime needs to know which plan dependency changed, which candidates remain valid, and whether the applicable QoS contract permits fallback or degradation.
5. New backends increase scheduler special cases
The long-term goal is for a new backend to register capabilities and execution primitives. Adding a backend should not require repeatedly editing the central planner for vendor-specific behavior.
Goals
BackendCapabilityschema for static execution semantics.Non-goals
Transport, RDMA workers,ProxyManager, or existing staging state machines.Terminology
Physical path shape and decision role are separate dimensions:
Examples:
This avoids treating “Fallback” as if it were a transport topology. A fallback can itself be Direct or Staged.
Proposed capability model
The exact C++ layout is not fixed by this RFC, but the semantic model should cover at least:
The capability describes relatively static backend semantics. Dynamic measurements and health should be separate versioned inputs rather than mutating the capability object:
Keeping static capability and dynamic state separate prevents a stale telemetry sample from changing what a backend fundamentally supports.
Unknown capability fields should be ignored when safe. An unknown schema major version must fail validation or fall back to the legacy selector; it must not silently enable an unsupported path.
Proposed Execution Plan model
An Execution Plan describes one logical transfer owner before it is split into transport-specific slices.
The actual implementation may use compact internal IDs rather than strings in hot paths. Explain strings should be produced outside the transport/slice completion hot path.
Immutability and lifetime
Once validated and admitted, the plan is immutable for one attempt. A retry or changed dependency creates a new plan/attempt generation. Late completion from an old attempt must not mutate the state of the new plan.
Plan dependencies may include:
If a required dependency changes before dispatch, the plan is revalidated or regenerated. Already-dispatched work follows the existing transport cancellation/failure contract; this RFC does not claim that all posted work can be revoked.
Candidate generation
Candidate generation should be bounded and deterministic:
The first version should not implement an unbounded graph search. It should use an explicit maximum stage count and prevent cycles. Initially supported compositions can be registered templates such as:
The planner should return rejection reasons for candidates it filtered out, not only the final winner.
Cost and freshness semantics
Cost is a ranking input, not a guarantee:
Rules:
Resource accounting
The planner computes resource demand; resource owners decide whether to grant it.
Reservation must be atomic for the full plan charge. A staged plan must not reserve network bytes while failing to reserve the staging/consumer slot required to finish it.
Internal staging work should carry a parent plan/attempt ID so its resources and causal metrics can be attributed to the user-visible request without making it an independent policy decision.
Fallback and replanning
The planner may return an ordered candidate set:
The runtime can prevalidate cheap alternatives, but a fallback should be revalidated against current descriptor, policy, health, and credit generations before dispatch.
Fallback after partial progress requires backend-specific failure semantics. A backend that may have partially modified the destination cannot be retried blindly unless the operation is idempotent or the destination is reset/versioned. The capability model must make this explicit; the planner must not infer safety from the transport name.
Explain output
The planner should support human-readable output and sanitized, versioned JSON. Example:
Raw addresses, rkeys, fabric handles, credentials, and unbounded tenant/request identifiers must not appear in a diagnostic bundle by default.
Compatibility and rollout
Suggested rollout modes:
The first PR does not need to expose all three modes; it may contain only the model and pure tests. Before enforced mode is added, shadow mode should demonstrate:
No per-slice plan allocation or JSON formatting is allowed in the RDMA completion hot path. Planning occurs at logical request/queue-owner preparation time, and compact IDs are propagated to slices.
Proposed PR sequence
PR1: Capability and plan model
PR2: Legacy decision adapter and explain
ExecutionPlan.PR3: Candidate generator in shadow mode
PR4: Opt-in Direct plan enforcement
Later PRs
ProxyManager.Validation plan
Model and property tests
Differential tests
For the existing policy matrix, shadow planning must match current behavior for:
policy_nameandtransport_hint;Real-cluster validation
On the existing two-node H20/RoCE environment:
Report plan generation time, submit throughput, transfer throughput/P99, selected/rejected candidates, data integrity, and fallback behavior. Shadow mode should have a defined overhead budget and must not add work to transport completion polling.
Fault injection
Reuse
FaultProxyTransportfrom #1907 to verify:Expected benefits and claims boundary
If implemented, this RFC should provide:
This RFC does not claim higher throughput, lower P99, or better SLO attainment by itself. The initial value is architectural correctness, explainability, and the ability to test later planners against an explicit contract. Any performance claim must come from the real-cluster matrix above.
Relationship to existing work
Open questions
BackendCapability+ExecutionPlanmodel the preferred boundary, or should the first RFC be limited to an explain-only adapter over current decisions?PathKind(Direct/Staged) from decisionPlanRole(Primary/Fallback/Degraded)?Before submitting a new issue...
@github-actions[bot] commented on GitHub (Jul 12, 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
@catyans commented on GitHub (Jul 12, 2026):
Shadow-prototype feasibility result (2026-07-13). This is intentionally not a production implementation benchmark.
Environment: Lingjun H20
lingjun-099, Linux 5.10.134, Intel Xeon Platinum 8575C, Python 3.12.7. The prototype modeled capability filtering and ranking for RDMA, SHM, TCP, staged CUDA->host+TCP, unhealthy-RDMA exclusion and local-recompute fallback.Results:
Interpretation: candidate enumeration over a small registered backend set is computationally cheap enough to remain control-path work, and the proposed capability boundary can express direct, staged and fallback choices without backend-specific branches in the caller. The absolute 691 ns number must not be used as a C++ latency claim: this prototype omits topology graph traversal, live telemetry snapshots, allocation, explain serialization and concurrency. A production PR still needs deterministic cost ordering, generation-consistent telemetry and a bounded candidate count.
@github-actions[bot] commented on GitHub (Oct 11, 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 19, 2026):
Closing due to 3 months of inactivity. If this is still relevant, please comment and we can reopen.