Skip to content

Commit 7a221b6

Browse files
authored
llama : use F32 precision in Qwen2 attention and no FA (#8412)
1 parent 278d0e1 commit 7a221b6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/llama.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8134,7 +8134,7 @@ static struct ggml_tensor * llm_build_kqv(
81348134
struct ggml_tensor * kq = ggml_mul_mat(ctx, k, q);
81358135
cb(kq, "kq", il);
81368136

8137-
if (model.arch == LLM_ARCH_PHI2 || model.arch == LLM_ARCH_PHI3 || model.arch == LLM_ARCH_GPTNEOX) {
8137+
if (model.arch == LLM_ARCH_PHI2 || model.arch == LLM_ARCH_PHI3 || model.arch == LLM_ARCH_GPTNEOX || model.arch == LLM_ARCH_QWEN2) {
81388138
// for this arch, we need to perform the KQ multiplication with F32 precision, otherwise we get NaNs
81398139
// ref: https://github.com/ggerganov/llama.cpp/pull/4490#issuecomment-1859055847
81408140
ggml_mul_mat_set_prec(kq, GGML_PREC_F32);

0 commit comments

Comments
 (0)