kvcache-ai/Mooncake

[TE] Refactor: unify libfabric-based transports (EFA / CXI) shared infrastructure

開放

#2,657 建立於 2026年6月29日

 (3 則留言) (0 個反應) (0 位負責人)C++ (803 個分叉)auto 404
good first issue

倉庫指標

星標
 (5,470 顆星)
PR 合併指標
 (平均合併 5天 16小時) (30 天內合併 269 個 PR)

描述

Background

With #2535 (CXI backend) merged, we now have two transports built on libfabric that share significant structural overlap but are implemented as independent forks. This was the pragmatic choice for initial integration (see discussion in #2535), but leaves maintenance debt.

Scope

  1. Topology — CXI currently reuses InfiniBand device discovery paths in topology.cpp. CXI is not IB; it should have its own topology functions or a shared libfabric_topology abstraction (ref: @alogfans' comment).

  2. Shared base class or utilities — Extract common libfabric patterns (endpoint management, CQ polling, MR registration, error handling) into a shared layer that both EFA and CXI can consume, reducing duplicated code.

  3. mr_key_t consolidation — The current #if defined(USE_EFA) || defined(USE_CXI) guards work but will grow unwieldy if more libfabric providers are added. Consider a compile-time or runtime abstraction.

Non-goals

  • Changing the public API or metadata wire format
  • Merging EFA and CXI into a single transport (they have meaningful behavioral differences in MR handling and transfer semantics)

References

  • #2535 — CXI backend PR
  • #2564 — 64-bit MR key fix

貢獻者指南