Skip to content

Commit 7cb91ce

Browse files
committed
Hip: Supress transformation warning in softmax.cu, loops with bounds not known at compiletime indeed can not be unrolled.
1 parent cae9fb4 commit 7cb91ce

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ggml/src/ggml-cuda/softmax.cu

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ __device__ float __forceinline__ t2f32<half>(half val) {
1313
return __half2float(val);
1414
}
1515

16+
// When ncols_template == 0 the bounds for the loops in this function are not known and can't be unrolled.
17+
// As we want to keep pragma unroll for all other cases we supress the clang transformation warning here.
18+
#pragma clang diagnostic push
19+
#pragma clang diagnostic ignored "-Wpass-failed"
1620
template <bool use_shared, int ncols_template, int block_size_template, typename T>
1721
static __global__ void soft_max_f32(
1822
const float * x, const T * mask, float * dst, const int ncols_par, const int nrows_y,
@@ -118,6 +122,7 @@ static __global__ void soft_max_f32(
118122
dst[col] = vals[col] * inv_sum;
119123
}
120124
}
125+
#pragma clang diagnostic pop
121126

122127
static __global__ void soft_max_back_f32(
123128
const float * grad, const float * dstf, float * dst, const int ncols, const float scale) {

0 commit comments

Comments
 (0)