llama.cpp commit adds indexed attention bias to Vulkan flash attention shaders
Commit f89a243 changes 12 files in the Vulkan backend of llama.cpp. It adds support for an indexed bias to the flash attention[1] shaders[2]. A bias index, stored for each key position, selects a value from a bias table, and that value is added to the mask[3].
Before this change, the shaders skipped mask blocks that were all zeros. Now those blocks are not skipped when a bias is used, and the mask, index and table values are loaded in advance. The commit also adds a bias_bins field to the pipeline state for flash attention and a coopmat2_reserved_shmem field to the device structure.
The post's author says the commit fixes prompt processing degradation for the Inkling 2 mini model and shares a comparison of Vulkan and ROCm. The commit itself does not mention that model or include benchmark numbers.
Repository llama.cpp github.com
Open source C/C++ library for running LLM inference locally on CPUs and GPUs, without a cloud service.
Read the original github.comDiscussion
Discussion
Commenters thank the author and say that a ubatch size between 769 and 1024 worked best for them with q8 for both KV and Q. Some ask whether "Tiefe" means the context size and whether generation speed improved, since the table only shows prompt processing numbers. One commenter asks how Vulkan can be faster than ROCm natively and says ROCm support should be revisited or dropped.
Sources
-
GitHub
Inkling 2 mini pp degradation just got fixed in llama.cpp (Vulkan)! Vulkan vs ROCm comparison


