Skip to content

[Bugfix][TENT] Forward classic RDMA device filters - #4028

Open
TTThanos wants to merge 1 commit into
kvcache-ai:mainfrom
TTThanos:fix/tent-device-filter
Open

[Bugfix][TENT] Forward classic RDMA device filters#4028
TTThanos wants to merge 1 commit into
kvcache-ai:mainfrom
TTThanos:fix/tent-device-filter

Conversation

@TTThanos

@TTThanos TTThanos commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

Description

Refs #3995 (P0-device-filter).

When existing callers run through the classic Transfer Engine compatibility layer with MC_USE_TENT=1, the RDMA device filter passed to the classic API is currently dropped:

Python initialize(device_name)
-> buildDeviceFilter()
-> TransferEngine(auto_discover, filter)
-> TENT compatibility path drops filter
-> TENT discovers and initializes every local HCA
For example, calling:

engine.initialize(..., device_name="mlx5_bond_0")
on a host with four HCAs still causes TENT to discover and initialize all four devices.

This PR forwards the caller-provided filter into TENT's existing RDMA whitelist configuration:

Python initialize(device_name)
-> buildDeviceFilter()
-> classic TransferEngine constructor
-> tent_device_filter_
-> buildTentConfig()
-> topology/rdma_whitelist
-> platform probe filters discovered HCAs
-> only the requested RDMA contexts are initialized

Module

  • Transfer Engine (mooncake-transfer-engine)
  • Mooncake Store (mooncake-store)
  • Reshard (mooncake-reshard)
  • Mooncake EP (mooncake-ep)
  • Mooncake PG (mooncake-pg)
  • Integration (mooncake-integration)
  • P2P Store (mooncake-p2p-store)
  • Python Wheel (mooncake-wheel)
  • Common (mooncake-common)
  • Mooncake RL (mooncake-rl)
  • CI/CD
  • Docs
  • Other

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Breaking change
  • Documentation update
  • Performance improvement
  • Other

How Has This Been Tested?

Tested in an Ubuntu 24.04 container on an mlx5/CX8 host with four RDMA HCAs.

Test commands:
The regression test constructs the compatibility engine with only the first device:

TransferEngine engine(/auto_discover=/true, {"mlx5_bond_0"});
and asserts:

engine.getLocalTopology()->getHcaList()
== std::vectorstd::string{"mlx5_bond_0"};
Command:

./build/mooncake-transfer-engine/tests/transport_uint_test
--gtest_filter='TransferEngineTentCompatibilityTest.ConstructorDeviceFilterRestrictsDiscoveredTopology'
Result: passed. The runtime log shows only mlx5_bond_0 reaching RDMA context/GID initialization even though all four HCAs were detected by the platform probe.

Test results:

  • Unit tests pass
  • Integration tests pass (if applicable)
  • Manual testing done (describe below)

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 (if applicable)
  • I have added tests to prove my changes are effective
  • For changes >500 LOC: I have filed an RFC issue

AI Assistance Disclosure

  • No AI tools were used
  • AI tools were used (specify below)

Preserve the device whitelist passed through the classic TransferEngine API
when MC_USE_TENT is enabled, and inject it into TENT's
`topology/rdma_whitelist` before topology discovery.

Keep explicit caller filters ahead of MC_TENT_CONF and MC_TE_FILTERS defaults,
retain filters across move operations and the pre-init setter, and leave empty
filters to the existing environment configuration.

Add compatibility, configuration-precedence, move-semantics, and real multi-HCA
regression coverage.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant