fix: honor flash attention flag in LLM text encoder attention (#1987)

This commit is contained in:
Lin Xuhao 2026-09-18 17:41:24 +02:00 committed by GitHub
parent cc515a01f9
commit 269e726015
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1377,7 +1377,7 @@ namespace LLM {
x = ggml_ext_cont(ctx->ggml_ctx, kqv); x = ggml_ext_cont(ctx->ggml_ctx, kqv);
x = ggml_reshape_3d(ctx->ggml_ctx, x, head_dim * num_heads, n_token, N); x = ggml_reshape_3d(ctx->ggml_ctx, x, head_dim * num_heads, n_token, N);
} else { } else {
x = ggml_ext_attention_ext(ctx, q, k, v, num_heads, attention_mask, true, false); // [N, n_token, hidden_size] x = ggml_ext_attention_ext(ctx, q, k, v, num_heads, attention_mask, true, ctx->flash_attn_enabled); // [N, n_token, hidden_size]
} }
x = out_proj->forward(ctx, x); // [N, n_token, hidden_size] x = out_proj->forward(ctx, x); // [N, n_token, hidden_size]