You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR adds a MemFabric Transport backend to the TENT framework, loading the memfabric shared library (libmf_smem.so) via dlopen/dlsym at runtime.
Key design decisions:
Dynamic loading: No compile-time dependency on memfabric headers. A self-contained C ABI header (memfabric_types.h) re-declares all vendor types, following the same pattern as the TPU PJRT shim.
Protocol via environment variable: MF_PROTOCOL env var selects the transport protocol (device_rdma / device_urma/ device_sdma / ...), consistent with how ascend_direct uses env vars (not TENT JSON config).
Build verification was done on a two-node Ascend NPU cluster (CANN
9.0.1, aarch64) with memfabric_hybrid providing libmf_smem.so. Mooncake was built with USE_TENT=ON and USE_MEMFABRIC=ON. The memfabric transport was enabled in the TENT
config (transports/memfabric/enable: true), with MF_PROTOCOL=device_xdma for inter-node RDMA transfer.
End-to-end inference validation was performed with SGLang in PD
disaggregation mode across the two nodes. The prefill node ran the
SGLang prefill worker with a Mooncake Store segment
(protocol=ascend, 200 GB hugepage-backed); the decode node ran the
decode worker and pulled KV cache from the prefill node's Store via
the memfabric transport. Multiple round-trip prefill→decode
sequences completed with correct generation output and no transfer
errors.
Unit tests also pass with mock ACL and mock UnderApi,
covering library loading, endpoint publish/resolve, memory
registration, batch submission, status polling, and uninstall
cleanup. These use no real memfabric hardware.
Test results:
Build succeeds with USE_MEMFABRIC=ON on Ascend NPU / CANN 9.0.1.
PD disaggregation with SGLang (L3 on A5) passes across
two nodes with correct generation output.
Unit tests pass (mock-backed, no hardware required).
Changed-file pre-commit passed.
Checklist
I have performed a self-review of my own code
I have formatted my code using ./scripts/code_format.sh
I have run pre-commit on the files changed in this PR and all hooks pass
I have updated the documentation
I have added tests to prove my changes are effective
For changes >500 LOC: I have filed an RFC issue
AI Assistance Disclosure
AI tools were used (Claude for code generation, refactoring, and documentation drafting; all changes reviewed and defended end-to-end by the human submitter)
On the CI changes: the new memfabric-mock leg doesn't test the code that would actually ship, and it adds a lot of special-casing to tent-ci.
What it covers
The leg sets -DUSE_MEMFABRIC=OFF, so tent_xport_memfabric is never configured. tests/memfabric/CMakeLists.txt instead compiles ../../src/transport/memfabric/*.cpp straight into the test executables. As a result, none of the USE_MEMFABRIC=ON paths are compiled anywhere in CI:
the production target and its link line (dl ascendcl)
the USE_MEMFABRIC branches in common.cmake
the #ifdef USE_MEMFABRIC code in transport_loader.cpp, transfer_engine_impl.cpp, pybind.cpp, real_client.cpp and client_buffer_allocation.cpp
The existing ub-mock leg does the opposite. It turns on -DUSE_UB=ON, builds the real target with a mock adapter injected inside it, and runs the full build and full ctest with no workflow special cases.
Workflow cost
A whole runner leg (dependencies, sccache, full configure) is used to build two targets.
matrix.name != 'memfabric-mock' appears in six steps.
The per-test ctest -R ... --no-tests=error loop exists only because these tests are registered through a separate CMake path.
tent_memfabric_transport_test is defined twice, with different link setups depending on the mode.
Root cause
The transport loads libmf_smem with dlopen, but it still depends on CANN at compile time:
memfabric_transport.cpp includes <acl/acl.h>, and memfabric_allocator.cpp includes <acl/acl_rt.h>.
The target links ascendcl.
USE_MEMFABRIC switches platform.cpp to AscendPlatform and enables platform_ascend.
So USE_MEMFABRIC=ON can't be built on a GitHub runner, and the test setup works around that.
Suggestions
Minimal: build the mock tests under BUILD_UNIT_TESTS whenever USE_MEMFABRIC is off, so the existing cuda-off leg builds them and runs them in its normal ctest -j. Drop the new leg and the ci.yml changes.
Preferred: remove the compile-time ACL dependency from the transport, either by going through the platform layer or by resolving the ACL symbols at runtime the same way libmf_smem is loaded. Then -DUSE_MEMFABRIC=ON builds without CANN, and CI can cover it the way ub-mock covers UB: a leg that builds the real target and runs the full test suite.
Two smaller points:
tent_ascend_platform_mock_test tests ascend_probe.cpp and ascend_allocator.cpp, which belong to the Ascend platform rather than MemFabric. It would fit better in a separate PR.
The cmake-format reflows of unrelated comments in tests/CMakeLists.txt and src/CMakeLists.txt should be left out of this PR.
henian-Ni
changed the title
[RFC][TENT] Add MemFabric Transport
[TENT] Add MemFabric Transport
Oct 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds a MemFabric Transport backend to the TENT framework, loading the memfabric shared library (
libmf_smem.so) viadlopen/dlsymat runtime.Key design decisions:
memfabric_types.h) re-declares all vendor types, following the same pattern as the TPU PJRT shim.MF_PROTOCOLenv var selects the transport protocol (device_rdma/device_urma/device_sdma/ ...), consistent with how ascend_direct uses env vars (not TENT JSON config).Architecture
Files changed
memfabric_transport.h/cpp,memfabric_under_api.h/cpp,memfabric_types.hmemfabric_allocator.h/cppcommon.cmake,tent/src/transport/memfabric/CMakeLists.txt,src/CMakeLists.txtreal_client.cpp,client_buffer_allocation.cpp(include + call site)memfabric_transport_test.cpp(mock ACL + mock UnderApi)docs/source/design/transfer-engine/memfabric_transport.md(EN),docs/source/zh_archive/memfabric_transport.md(ZH)tent/config/transfer-engine.jsonModule
mooncake-transfer-engine)mooncake-store)mooncake-conductor)mooncake-reshard)mooncake-ep)mooncake-pg)mooncake-integration)mooncake-p2p-store)mooncake-wheel)mooncake-common)Type of Change
How Has This Been Tested?
Build verification was done on a two-node Ascend NPU cluster (CANN
9.0.1, aarch64) with
memfabric_hybridprovidinglibmf_smem.so. Mooncake was built withUSE_TENT=ONandUSE_MEMFABRIC=ON. The memfabric transport was enabled in the TENTconfig (
transports/memfabric/enable: true), withMF_PROTOCOL=device_xdmafor inter-node RDMA transfer.End-to-end inference validation was performed with SGLang in PD
disaggregation mode across the two nodes. The prefill node ran the
SGLang prefill worker with a Mooncake Store segment
(
protocol=ascend, 200 GB hugepage-backed); the decode node ran thedecode worker and pulled KV cache from the prefill node's Store via
the memfabric transport. Multiple round-trip prefill→decode
sequences completed with correct generation output and no transfer
errors.
Unit tests also pass with mock ACL and mock UnderApi,
covering library loading, endpoint publish/resolve, memory
registration, batch submission, status polling, and uninstall
cleanup. These use no real memfabric hardware.
Test results:
USE_MEMFABRIC=ONon Ascend NPU / CANN 9.0.1.two nodes with correct generation output.
Checklist
./scripts/code_format.shAI Assistance Disclosure