From 7aa10d0518764857df7174d6959873f242e09704 Mon Sep 17 00:00:00 2001 From: xaedes Date: Sun, 11 Jun 2023 16:50:41 +0200 Subject: [PATCH] fix bug in threaded indices calculation of ggml_compute_forward_flash_attn_back_f32 --- ggml.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ggml.c b/ggml.c index b5eb9123c..79f26ff2d 100644 --- a/ggml.c +++ b/ggml.c @@ -13545,7 +13545,7 @@ static void ggml_compute_forward_flash_attn_back_f32( for (int ir = ir0; ir < ir1; ++ir) { // q indices const int iq3 = ir/(neq2); - const int iq2 = (ir - iq3*neq2)/neq2; + const int iq2 = ir - iq3*neq2; for ( int iq1 = 0; iq1 < neq1; ++iq1) {