Use smart pointer for IB structure (#585)

Change to use smart pointer for IB structure. Registered memory will own
ibMr, ibCtx will not held the reference
- Use smart pointer for IbQp and IbMr
- Update memoryChannel API, keep localRegisteredMemory
- Close fd when registedMemory released

---------

Co-authored-by: Changho Hwang <changhohwang@microsoft.com>
This commit is contained in:
Binyang Li
2025-08-06 10:01:58 -07:00
committed by GitHub
parent d55ac96f5e
commit 4f6f23dae3
23 changed files with 175 additions and 118 deletions

View File

@@ -499,7 +499,8 @@ def test_memory_channels(mpi_group: MpiGroup, nelem: int, use_packet: bool):
memory_expected[(nelemPerRank * rank) : (nelemPerRank * (rank + 1))] = rank + 1
if use_packet:
channels = group.make_memory_channels_with_scratch(memory, scratch, connections)
registered_scratch_memory = group.register_local_memory(scratch, connections)
channels = group.make_memory_channels_with_scratch(memory, registered_scratch_memory, connections)
else:
channels = group.make_memory_channels(memory, connections)
kernel = MscclppKernel("memory_channel", group.my_rank, group.nranks, channels, memory, use_packet, scratch)