microsoft / mscclpp

MSCCL++: A GPU-driven communication stack for scalable AI applications
MIT License
246 stars 38 forks source link

[Feature] `deviceHandle()` interface is counter-intuitive #289

Open chhwang opened 6 months ago

chhwang commented 6 months ago

Host2DeviceSemaphore::deviceHandle() and SmDevice2DeviceSemaphore::deviceHandle() interfaces look like for retrieving properties of the class object, suggesting usage such as:

SmDevice2DeviceSemaphore sem(communicator, connection);
auto handle = sem.deviceHandle();

But this a case of illegal usage as we need to call communicator.setup() in between the object construction and the call to deviceHandle() method. We may need to either call the setup() internally or make the internal sendMemoryOnSetup() and recvMemoryOnSetup() calls to be more explicit.