Skip to content

Commit 744e6f4

Browse files
always use float as intermediate format
1 parent 6232cee commit 744e6f4

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

ggml/src/ggml-cuda/convert.cu

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -579,13 +579,7 @@ static __global__ void convert_unary(const void * __restrict__ vx, dst_t * __res
579579

580580
const src_t * x = (const src_t *) vx;
581581

582-
if constexpr (std::is_same_v<src_t, nv_bfloat16>) {
583-
y[i] = __bfloat162float(x[i]);
584-
} else if constexpr (std::is_same_v<dst_t, nv_bfloat16> && std::is_same_v<src_t, half>) {
585-
y[i] = (float)x[i];
586-
} else {
587-
y[i] = x[i];
588-
}
582+
y[i] = float(x[i]);
589583
}
590584

591585
template <typename src_t, typename dst_t>

0 commit comments

Comments
 (0)