mirror of
https://github.com/deepseek-ai/DeepEP
synced 2025-06-26 18:28:11 +00:00
Move __syncthread and fence into barrier.
This commit is contained in:
@@ -438,11 +438,14 @@ __forceinline__ __device__ out_dtype_t extract_required_scale_format(float value
|
||||
}
|
||||
}
|
||||
|
||||
template <int kNumRanks>
|
||||
template <int kNumRanks, bool fence=true>
|
||||
__forceinline__ __device__ void
|
||||
barrier_block(int** barrier_signal_ptrs, int rank) {
|
||||
auto thread_id = static_cast<int>(threadIdx.x);
|
||||
|
||||
if (fence)
|
||||
memory_fence();
|
||||
|
||||
// Add self-ranks, sub other ranks
|
||||
if (thread_id < kNumRanks) {
|
||||
atomicAdd_system(barrier_signal_ptrs[rank] + thread_id, FINISHED_SUM_TAG);
|
||||
|
||||
Reference in New Issue
Block a user