]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commit
llamafile : ppc64le GEMV forwarding for FP32. (llama/12594)
authoramritahs-ibm <redacted>
Fri, 28 Mar 2025 07:43:22 +0000 (13:13 +0530)
committerGeorgi Gerganov <redacted>
Fri, 28 Mar 2025 19:47:42 +0000 (21:47 +0200)
commit0001ec075f361c704ed817d532092ee1b5599024
treed28f6e4b4c7741c84ff103416bcbd46fb9fe5b88
parent5bad2e5099d46cb4daa073519447c31f05806ec0
llamafile : ppc64le GEMV forwarding for FP32. (llama/12594)

This patch enables usage of MMA when one of the
dimensions of the matrix(ie either M or N) is 1. This
is useful in case of token generation where N < 2.

The concept of 'GEMV Forwarding' is used where when one
of the matrix has a single row/column, the elements are
broadcasted, instead of using packing routine to prepack
the matrix elements.

This change results in 5% - 15% improvement in total
speed(ie all tokens/total time), across various batch
sizes. This is in comparision with the corresponding
dot product implementation.

The patch is tested with FP32 models of Meta-Lllama-3-8B,
Mistral-7B, Llama-2-7B-chat-hf on a IBM POWER10 machine.

Signed-off-by: Amrita H S <redacted>
ggml/src/ggml-cpu/llamafile/sgemm.cpp