]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commitdiff
ggml : Fix transposed SOLVE_TRI result (llama/17323)
authorPiotr Wilkin (ilintar) <redacted>
Thu, 20 Nov 2025 10:58:21 +0000 (11:58 +0100)
committerGeorgi Gerganov <redacted>
Fri, 12 Dec 2025 15:53:05 +0000 (17:53 +0200)
* Did someone transpose the SOLVE_TRI result matrix? Perhaps...

* Update ggml/src/ggml-cpu/ops.cpp

Co-authored-by: Sigbjørn Skjæret <redacted>
* Update ggml/src/ggml-cpu/ops.cpp

Co-authored-by: Sigbjørn Skjæret <redacted>
---------

Co-authored-by: Sigbjørn Skjæret <redacted>
ggml/src/ggml-cpu/ops.cpp

index b6209588db1e44ae25dfba0e58ee70da8d201141..41e89d83c2ec943e859944bb39669c9ea0cc9845 100644 (file)
@@ -9696,13 +9696,12 @@ static void ggml_compute_forward_solve_tri_f32(const struct ggml_compute_params
         for (int64_t i00 = 0; i00 < n; ++i00) {
             float sum = 0.0f;
             for (int64_t t = 0; t < i00; ++t) {
-                sum += A_batch[i00 * n + t] * X_batch[i01 * n + t];
+                sum += A_batch[i00 * n + t] * X_batch[t * k + i01];
             }
 
             const float diag = A_batch[i00 * n + i00];
             GGML_ASSERT(diag != 0.0f && "Zero diagonal in triangular matrix");
-
-            X_batch[i01 * n + i00] = (B_batch[i00 * k + i01] - sum) / diag;
+            X_batch[i00 * k + i01] = (B_batch[i00 * k + i01] - sum) / diag;
         }
     }
 }