]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commitdiff
ggml : fix scalar path for computing norm (llama/16558)
authorGeorgi Gerganov <redacted>
Mon, 13 Oct 2025 08:22:27 +0000 (11:22 +0300)
committerGeorgi Gerganov <redacted>
Wed, 15 Oct 2025 06:29:17 +0000 (09:29 +0300)
ggml/src/ggml-cpu/vec.cpp

index b8e37052d35e15c2f0f28acf8389e7e6337314e4..43dc7537c3307cfb0537b73d32d2c8df7c1d9e8f 100644 (file)
@@ -463,9 +463,9 @@ ggml_float ggml_vec_cvar_f32(const int n, float * y, const float * x, const floa
 #endif
     for (; i < n; ++i) {
         float val = x[i] - mean;
+        y[i] = val;
         val *= val;
         sum += (ggml_float)val;
-        y[i] = val;
     }
     return sum/n;
 }