Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Saeed Maleki committed Oct 26, 2023
1 parent 1e36418 commit f3f6ced
Show file tree
Hide file tree
Showing 5 changed files with 391 additions and 72 deletions.
13 changes: 13 additions & 0 deletions include/mscclpp/semaphore_device.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,19 @@ struct SmDevice2DeviceSemaphoreDeviceHandle {
cuda::memory_order_seq_cst);
}

/// Signal the remote device.
///
/// This function is a relaxed version of signal() and provides no guarantee on the completion of memory operations.
/// User requires to call proper fencing before using this function.
///
__forceinline__ __device__ void relaxedSignal() {
// This fence ensures that preceding writes are visible on the peer GPU before the incremented
// `outboundSemaphoreId` is visible.
semaphoreIncrement();
cuda::atomic_ref<uint64_t, cuda::thread_scope_system>{*remoteInboundSemaphoreId}.store(semaphoreGetLocal(),
cuda::memory_order_relaxed);
}

/// Signal the remote device for copied packets.
///
/// Unlike @ref signal(), this function provides no guarantee on the completion of memory operations. This is
Expand Down
8 changes: 8 additions & 0 deletions include/mscclpp/sm_channel_device.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,14 @@ struct SmChannelDeviceHandle {
///
__forceinline__ __device__ void signal() { semaphore_.signal(); }

/// Signal the remote semaphore.
///
/// This function is a relaxed version of signal() and provides no guarantee on the completion of memory operations.
/// User requires to call proper fencing before using this function.
///
__forceinline__ __device__ void relaxedSignal() { semaphore_.relaxedSignal(); }


/// Signal the remote semaphore for copied packets.
///
/// Unlike @ref signal(), this function provides no guarantee on the completion of memory operations. This is
Expand Down
Loading

0 comments on commit f3f6ced

Please sign in to comment.