diff options
Diffstat (limited to 'ggml-cuda/common.cuh')
-rw-r--r-- | ggml-cuda/common.cuh | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ggml-cuda/common.cuh b/ggml-cuda/common.cuh index 892fd5a6..1c2d7215 100644 --- a/ggml-cuda/common.cuh +++ b/ggml-cuda/common.cuh @@ -501,6 +501,12 @@ static __device__ __forceinline__ float get_alibi_slope( return powf(base, exph); } +static __device__ __forceinline__ float iq1bn_fp8_to_float(uint8_t fp8) { + typedef union { float f; uint32_t i; } scale_t; + scale_t s; s.i = (((fp8 >> 5) + 116) << 23) | ((fp8 & 0x1f) << 18); + return s.f; +} + template <ggml_type type> struct ggml_cuda_type_traits; |