Skip to content

ggml-cpu(s390x): refactor repack helper functions - #30588

Merged
ggerganov merged 1 commit into
ggml-org:masterfrom
taronaeo:refactor/repack-helpers
Oct 16, 2026
Merged

ggerganov merged 1 commit into
ggml-org:masterfrom
taronaeo:refactor/repack-helpers

Conversation

@taronaeo

Copy link
Copy Markdown
Member

Overview

cont: #28667 (comment)

This PR refactors the repack helpers into ggml-cpu-impl.h where the other inline helpers are currently located at. Fixes the problem that #28775 reported as well.

Along with this refactor, we introduce a helper function that converts FP16 -> FP32 via vector intrinsics. However, this helper function has limitations where inf is mapped to 65536.0f and likewise NaN into a finite number which would throw off Flash Attention. This helper is currently only recommended to be used for weight quants.

Additional information

Some performance improvement is seen from using the new FP16 -> FP32 vector intrinsic conversion.

CPU Model Test t/s master t/s branch Speedup
CPU granitemoe 1B.A400M Q4_0 pp512 74.39 79.29 1.07
CPU granitemoe 1B.A400M Q4_0 tg128 36.95 39.32 1.06
CPU llama 1B Q4_0 pp512 60.35 60.90 1.01
CPU llama 1B Q4_0 tg128 10.69 11.18 1.05

Requirements

Signed-off-by: Aaron Teo <aaron.teo1@ibm.com>
@taronaeo
taronaeo requested a review from ggerganov as a code owner October 15, 2026 11:52
@taronaeo taronaeo added the merge ready A maintainer can use this label to indicate that they consider the changes final and ready to merge. label Oct 15, 2026
@github-actions github-actions Bot added the ggml changes relating to the ggml tensor library for machine learning label Oct 15, 2026
@ggerganov

Copy link
Copy Markdown
Member

Let's merge this after the release today - I've already started the ggml sync: ggml-org/ggml#1657

@ggerganov
ggerganov merged commit c804754 into ggml-org:master Oct 16, 2026
39 of 54 checks passed
edwardyoon pushed a commit to edwardyoon/focus-llama that referenced this pull request Oct 24, 2026
Signed-off-by: Aaron Teo <aaron.teo1@ibm.com>
auRose94 pushed a commit to auRose94/llama.cpp that referenced this pull request Oct 28, 2026
Signed-off-by: Aaron Teo <aaron.teo1@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 merge ready A maintainer can use this label to indicate that they consider the changes final and ready to merge.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants