Update Barrier and Sync APIs (#73)

* Add thread, wavefront, and workgroup-level `barrier` APIs in IPC and RO conduits; remove collectives on default context
 - Implemented `barrier` APIs for thread, wavefront, and workgroup scopes
 - Added support into both IPC and RO conduits
 - Added functional tests to cover all `barrier` APIs
 - Removed collective operations on default context

* Add thread, wavefront, and workgroup-level `sync` APIs in IPC and RO conduits.
  - Implemented `sync` APIs for thread, wavefront, and workgroup scopes
  - Added support into both IPC and RO conduits
  - Added functional tests to cover all `sync` APIs

* update naming convention for context-based `barrier` APIs
This commit is contained in:
Avinash Kethineedi
2025-04-08 11:25:31 -05:00
committed by GitHub
parent c652f58cef
commit dc61bca066
16 changed files with 347 additions and 67 deletions
+68 -14
View File
@@ -503,8 +503,6 @@ __device__ int rocshmem_team_translate_pe(rocshmem_team_t src_team,
__device__ ATTR_NO_INLINE void rocshmem_ctx_barrier_all(
rocshmem_ctx_t ctx);
__device__ ATTR_NO_INLINE void rocshmem_barrier_all();
/**
* @brief perform a collective barrier between all PEs in the system.
* The caller is blocked until the barrier is resolved.
@@ -518,8 +516,6 @@ __device__ ATTR_NO_INLINE void rocshmem_barrier_all();
__device__ ATTR_NO_INLINE void rocshmem_ctx_wave_barrier_all(
rocshmem_ctx_t ctx);
__device__ ATTR_NO_INLINE void rocshmem_wave_barrier_all();
/**
* @brief perform a collective barrier between all PEs in the system.
* The caller is blocked until the barrier is resolved.
@@ -533,17 +529,47 @@ __device__ ATTR_NO_INLINE void rocshmem_wave_barrier_all();
__device__ ATTR_NO_INLINE void rocshmem_ctx_wg_barrier_all(
rocshmem_ctx_t ctx);
__device__ ATTR_NO_INLINE void rocshmem_wg_barrier_all();
/**
* @brief perform a collective barrier between all PEs in the team.
* The caller is blocked until the barrier is resolved.
*
* This function must be invoked by a single thread within the PE.
*
* @param[in] handle GPU side handle.
*
* @param[in] team The team on which to perform barrier synchronization
*
* @return void
*/
__device__ void rocshmem_ctx_barrier(rocshmem_ctx_t ctx, rocshmem_team_t team);
/**
* @brief perform a collective barrier between all PEs in the team.
* The caller is blocked until the barrier is resolved.
*
* @param[in] team The team on which to perform barrier synchronization
* This function must be called as a wave-front collective.
*
* @param[in] handle GPU side handle.
*
* @param[in] team The team on which to perform barrier synchronization
*
* @return void
*/
__device__ void rocshmem_barrier(rocshmem_team_t);
__device__ void rocshmem_ctx_wave_barrier(rocshmem_ctx_t ctx, rocshmem_team_t team);
/**
* @brief perform a collective barrier between all PEs in the team.
* The caller is blocked until the barrier is resolved.
*
* This function must be called as a work-group collective.
*
* @param[in] handle GPU side handle.
*
* @param[in] team The team on which to perform barrier synchronization
*
* @return void
*/
__device__ void rocshmem_ctx_wg_barrier(rocshmem_ctx_t ctx, rocshmem_team_t team);
/**
* @brief registers the arrival of a PE at a barrier.
@@ -561,8 +587,6 @@ __device__ void rocshmem_barrier(rocshmem_team_t);
*/
__device__ ATTR_NO_INLINE void rocshmem_ctx_sync_all(rocshmem_ctx_t ctx);
__device__ ATTR_NO_INLINE void rocshmem_sync_all();
/**
* @brief registers the arrival of a PE at a barrier.
* The caller is blocked until the synchronization is resolved.
@@ -579,8 +603,6 @@ __device__ ATTR_NO_INLINE void rocshmem_sync_all();
*/
__device__ ATTR_NO_INLINE void rocshmem_ctx_wave_sync_all(rocshmem_ctx_t ctx);
__device__ ATTR_NO_INLINE void rocshmem_wave_sync_all();
/**
* @brief registers the arrival of a PE at a barrier.
* The caller is blocked until the synchronization is resolved.
@@ -597,7 +619,41 @@ __device__ ATTR_NO_INLINE void rocshmem_wave_sync_all();
*/
__device__ ATTR_NO_INLINE void rocshmem_ctx_wg_sync_all(rocshmem_ctx_t ctx);
__device__ ATTR_NO_INLINE void rocshmem_wg_sync_all();
/**
* @brief registers the arrival of a PE at a barrier.
* The caller is blocked until the synchronization is resolved.
*
* In contrast with the shmem_barrier_all routine, shmem_team_sync only ensures
* completion and visibility of previously issued memory stores and does not
* ensure completion of remote memory updates issued via OpenSHMEM routines.
*
* This function must be invoked by a single thread within the PE.
*
* @param[in] handle GPU side handle.
* @param[in] team Handle of the team being synchronized
*
* @return void
*/
__device__ ATTR_NO_INLINE void rocshmem_ctx_team_sync(
rocshmem_ctx_t ctx, rocshmem_team_t team);
/**
* @brief registers the arrival of a PE at a barrier.
* The caller is blocked until the synchronization is resolved.
*
* In contrast with the shmem_barrier_all routine, shmem_team_sync only ensures
* completion and visibility of previously issued memory stores and does not
* ensure completion of remote memory updates issued via OpenSHMEM routines.
*
* This function must be called as a wave-front collective.
*
* @param[in] handle GPU side handle.
* @param[in] team Handle of the team being synchronized
*
* @return void
*/
__device__ ATTR_NO_INLINE void rocshmem_ctx_wave_team_sync(
rocshmem_ctx_t ctx, rocshmem_team_t team);
/**
* @brief registers the arrival of a PE at a barrier.
@@ -617,8 +673,6 @@ __device__ ATTR_NO_INLINE void rocshmem_wg_sync_all();
__device__ ATTR_NO_INLINE void rocshmem_ctx_wg_team_sync(
rocshmem_ctx_t ctx, rocshmem_team_t team);
__device__ ATTR_NO_INLINE void rocshmem_wg_team_sync(rocshmem_team_t team);
/**
* @brief Query a local pointer to a symmetric data object on the
* specified \pe . Returns an address that may be used to directly reference