fixed acestep bad on vulkan

This commit is contained in:
Concedo 2026-04-08 22:22:07 +08:00
parent 9b02806191
commit 6aa49b91b1

View file

@ -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);