06-qwen2.diff 782 B

12345678910111213
  1. diff --git a/src/llama.cpp b/src/llama.cpp
  2. index 40d2ec2c..f34eb79a 100644
  3. --- a/src/llama.cpp
  4. +++ b/src/llama.cpp
  5. @@ -6943,7 +6943,7 @@ static struct ggml_tensor * llm_build_kqv(
  6. struct ggml_tensor * kq = ggml_mul_mat(ctx, k, q);
  7. cb(kq, "kq", il);
  8. - if (model.arch == LLM_ARCH_PHI2 || model.arch == LLM_ARCH_PHI3 || model.arch == LLM_ARCH_GPTNEOX) {
  9. + if (model.arch == LLM_ARCH_PHI2 || model.arch == LLM_ARCH_PHI3 || model.arch == LLM_ARCH_GPTNEOX || model.arch == LLM_ARCH_QWEN2) {
  10. // for this arch, we need to perform the KQ multiplication with F32 precision, otherwise we get NaNs
  11. // ref: https://github.com/ggerganov/llama.cpp/pull/4490#issuecomment-1859055847
  12. ggml_mul_mat_set_prec(kq, GGML_PREC_F32);