mirror of
https://github.com/kvcache-ai/Mooncake.git
synced 2026-11-05 01:17:55 +00:00
[GH-ISSUE #4598] [RFC]: TENT Multi-Rail RDMA Selection Observability #1172
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#1172
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 @RuixiangMa on GitHub (Oct 12, 2026).
Original GitHub issue: https://github.com/kvcache-ai/Mooncake/issues/4598
Status
This RFC documents the accompanying implementation in https://github.com/kvcache-ai/Mooncake/pull/4420
Summary
TENT's RDMA
DeviceSelectorchooses a local NIC for each transfer slice, but the previous implementation did not expose which NICs were selected during a benchmark. Consequently, a throughput or latency result could not distinguish an even multi-rail distribution from a run that concentrated traffic on one rail.This RFC adds read-only selection observability. It records allocation intent per local NIC and emits a warmup-excluded JSONL measurement window from
tebench. It does not change device eligibility, scoring, rail admission, fallback, scheduling policy, or transfer execution.Motivation
Multi-rail routing work needs a reproducible baseline before changing the allocation policy. The baseline must answer:
These signals are allocation decisions, not proof of completed wire traffic.
They complement, rather than replace, source and target NIC port counters.
Goals
concurrently with allocation.
Non-Goals
Design
Selection Counters
DeviceSelectorrecords a successful, non-empty allocation after it haschosen slice device IDs. The snapshot includes:
The final slice is charged with the request remainder, so per-device selected bytes sum to the requested allocation size, including a folded tail.
No counter is recorded for an empty or failed selection. Historical counters remain visible when a device later becomes unavailable.
Semantics and Concurrency
Counters use relaxed atomics. A snapshot is best-effort: its fields can span concurrent allocations and are not a transactionally consistent point in time. The counters are observational only and never participate in scoring, EWMA learning, in-flight accounting, or eligibility decisions.
Snapshots are safe concurrently with allocation only. They must not race selector topology initialization or replacement, transport teardown, or engine destruction.
Selected bytes describe the allocator's pre-fallback intent. A worker may later
retry or use a different transport/NIC, so selected bytes are not posted,
completed, or physical wire bytes.
TransferEngine::getSelectionStats()replaces its output with the current RDMAsnapshot. An engine without an RDMA transport returns
OKwith zero countersand an empty device list.
Benchmark Measurement Window
tebenchruns the existing one-second warmup before entering a one-shotMeasurementBarrier. The final warmup worker obtains the start snapshot before releasing any worker into the measured workload. The end snapshot is obtained only after the initiator tasks finish.If warmup, the start snapshot, or a measured transfer fails, the barrier enters the failed state and the case emits no selection record. This prevents partial or warmup-contaminated JSONL output.
When
--result_output_jsonlis set for the TENT backend, each successful case appends one additionalrdma_selection_metricsrecord alongside its existing target-metric records:--tent_rail_topo_pathis a benchmark-only convenience option that passes a rail-pair topology file to the TENT RDMA worker configuration. It allows a benchmark to make its eligible-rail policy reproducible without changing the production configuration contract.Compatibility
--result_output_jsonlflag.Validation
The implementation includes tests for:
barrier;
Acceptance for a real multi-rail run requires the JSONL selection delta and source/target NIC port-counter deltas to agree on the intended eligible rails. The JSONL record alone must not be used to claim balanced physical traffic.
Follow-up Work
This RFC intentionally separates observability from routing-policy changes. Any policy proposal must use equal workloads and report throughput, p50/p99 latency, per-rail selected shares, and port-counter deltas for equal-rail, unequal-rail, burst, and rail-exclusion cases. Temporal oscillation requires fixed-window or transition-level instrumentation; it cannot be derived from the cumulative counters introduced here.
Before submitting a new issue...
@github-actions[bot] commented on GitHub (Oct 12, 2026):
Thanks for opening this issue, @RuixiangMa!
27672240A maintainer will triage this when possible. To help us respond faster, please include:
Useful links: Documentation · Contributing guide