diff options
author | Kawrakow <iwankawrakow@gmail.com> | 2025-03-05 07:27:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-05 07:27:49 +0200 |
commit | 7bdbf99bbdbfe46b01f7783a7c98a30a1558e2c3 (patch) | |
tree | ecd49fd2b7bccc1b3d70819241d0eaf9c4dddede /ggml/src/ggml-cuda.cu | |
parent | a87e54db6ec2409284a55f029d4abe9e50990064 (diff) |
DeepSeek CUDA Flash Attention (#241)
* WIP CUDA FA with Dk != Dv
* WIP
* CUDA FA WIP - It actually works!
No TG yet, but for PP I can run FA with fp16 cache and it gets
the same answer.
* CUDA FA WIP - it now works for Q8_0 + Q8_0 for KV cache
* CUDA FA WIP - TG, not working yet.
* CUDA FA with Dk != Dv: it works now for DeepSeek
---------
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 | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ggml/src/ggml-cuda.cu b/ggml/src/ggml-cuda.cu index 85df0694..410c6406 100644 --- a/ggml/src/ggml-cuda.cu +++ b/ggml/src/ggml-cuda.cu @@ -3275,6 +3275,10 @@ GGML_CALL static bool ggml_backend_cuda_supports_op(ggml_backend_t backend, cons if (op->src[0]->ne[0] == 128) { return true; } + if (op->src[1]->ne[0] == 192 && op->src[2]->ne[0] == 128) { + return (op->src[1]->type == GGML_TYPE_F16 && op->src[2]->type == GGML_TYPE_F16) || + (op->src[1]->type == GGML_TYPE_Q8_0 && op->src[2]->type == GGML_TYPE_Q8_0); + } if (op->src[0]->ne[0] == 64 && op->src[1]->type == GGML_TYPE_F16) { return true; } |