]> git.djapps.eu Git - pkg/ggml/sources/ggml/commitdiff
ggml : fix bug in alibi (#143)
authoryangyaofei <redacted>
Thu, 11 May 2023 21:47:48 +0000 (05:47 +0800)
committerGitHub <redacted>
Thu, 11 May 2023 21:47:48 +0000 (00:47 +0300)
src/ggml.c

index 0bcb5f617f202e2b56eab1956bdcc290c5ca52de..127d6cf22a78210171b2e5f26ff140c9ae986c00 100644 (file)
@@ -9425,7 +9425,7 @@ static void ggml_compute_forward_alibi_f32(
                     m_k = powf(m1, 2 * (k - n_heads_log2_floor) + 1);
                 }
 
-                pdst[0] = (j+1) * m_k + src[0];
+                pdst[0] = i * m_k + src[0];
             }
         }
     }
@@ -9487,7 +9487,7 @@ static void ggml_compute_forward_alibi_f16(
                 }
 
                 // we return F32
-                pdst[0] = (j+1) * m_k + GGML_FP16_TO_FP32(src[0]);
+                pdst[0] = i * m_k + GGML_FP16_TO_FP32(src[0]);
             }
         }
     }