vulkan: disable FA mask_opt on GCN to improve performance (llama/24362)

* vulkan: disable FA mask_opt on GCN to improve performance

* reenable mask opt over attention head size 256
This commit is contained in:
Ruben Ortlam 2026-07-08 19:01:25 +02:00 committed by Georgi Gerganov
parent 5f052fbfaf
commit b47f39dba2
1 changed files with 2 additions and 1 deletions

View File

@ -10310,7 +10310,8 @@ static void ggml_vk_flash_attn(ggml_backend_vk_context * ctx, vk_context& subctx
}
// Only use mask opt when the mask is fairly large. This hasn't been tuned extensively.
bool use_mask_opt = mask && nem1 >= 32 && nem0 * nem1 > 32768 && nem0 >= tuning_params.block_cols * 16;
bool use_mask_opt = mask && nem1 >= 32 && nem0 * nem1 > 32768 && nem0 >= tuning_params.block_cols * 16
&& (ctx->device->architecture != vk_device_architecture::AMD_GCN || HSK > 256 || HSV > 256);
vk_fa_pipeline_state fa_pipeline_state = get_fa_pipeline_state(ctx->device, tuning_params, HSK, HSV, aligned, f32acc,
mask != nullptr, use_mask_opt, logit_softcap != 0, k->type, v->type);