Skip to content

Commit eb0bcd8

Browse files
Isotr0pyAlex4210987
authored andcommitted
[Bugfix][kernels] Fix half2float conversion in gguf kernels (vllm-project#15995)
Signed-off-by: Isotr0py <[email protected]> Signed-off-by: xinyuxiao <[email protected]>
1 parent 2ab6ea7 commit eb0bcd8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

csrc/quantization/gguf/ggml-common.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,6 +1090,11 @@ __device__ __forceinline__ c10::BFloat16 convert_from_half<c10::BFloat16>(half v
10901090
#endif // defined(__CUDA_ARCH__) && __CUDA_ARCH__ >= 800
10911091
}
10921092

1093+
template<>
1094+
__device__ __forceinline__ float convert_from_half<float>(half val) {
1095+
return __half2float(val);
1096+
}
1097+
10931098
#if defined(USE_ROCM)
10941099

10951100
#ifndef __has_builtin

0 commit comments

Comments
 (0)