Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions ggml/src/ggml-cuda/fattn-mma-f16.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,10 @@ static constexpr __host__ __device__ fattn_mma_config ggml_cuda_fattn_mma_get_co
// RDNA3 WMMA operands are mirrored, so keeping Q in registers for head size 256 spills heavily.
// Stream Q from shared memory and use a smaller KV batch to reduce register pressure. K and V are loaded in one
// batch each: with several batches some compilers move the WMMAs of a batch past the loads of the next one and spill.
// Only for 2-4 Q heads per KV head: with 8 this config is not faster than the default one.
if (ncols2 >= 2 && ncols2 <= 4) {
// Also used for 8 Q heads per KV head (Qwen3.6/Qwen4 full attention, 16 Q / 2 KV heads): the default config spills there
// (flash_attn_ext_f16<256,256,*,8>: 256 VGPR + 1196 B scratch, 529 spilled VGPRs). With this config the spill is gone
// (207 VGPR, no scratch); measured on a D256 GQA8 kernel 11437 -> 8559 us, pp512@d32768 +10.2% on Qwen3.6.
if (ncols2 >= 2 && ncols2 <= 8) {
GGML_CUDA_FATTN_MMA_CONFIG_CASE(256, 256, 64, 256, 2, 32, 128, 128, 64, 1, false);
}

Expand Down
Loading