llama : make all KQ masks f16 if FA is used, remove zero attention bias, remove raw_k repeats in DeepSeek V4 - #25370
Conversation
…A is used and remove zero attention bias in DeepSeek V4
|
Would be nice if someone prepared f16 GGML_SET_ROWS for Metal, otherwise there will be performance regression on Macs after this PR. Unfortunately I have no access to the hardware and no experience with Metal at all. |
Taking a look |
|
@fairydreaming Feel free to cherry-pick this commit wherever it makes sense: d4a193e |
@ggerganov Thanks, backend ops tests for this are in #25344 (hopefully Vulkan tests will pass now and it will be ready to merge), so when #25344 is merged I'm going to create PR from your branch. Not adding it here, that would be against contributing guidelines. 😱 |
…ream in DeepSeek V4 - no longer needed as raw_k is always non-unified.
|
@fairydreaming It took me a while to find but this commit broke DeepSeek V4 flash on Vulkan for me on AMD. Unfortunately, it's still broken in the current master. There isn't much of a log even with -lv 7. It just core dumps when I send the first message in the UI. I'm using this quant by alterez: |
|
Maybe this? |
…as, remove raw_k repeats in DeepSeek V4 (ggml-org#25370) * llama : make all KQ masks (except the lightning indexer one) f16 if FA is used and remove zero attention bias in DeepSeek V4 * llama : remove dead code that repeats unified raw_k cache for each stream in DeepSeek V4 - no longer needed as raw_k is always non-unified. --------- Co-authored-by: Stanisław Szymczyk <sszymczy@gmail.com>
…as, remove raw_k repeats in DeepSeek V4 (ggml-org#25370) * llama : make all KQ masks (except the lightning indexer one) f16 if FA is used and remove zero attention bias in DeepSeek V4 * llama : remove dead code that repeats unified raw_k cache for each stream in DeepSeek V4 - no longer needed as raw_k is always non-unified. --------- Co-authored-by: Stanisław Szymczyk <sszymczy@gmail.com>
…as, remove raw_k repeats in DeepSeek V4 (ggml-org#25370) * llama : make all KQ masks (except the lightning indexer one) f16 if FA is used and remove zero attention bias in DeepSeek V4 * llama : remove dead code that repeats unified raw_k cache for each stream in DeepSeek V4 - no longer needed as raw_k is always non-unified. --------- Co-authored-by: Stanisław Szymczyk <sszymczy@gmail.com>
Overview
This PR removes the following skeletons from DeepSeek V4 closet:
dsv4_repeat_streams()that repeatsraw_kcache for each stream, as both raw_k and compressed caches are always non-unified it's no longer needed,kq_bbias tensors that were causing OOM errors like this:Needs #25351, #25344, #25367, #25434
Additional information
I still don't understand why constructs like:
were needed at all and why the bias tensors were only created if not
so that means they were created if:
My head hurts when I think about what was the purpose. @am17an let me know if that breaks anything.
Tested the code with all combinations of FA and kv_unified, seems to work just fine. Performance is slightly improved.
Requirements