-
Notifications
You must be signed in to change notification settings - Fork 13.4k
ggml-cpu: fixes instability in NNPA Vector Intrinsics #15739
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 5 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
14c870d
ggml-cpu: stabilise nnpa fp32<->fp16
taronaeo 0cc2017
ggml-cpu: enable GGML_NNPA by default
taronaeo 1edd6ed
ggml-cpu: switch flash attention disable to ggml-cpu
taronaeo b8e17f5
ggml-cpu: disable fattn via ggml
taronaeo a59f362
ggml-cpu: add comment for fattn disable
taronaeo fde5231
ggml-cpu: undo fattn override for nnpa
taronaeo ed91ef6
ggml-cpu: temp disable faulty fp32<->fp16 conversion
taronaeo 4200bea
ggml-cpu: disable more faulty code for rework
taronaeo 0b3bec8
ggml-cpu: add more logging to detect -inf
taronaeo b9ce37e
ggml-cpu: wip
taronaeo d73c4cd
ggml-cpu: log dup_f32
taronaeo 0510f25
ggml-cpu: wip
taronaeo fac0dbc
ggml-cpu: wip
taronaeo dc84c2a
ggml-cpu: wip
taronaeo f00ecaf
ggml-cpu: wip
taronaeo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,14 +42,14 @@ cmake --build build --config Release -j $(nproc) | |
| cmake --build build --config Release -j $(nproc) | ||
| ``` | ||
|
|
||
| - By default, NNPA is disabled by default. To enable it: | ||
| - By default, NNPA is enabled when available. To disable it (not recommended): | ||
|
|
||
| ```bash | ||
| cmake -S . -B build \ | ||
| -DCMAKE_BUILD_TYPE=Release \ | ||
| -DGGML_BLAS=ON \ | ||
| -DGGML_BLAS_VENDOR=OpenBLAS \ | ||
| -DGGML_NNPA=ON | ||
| -DGGML_NNPA=OFF | ||
|
|
||
| cmake --build build --config Release -j $(nproc) | ||
| ``` | ||
|
|
@@ -166,7 +166,7 @@ Only available in IBM z15/LinuxONE 3 or later system with the `-DGGML_VXE=ON` (t | |
|
|
||
| ### 2. NNPA Vector Intrinsics Acceleration | ||
|
|
||
| Only available in IBM z16/LinuxONE 4 or later system with the `-DGGML_NNPA=ON` (turned off by default) compile flag. No hardware acceleration is possible with llama.cpp with older systems, such as IBM z15/arch13. In such systems, the APIs can still run but will use a scalar implementation. | ||
| Only available in IBM z16/LinuxONE 4 or later system with the `-DGGML_NNPA=ON` (turned on when available) compile flag. No hardware acceleration is possible with llama.cpp with older systems, such as IBM z15/arch13. In such systems, the APIs can still run but will use a scalar implementation. | ||
|
|
||
| ### 3. zDNN Accelerator (WIP) | ||
|
|
||
|
|
@@ -230,10 +230,6 @@ IBM VXE/VXE2 SIMD acceleration depends on the BLAS implementation. It is strongl | |
| CXXFLAGS="-include cstdint" pip3 install -r requirements.txt | ||
| ``` | ||
|
|
||
| 5. `-DGGML_NNPA=ON` generates gibberish output | ||
|
|
||
| Answer: We are aware of this as detailed in [this issue](https://github.com/ggml-org/llama.cpp/issues/14877). Please either try reducing the number of threads, or disable the compile option using `-DGGML_NNPA=OFF`. | ||
|
|
||
| ## Getting Help on IBM Z & LinuxONE | ||
|
|
||
| 1. **Bugs, Feature Requests** | ||
|
|
@@ -292,4 +288,4 @@ IBM VXE/VXE2 SIMD acceleration depends on the BLAS implementation. It is strongl | |
| - 🚫 - acceleration unavailable, will still run using scalar implementation | ||
| - ❓ - acceleration unknown, please contribute if you can test it yourself | ||
|
|
||
| Last Updated by **Aaron Teo ([email protected])** on Aug 22, 2025. | ||
| Last Updated by **Aaron Teo ([email protected])** on Sep 2, 2025. | ||
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not going to work. Either the problem with NNPA should be fixed, or NNPA support removed.