Reference "Software Emulation" implementation of GGML_OP_MUL_MAT #6171
-
Today I was wanting a simple reference implementation of ggml_compute_forward_mul_mat(). Not a hyper optimized BLAS/AVX version. Purpose == sanity checking, making sure I understand the compute exactly. I hoped I would find it in the tests, but I haven't stumbled upon it yet. Does one exist? I tried to write my own, but pretty sure its incorrect, as I was seeing strange behavior at runtime, and I expect memory corruption. Looking at the shapes I'm seeing, it appears that the weights buffers are already transposed. Example shapes: Note how the matching inner dimension appears to be
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Take a look at this example: ggml-org/ggml#713 |
Beta Was this translation helpful? Give feedback.
Thanks @ggerganov. I found a bug in that example, and filed a PR: ggml-org/ggml#770
However, it worked as the perfect testbench for me to fool around until I understood something.
GGML mul_mat computes:
Here is my functioning emulation code: