Skip to content

Commit 839b2f2

Browse files
committed
squash! ggml-cuda : add ar_add() to avoid ambiguous operator+ for half/bfloat16 in CUDA 11.8
1 parent 6f8190c commit 839b2f2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

ggml/src/ggml-cuda/allreduce.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ static __device__ inline T ar_add(T a, T b) {
113113
if constexpr (std::is_same_v<T, half>) {
114114
return __hadd(a, b);
115115
} else if constexpr (std::is_same_v<T, nv_bfloat16>) {
116-
return __hadd(a, b);
116+
return __float2bfloat16(__bfloat162float(a) + __bfloat162float(b));
117117
} else {
118118
return a + b;
119119
}

0 commit comments

Comments
 (0)