From: Georgi Gerganov Date: Mon, 13 Oct 2025 08:22:27 +0000 (+0300) Subject: ggml : fix scalar path for computing norm (#16558) X-Git-Tag: upstream/0.0.6764~17 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=c515fc577166042234241c6bd0da9b08dcbe2bb9;p=pkg%2Fggml%2Fsources%2Fllama.cpp ggml : fix scalar path for computing norm (#16558) --- diff --git a/ggml/src/ggml-cpu/vec.cpp b/ggml/src/ggml-cpu/vec.cpp index b8e37052..43dc7537 100644 --- a/ggml/src/ggml-cpu/vec.cpp +++ b/ggml/src/ggml-cpu/vec.cpp @@ -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; }