]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commitdiff
ggml : add alternative cblas_sgemm call
authorGeorgi Gerganov <redacted>
Thu, 8 Dec 2022 21:48:04 +0000 (23:48 +0200)
committerGeorgi Gerganov <redacted>
Thu, 8 Dec 2022 21:48:04 +0000 (23:48 +0200)
ggml.c

diff --git a/ggml.c b/ggml.c
index f379f5525392f11c9618d74581d1129b227a395a..6c38a0324be68f9c254614cdc668b553b5d35fb8 100644 (file)
--- a/ggml.c
+++ b/ggml.c
@@ -4590,13 +4590,22 @@ void ggml_compute_forward_mul_mat_f16_f32(
                 //    }
                 //}
 
-                // zT = y * xT
                 {
+#if 1
+                    // zT = y * xT
                     cblas_sgemm(CblasRowMajor, CblasNoTrans, CblasTrans,
                             ne11, ne01, ne10,
-                            1.0f,    y, ne10,
-                                     x, ne10,
+                            1.0f,    y, ne00,
+                                     x, ne00,
                             0.0f,    d, ne01);
+#else
+                    // zT = (xT * y)T
+                    cblas_sgemm(CblasColMajor, CblasTrans, CblasNoTrans,
+                            ne01, ne11, ne10,
+                            1.0f,    x, ne00,
+                                     y, ne00,
+                            0.0f,    d, ne01);
+#endif
                 }
             }
         }