diff options
author | Kawrakow <iwankawrakow@gmail.com> | 2024-09-29 09:03:52 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-29 09:03:52 +0300 |
commit | fd20638bbcb4b1ba69783312bb78545fa418d3f2 (patch) | |
tree | b9ff7dee2adeb73da4a77a7b55573efa7ccae931 /ggml/src/ggml-cuda.cu | |
parent | 1b789c983ac34679de67174662b25fb1227cebf2 (diff) |
Allow bf16 kv-cache (#69)
On the CPU I get the exact same PPL with and without FA
using bf16 for kv-cache. But on CUDA the bf16 kv-cache
result is about the same as the fp16 kv-cache CPU result,
so I'm missing some conversion somewhere.
Co-authored-by: Iwan Kawrakow <iwan.kawrakow@gmail.com>
Diffstat (limited to 'ggml/src/ggml-cuda.cu')
-rw-r--r-- | ggml/src/ggml-cuda.cu | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ggml/src/ggml-cuda.cu b/ggml/src/ggml-cuda.cu index 3d24cc6f..617dd58f 100644 --- a/ggml/src/ggml-cuda.cu +++ b/ggml/src/ggml-cuda.cu @@ -2862,6 +2862,9 @@ GGML_CALL static bool ggml_backend_cuda_supports_op(ggml_backend_t backend, cons if (src0_type == GGML_TYPE_F32 && src1_type == GGML_TYPE_F16) { return true; } + if (src0_type == GGML_TYPE_F32 && src1_type == GGML_TYPE_BF16) { + return true; + } if (src0_type == GGML_TYPE_F32 && src1_type == GGML_TYPE_Q8_0) { return true; } |