ggml-cpu: fix fallback for RVV kernels without zvfh#21157
Merged
ggerganov merged 2 commits intoggml-org:masterfrom Apr 1, 2026
Merged
ggml-cpu: fix fallback for RVV kernels without zvfh#21157ggerganov merged 2 commits intoggml-org:masterfrom
ggerganov merged 2 commits intoggml-org:masterfrom
Conversation
xctan
approved these changes
Mar 31, 2026
Collaborator
|
I've tested this and can confirm that it fixed #21064 for me. Thanks! |
slartibardfast
pushed a commit
to slartibardfast/llama.cpp
that referenced
this pull request
Apr 12, 2026
* ggml-cpu: refactor sgemm; fix rvv checks * ggml-cpu: refactor rvv kernels; set zvfbfwma default to off
Seunghhon
pushed a commit
to Seunghhon/llama.cpp
that referenced
this pull request
Apr 26, 2026
* ggml-cpu: refactor sgemm; fix rvv checks * ggml-cpu: refactor rvv kernels; set zvfbfwma default to off
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.
Summary
This PR fixes issues in the RISC-V
zvfhpath for kernels inggml/src/ggml-cpu/llamafile/sgemm.cppandggml/src/ggml-cpu/vec.h(pointed out in #21064)Key Changes
llamafile_sgemmfor inconsistencies in checks forzvfh.GGML_SIMDpath (which is undefined forfp16) whenriscv_v_intrinsicsis defined withoutzvfh. Refactored these so that the scalar implementation is called instead.ggml_vec_scale_f16ggml_vec_mad_f16ggml_vec_dot_f16_unrollGGML_RV_ZVFBFWMAto OFF by default inggml/CMakeLists.txt.