fix: remove kv padding from flash attention wrapper#1453
fix: remove kv padding from flash attention wrapper#1453
Conversation
|
I've just tested the changes and this still doesn't fix the issue. The issue is not only happening on short prompts but on any prompt lenght using flash attention on vulkan for Ernie and Anima models. |
|
I’ve tried to fix it, and it’s working properly on my device now. @daniandtheweb Could you pull the latest commit and give it another try? Also, don’t forget to sync the ggml submodule. |
|
Does the simplest txt2img pipeline—like the one below—also cause issues on your side? |
This specific command works as expected. Here's the simplest reproduction of the issue that I've been able to achieve for now: This works: This doesn't work: But removing flash attention makes it work also on 1024x1024: |











Most backends already handle non-256 KV lengths internally or fall back via backend support checks. Avoid generating synthetic padding masks, which can trigger incorrect Vulkan flash attention output for short prompt lengths.
Fix #1431.