Skip to content

Commit ed92c3d

Browse files
committed
metal : put warning in kernel_norm to not combine the loops
1 parent 5e1c408 commit ed92c3d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ggml-metal.metal

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,12 @@ kernel void kernel_norm(
235235

236236
// VARIANCE
237237
// parallel sum
238+
//
239+
// WARNING: combining this loop with the one above will give you wrong results for nth == 256
240+
// I have no idea why, so for now I am keeping them separate. But this behavior is very concerning.
241+
// Tested with:
242+
// ./perplexity -m ./falcon-7b/ggml-model-q4_0.gguf -f wiki.test.raw -ngl 1 -t 4
243+
//
238244
sum[tpitg] = 0.0f;
239245
for (int i00 = tpitg; i00 < ne00; i00 += ntg) {
240246
sum[tpitg] += y[i00] * y[i00];

0 commit comments

Comments
 (0)