ggml-cpu: Implement P12 MMA+ Matmul kernels#26
Open
shalinib-ibm wants to merge 2 commits into
Open
Conversation
This patch adds p12 mma+ matrix multiplication kernels for BF16 FP16 Q8_0 and Q4_0 data types. This implemenation is tested with standalone test case for BF16 and FP16. For Q8_0 and Q4_0, llama-bench-matmult has been added in examples/benchmark folder. Verified functionally correct results wiith -O3 on mambo. Signed-off-by: Shalini Salomi Bodapati <Shalini.Salomi.Bodapati@ibm.com>
shalinib-ibm
force-pushed
the
p12_mma_plus_bf16_fp16_int8_int4_kernels
branch
from
June 10, 2026 13:02
bf242fe to
e14a4bc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This patch adds p12 mma+ matrix multiplication kernels for BF16 FP16 Q8_0 and Q4_0 data types. This implemenation is tested with standalone test case for BF16 and FP16. For Q8_0 and Q4_0, llama-bench-matmult has been added in examples/benchmark folder.
Verified functionally correct results wiith -O3 on mambo.
Test BF16 MMA+
cd build-O3-ifdef/bin/ && scp libggml-cpu.so.0 libggml-base.so.0 himanshu@bohr.rch.stglabs.ibm.com:/home/himanshu/p12/shalini/bf16/bf16_libs_O3
gcc -O3 -mcpu=future -L/home/shalini/llama.cpp/build-O3/bin -lggml-cpu /home/shalini/bf16_matmul.cpp -o bf16_matmul_O3
scp bf16_matmul_O3 himanshu@bohr.rch.stglabs.ibm.com:/home/himanshu/p12
Test Q8 MMA+
sudo scp libggml-cpu.so.0 libggml-base.so.0 libllama-common.so.0 libggml.so.0 libllama.so.0 himanshu@bohr.rch.stglabs.ibm.com:/home/himanshu/p12/shalini/q8/q8_libs_O3
scp llama-bench-matmult himanshu@bohr.rch.stglabs.ibm.com:/home/himanshu/p12
Running test in mambo:
mount -o loop ubuntu2004-at15.img /mnt/mount2
cd /mnt/mount2
cd bf16_libs_O3/
l
cp /home/himanshu/p12/shalini/bf16/bf16_libs_O3/* .
cd /home/himanshu/p12/
umount /mnt/mount2
unset BBOVOUT && export QTRACE=1 && /home/himanshu/p12/systemsim-p11-release/run/p11/run_cmdline -f boot-linux-ubuntu-p11-mma-support.tcl
Overview
Additional information
Requirements