Skip to content

ggml-cpu: add always_inline to tinyBLAS_PPC accumulator saves - #20791

Merged
taronaeo merged 1 commit into
ggml-org:masterfrom
shalinib-ibm:ppc_fp32_inline_fix
Mar 20, 2026
Merged

ggml-cpu: add always_inline to tinyBLAS_PPC accumulator saves#20791
taronaeo merged 1 commit into
ggml-org:masterfrom
shalinib-ibm:ppc_fp32_inline_fix

Conversation

@shalinib-ibm

@shalinib-ibm shalinib-ibm commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

Explicitly mark save_acc and add_save_acc with always_inline in tinyBLAS_PPC. This ensures the compiler keeps MMA accumulator disassembly within kernel's register context, preventing un-necessary stask spills.

Make sure to read the contributing guidelines before submitting a PR

@shalinib-ibm
shalinib-ibm requested a review from ggerganov as a code owner March 20, 2026 07:56
@github-actions github-actions Bot added the ggml changes relating to the ggml tensor library for machine learning label Mar 20, 2026
@shalinib-ibm

shalinib-ibm commented Mar 20, 2026

Copy link
Copy Markdown
Contributor Author

@taronaeo

The changes in this PR (powerpc: add FP16 MMA path for Q4/Q8 matmul) caused the compiler to stop inlining add_save and add_save_acc in tinyBLAS_PPC. These functions are on the critical path and rely on inlining for optimal performance (especially in the MMA kernels).
This patch restores inlining of these functions, recovering the expected performance.

Request your review.

@taronaeo

taronaeo commented Mar 20, 2026

Copy link
Copy Markdown
Member

Triggered CI. We are experiencing some intermittent problems with our s390x and ppc64le runners so CI might fail.

@taronaeo

Copy link
Copy Markdown
Member

Fix this CI error: https://github.com/ggml-org/llama.cpp/actions/runs/23334113971/job/67872376882?pr=20791#step:4:5

Explicitly mark save_acc and add_save_Acc with always_inline
in tinyBLAS_PPC. This ensures the compiler keeps MMA accumulator
disassembly within kernel's register context, preventing un-necessary
stask spills.

Signed-off-by: Shalini Salomi Bodapati <Shalini.Salomi.Bodapati@ibm.com>
@taronaeo
taronaeo merged commit e6ec21e into ggml-org:master Mar 20, 2026
79 of 83 checks passed
Seunghhon pushed a commit to Seunghhon/llama.cpp that referenced this pull request Apr 26, 2026
…rg#20791)

Explicitly mark save_acc and add_save_Acc with always_inline
in tinyBLAS_PPC. This ensures the compiler keeps MMA accumulator
disassembly within kernel's register context, preventing un-necessary
stask spills.

Signed-off-by: Shalini Salomi Bodapati <Shalini.Salomi.Bodapati@ibm.com>
ljubomirj pushed a commit to ljubomirj/llama.cpp that referenced this pull request May 6, 2026
…rg#20791)

Explicitly mark save_acc and add_save_Acc with always_inline
in tinyBLAS_PPC. This ensures the compiler keeps MMA accumulator
disassembly within kernel's register context, preventing un-necessary
stask spills.

Signed-off-by: Shalini Salomi Bodapati <Shalini.Salomi.Bodapati@ibm.com>
my-other-github-account pushed a commit to my-other-github-account/llama.cpp that referenced this pull request May 15, 2026
…rg#20791)

Explicitly mark save_acc and add_save_Acc with always_inline
in tinyBLAS_PPC. This ensures the compiler keeps MMA accumulator
disassembly within kernel's register context, preventing un-necessary
stask spills.

Signed-off-by: Shalini Salomi Bodapati <Shalini.Salomi.Bodapati@ibm.com>
my-other-github-account pushed a commit to my-other-github-account/llama.cpp that referenced this pull request May 15, 2026
…rg#20791)

Explicitly mark save_acc and add_save_Acc with always_inline
in tinyBLAS_PPC. This ensures the compiler keeps MMA accumulator
disassembly within kernel's register context, preventing un-necessary
stask spills.

Signed-off-by: Shalini Salomi Bodapati <Shalini.Salomi.Bodapati@ibm.com>
fewtarius pushed a commit to fewtarius/CachyLLama that referenced this pull request May 30, 2026
…rg#20791)

Explicitly mark save_acc and add_save_Acc with always_inline
in tinyBLAS_PPC. This ensures the compiler keeps MMA accumulator
disassembly within kernel's register context, preventing un-necessary
stask spills.

Signed-off-by: Shalini Salomi Bodapati <Shalini.Salomi.Bodapati@ibm.com>
fukuro-kun pushed a commit to fukuro-kun/fukuro-llama-cpp-turboquant that referenced this pull request Jul 5, 2026
…rg#20791)

Explicitly mark save_acc and add_save_Acc with always_inline
in tinyBLAS_PPC. This ensures the compiler keeps MMA accumulator
disassembly within kernel's register context, preventing un-necessary
stask spills.

Signed-off-by: Shalini Salomi Bodapati <Shalini.Salomi.Bodapati@ibm.com>
MrLordCat referenced this pull request in MrLordCat/llama.cpp-rdna-lab Jul 16, 2026
Explicitly mark save_acc and add_save_Acc with always_inline
in tinyBLAS_PPC. This ensures the compiler keeps MMA accumulator
disassembly within kernel's register context, preventing un-necessary
stask spills.

Signed-off-by: Shalini Salomi Bodapati <Shalini.Salomi.Bodapati@ibm.com>
zommiommy pushed a commit to zommiommy/llama.cpp that referenced this pull request Aug 18, 2026
…rg#20791)

Explicitly mark save_acc and add_save_Acc with always_inline
in tinyBLAS_PPC. This ensures the compiler keeps MMA accumulator
disassembly within kernel's register context, preventing un-necessary
stask spills.

Signed-off-by: Shalini Salomi Bodapati <Shalini.Salomi.Bodapati@ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ggml changes relating to the ggml tensor library for machine learning

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants