From ed92c3d4b20df7fc95d4cecb2208aa7302c61a89 Mon Sep 17 00:00:00 2001 From: Georgi Gerganov Date: Thu, 7 Sep 2023 14:59:48 +0300 Subject: [PATCH] metal : put warning in kernel_norm to not combine the loops --- ggml-metal.metal | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ggml-metal.metal b/ggml-metal.metal index a107e7d97..b8e67b2c5 100644 --- a/ggml-metal.metal +++ b/ggml-metal.metal @@ -235,6 +235,12 @@ kernel void kernel_norm( // VARIANCE // parallel sum + // + // WARNING: combining this loop with the one above will give you wrong results for nth == 256 + // I have no idea why, so for now I am keeping them separate. But this behavior is very concerning. + // Tested with: + // ./perplexity -m ./falcon-7b/ggml-model-q4_0.gguf -f wiki.test.raw -ngl 1 -t 4 + // sum[tpitg] = 0.0f; for (int i00 = tpitg; i00 < ne00; i00 += ntg) { sum[tpitg] += y[i00] * y[i00];