Skip to content

refactor: introduce RDMA providers for IB resources - #977

Open
Michael Beebe (michael-beebe) wants to merge 6 commits into
mainfrom
michaelbeebe/rdma-base-class
Open

Michael Beebe (michael-beebe) wants to merge 6 commits into
mainfrom
michaelbeebe/rdma-base-class

Conversation

@michael-beebe

@michael-beebe Michael Beebe (michael-beebe) commented Nov 24, 2026 •

Copy link
Copy Markdown

Summary

Introduce internal RdmaProvider, RdmaEndpoint, and RdmaMemory interfaces. Move provider-specific resource ownership and dispatch out of generic framework code; local endpoints and memory registrations retain their provider.

Preserve existing IB I/O behavior and wire formats, including the GPUNetIO Device backend on provider-owned resources.

Rename the eight device transports to RDMA0-RDMA7 and their flag set to AllRDMATransports, independent of whether the provider is IB or native MRC. Source migration is required: the old IB0-IB7 enum names are removed without aliases in C++ and Python. Diagnostic output also uses RDMA names. Numeric values, the 11-bit transport flag layout, and existing binary data symbols are preserved.

Native MRC provider integration follows as a separate change.

Design and diagrams

Replaces fork-based #961 using a branch in microsoft/mscclpp. Prior review discussion remains in #961.

Keep IB-specific connection code with the provider without changing
behavior. Share existing validation helpers through BaseConnection.

Add the IB-only RDMA foundation design note, covering ownership,
alternatives, compatibility requirements, and review gates.

Copilot-Session: 150aa213-1d90-452d-b431-2b1c2555640b
Route endpoint and MR creation through internal RDMA providers.
Retain providers for local-resource lifetimes while preserving
existing IB Connection I/O, typed views, and serialized metadata.

Add lifetime and metadata compatibility tests and update the
provider design note.

Copilot-Session: 150aa213-1d90-452d-b431-2b1c2555640b
Keep generic registered-memory records free of IB metadata and centralize
RDMA classification and endpoint compatibility in provider dispatch.

Use tag-checked access to provider-owned IB memory without per-write RTTI.
Preserve serialized metadata, record order, resource lifetimes, and the
existing IB I/O path.

Copilot-Session: 150aa213-1d90-452d-b431-2b1c2555640b
Document resource ownership, opaque metadata serialization, and the
Connection data path as stable architecture rather than PR progress.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: 150aa213-1d90-452d-b431-2b1c2555640b
Keep Device-mode QPs in IbEndpoint, route GPUNetIO connections through the provider factory, and use IbMemory for device memory handles. Add Device-mode metadata, rejection, and resource-lifetime coverage.

Copilot-Session: 6b854014-2204-4eda-b560-ad6e4c1ef99e
Copilot AI balanced review requested due to automatic review settings November 24, 2026 18:10
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The PD/QP/MR ownership and teardown refactor spans host IB and GPUNetIO, but hardware-backed lifetime and transfer tests plus CUDA/ROCm and IB-disabled build validation remain unverified and need maintainer confirmation.

No open issues 🎉

What changed in this PR

Introduces internal RDMA provider interfaces to separate IB resource ownership and dispatch from MSCCL++’s generic framework, with IB as the sole implementation. The refactor preserves public APIs and wire formats; native MRC support remains separate.

Changes:

  • Adds provider-owned endpoints and memory registrations that retain their provider for resource lifetime safety.
  • Moves IB connection logic behind the provider interfaces and adapts GPUNetIO resource access.
  • Adds compatibility and lifetime tests, plus design documentation.
File Description
test/​unit/​core_tests.cc Adds serialization, routing, resource-lifetime, and Device backend tests.
src/​core/​registered_memory.cc Delegates RDMA registration and metadata handling to providers.
src/​core/​rdma_provider.cc Implements provider selection, compatibility checks, and metadata import.
src/​core/​include/​registered_memory.hpp Replaces IB-specific fields with owning RDMA memory records.
src/​core/​include/​rdma_provider.hpp Defines internal provider, endpoint, and memory interfaces.
src/​core/​include/​ib.hpp Declares concrete IB provider and resource wrappers.
src/​core/​include/​endpoint.hpp Stores an RDMA endpoint instead of IB-specific resources.
src/​core/​include/​context.hpp Replaces the IB context cache with a provider cache.
src/​core/​include/​connection.hpp Shares validation helpers and removes the IB connection declaration.
src/​core/​ib.cc Implements IB wrappers and houses host IB connection logic.
src/​core/​gpunetio.cc Uses provider-owned endpoint and memory resources.
src/​core/​endpoint.cc Delegates RDMA endpoint creation and serialization.
src/​core/​context.cc Routes resource creation and connections through providers.
src/​core/​connection.cc Removes relocated IB logic and validation helpers.
src/​core/​CMakeLists.txt Adds a private IB-support definition for provider selection.
docs/​index.rst Links the RDMA provider design notes.
docs/​design/​rdma-provider.md Documents ownership, metadata handling, and connection dispatch.

Review effort: Balanced

Replace IB0-IB7 with RDMA0-RDMA7 without source aliases, and update C++/Python callers, diagnostics, examples, and documentation. Keep transport values and wire layout unchanged and retain the legacy flag data symbol for binary compatibility. Leave native MRC backend integration to its follow-up.

Copilot-Session: 6b854014-2204-4eda-b560-ad6e4c1ef99e

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The cross-backend PD/QP/MR ownership refactor requires hardware-backed CUDA/HIP validation and IB-enabled/disabled build coverage to establish teardown and communication correctness beyond static inspection.

No open issues 🎉

Review effort: Balanced

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants