cuda : fix data race in soft max (#5853)
This commit is contained in:
parent
231ae28f07
commit
67be2ce101
1 changed files with 1 additions and 0 deletions
|
@ -6904,6 +6904,7 @@ static __global__ void soft_max_f32(const float * x, const float * mask, const f
|
||||||
// find the sum of exps in the block
|
// find the sum of exps in the block
|
||||||
tmp = warp_reduce_sum(tmp);
|
tmp = warp_reduce_sum(tmp);
|
||||||
if (block_size > WARP_SIZE) {
|
if (block_size > WARP_SIZE) {
|
||||||
|
__syncthreads();
|
||||||
if (warp_id == 0) {
|
if (warp_id == 0) {
|
||||||
buf_iw[lane_id] = 0.0f;
|
buf_iw[lane_id] = 0.0f;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue