ggml: fixed Arm SVE usage bug in vec.h, vec.cpp#22841
Merged
ggerganov merged 1 commit intoMay 28, 2026
Merged
Conversation
* Updated vec.h/vec.cpp code to accumulate to F32 rather than F16 Signed-off-by: Martin Klacer <martin.klacer@arm.com> Co-authored-by: Milos Puzovic <Milos.Puzovic@arm.com> Change-Id: I0cb789347f2bf60ffaf9047319f727e788c825f8
Contributor
Author
|
Hello @ggerganov, I wanted to follow up on this PR and check if you've had a chance to take a look? If you have any questions about the PR or code changes I'm happy to provide more detail. Thank you! |
Collaborator
|
Hi @ggerganov — just wanted to highlight this PR again when you have a chance. This fixes an Arm SVE accumulation issue where FP16 accumulation was being used in F16 MAC paths even though the output type is FP32. On some larger models, this could lead to overflow and random ASCII output generation. We’ve reviewed and validated the fix internally on our side as well. Thanks! |
Member
|
Thanks for the reminder! |
adrianhoehne
pushed a commit
to adrianhoehne/llama.cpp
that referenced
this pull request
May 28, 2026
* Updated vec.h/vec.cpp code to accumulate to F32 rather than F16 Change-Id: I0cb789347f2bf60ffaf9047319f727e788c825f8 Signed-off-by: Martin Klacer <martin.klacer@arm.com> Co-authored-by: Milos Puzovic <Milos.Puzovic@arm.com>
fewtarius
pushed a commit
to fewtarius/llama.cpp
that referenced
this pull request
May 30, 2026
* Updated vec.h/vec.cpp code to accumulate to F32 rather than F16 Change-Id: I0cb789347f2bf60ffaf9047319f727e788c825f8 Signed-off-by: Martin Klacer <martin.klacer@arm.com> Co-authored-by: Milos Puzovic <Milos.Puzovic@arm.com>
turbo-tan
pushed a commit
to turbo-tan/llama.cpp-tq3
that referenced
this pull request
Jun 2, 2026
* Updated vec.h/vec.cpp code to accumulate to F32 rather than F16 Change-Id: I0cb789347f2bf60ffaf9047319f727e788c825f8 Signed-off-by: Martin Klacer <martin.klacer@arm.com> Co-authored-by: Milos Puzovic <Milos.Puzovic@arm.com>
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.
Overview
This pull request fixes Arm SVE code in GGML vec.h and vec.cpp files. Previously, the F16 multiply accumulate functions used F16 as the accumulation data type as well, even though the output type is F32. This lead to overflows in some larger models, causing random ASCII output. This PR changes the accumulation to be F32 data type which solves the overflow.
Additional information
This PR fixes the bug: #21548
Requirements