mirror of
https://github.com/microsoft/mscclpp.git
synced 2026-05-03 21:21:25 +00:00
New semaphore constructors (#559)
More intuitive interfaces for creating semaphores and channels. Also allows channel construction using third-party bootstrappers directly without overriding MSCCL++ Bootstrap.
This commit is contained in:
@@ -39,16 +39,17 @@ void setupMeshTopology(int rank, int worldsize, void* data, size_t dataSize) {
|
||||
if (r == rank) continue;
|
||||
mscclpp::Transport transport = mscclpp::Transport::CudaIpc;
|
||||
// Connect with all other ranks
|
||||
connections[r] = comm.connect(r, 0, transport);
|
||||
connections[r] = comm.connect(transport, r);
|
||||
auto memory = comm.registerMemory(data, dataSize, mscclpp::Transport::CudaIpc | ibTransport);
|
||||
localMemories.push_back(memory);
|
||||
comm.sendMemory(memory, r, 0);
|
||||
remoteMemories.push_back(comm.recvMemory(r, 0));
|
||||
comm.sendMemory(memory, r);
|
||||
remoteMemories.push_back(comm.recvMemory(r));
|
||||
}
|
||||
|
||||
for (int r = 0; r < world_size; ++r) {
|
||||
if (r == rank) continue;
|
||||
semaphoreIds.push_back(proxyService.buildAndAddSemaphore(comm, connections[r].get()));
|
||||
auto sema = communicator->buildSemaphore(connections[r].get(), r).get();
|
||||
semaphoreIds.push_back(proxyService->addSemaphore(sema));
|
||||
}
|
||||
|
||||
std::vector<DeviceHandle<mscclpp::PortChannel>> portChannels;
|
||||
|
||||
Reference in New Issue
Block a user