Skip to content

ggml-cpu(s390x): fix q5_1 uninitialized v_acc - #28332

Merged
ggerganov merged 1 commit into
ggml-org:masterfrom
taronaeo:fix/s390x-q5_1
Sep 4, 2026
Merged

ggerganov merged 1 commit into
ggml-org:masterfrom
taronaeo:fix/s390x-q5_1

Conversation

@taronaeo

@taronaeo taronaeo commented Sep 3, 2026

Copy link
Copy Markdown
Member

Overview

fixes #28281

I forgot to use vec_splats(0.0f) when accumulating, and instead used v_acc, which was undefined. Quoting @IgorTodorovskiIBM:

v_acc is declared const inside the loop body and has no prior value, so the third operand of vec_madd is whatever the register happens to hold. The accumulated sumf is therefore garbage, and can be NaN or Inf depending on the residue.

Relatively simple fix, not sure how I overlooked it.

Requirements

Signed-off-by: Aaron Teo <aaron.teo1@ibm.com>
@taronaeo
taronaeo requested a review from ggerganov as a code owner September 3, 2026 15:23
@taronaeo

taronaeo commented Sep 3, 2026

Copy link
Copy Markdown
Member Author

cc: @AlekseiNikiforovIBM @Andreas-Krebbel for a quick check

@github-actions github-actions Bot added the ggml changes relating to the ggml tensor library for machine learning label Sep 3, 2026
@AlekseiNikiforovIBM

Copy link
Copy Markdown
Contributor

LGTM

@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 Sep 3, 2026
@ggerganov
ggerganov merged commit 832fd6f into ggml-org:master Sep 4, 2026
26 of 29 checks passed
@BrewTestBot BrewTestBot mentioned this pull request Sep 4, 2026
1 task done
x1250 pushed a commit to x1250/llama.cpp that referenced this pull request Sep 9, 2026
Signed-off-by: Aaron Teo <aaron.teo1@ibm.com>
zbrad pushed a commit to zbrad/llama.cpp that referenced this pull request Sep 10, 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.

Bug: s390x ggml_vec_dot_q5_1_q8_1 reads an uninitialised accumulator

3 participants