mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2026-05-17 04:09:19 +00:00
fixed acestep bad on vulkan
This commit is contained in:
parent
9b02806191
commit
6aa49b91b1
1 changed files with 8 additions and 0 deletions
|
|
@ -633,6 +633,10 @@ static struct ggml_tensor * dit_ggml_build_self_attn(
|
|||
? ggml_flash_attn_ext(ctx, q, k, v, mask, scale, 0.0f, 0.0f)
|
||||
: dit_attn_f32(ctx, q, k, v, mask, scale);
|
||||
|
||||
if (m->use_flash_attn) {
|
||||
ggml_flash_attn_ext_set_prec(attn, GGML_PREC_F32);
|
||||
}
|
||||
|
||||
// Both return [D, Nh, S, N]
|
||||
// Reshape: [D, Nh, S, N] -> [D*Nh, S, N] = [H, S, N]
|
||||
attn = ggml_reshape_3d(ctx, attn, Nh * D, S, N);
|
||||
|
|
@ -742,6 +746,10 @@ static struct ggml_tensor * dit_ggml_build_cross_attn(
|
|||
? ggml_flash_attn_ext(ctx, q, k, v, NULL, scale, 0.0f, 0.0f)
|
||||
: dit_attn_f32(ctx, q, k, v, NULL, scale);
|
||||
|
||||
if (m->use_flash_attn) {
|
||||
ggml_flash_attn_ext_set_prec(attn, GGML_PREC_F32);
|
||||
}
|
||||
|
||||
// Attention output: [D, Nh, S, N], reshape to [H, S, N]
|
||||
attn = ggml_reshape_3d(ctx, attn, Nh * D, S, N);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue