Skip to content

ggml-cpu: Implement P12 MMA+ Matmul kernels#26

Open
shalinib-ibm wants to merge 2 commits into
masterfrom
p12_mma_plus_bf16_fp16_int8_int4_kernels
Open

ggml-cpu: Implement P12 MMA+ Matmul kernels#26
shalinib-ibm wants to merge 2 commits into
masterfrom
p12_mma_plus_bf16_fp16_int8_int4_kernels

Conversation

@shalinib-ibm

@shalinib-ibm shalinib-ibm commented Jun 5, 2026

Copy link
Copy Markdown
Owner

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

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
shalinib-ibm force-pushed the p12_mma_plus_bf16_fp16_int8_int4_kernels branch from bf242fe to e14a4bc Compare June 10, 2026 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant