Repository navigation
ggml-cpu : deduplicate scalar implementations - #14897
Merged
Merged
Conversation
slaren
reviewed
Jul 27, 2025
ggerganov
approved these changes
Jul 28, 2025
slaren
approved these changes
Jul 28, 2025
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR removes redundant scalar fallback implementations from architecture-specific code that were added in a previous refactor, replacing them with calls to generic implementations. The cleanup eliminates duplicated scalar computation code across different CPU architectures while maintaining the same functionality through centralized generic fallback functions.
Key changes:
- Replaced architecture-specific scalar implementations with calls to generic functions
- Added UNUSED macros to silence compiler warnings for variables no longer used in fallback paths
- Maintained existing optimized vectorized code paths while cleaning up fallback implementations
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| ggml/src/ggml-cpu/arch/x86/repack.cpp | Replaced scalar implementations with generic function calls for quantization and matrix operations |
| ggml/src/ggml-cpu/arch/x86/quants.c | Removed duplicated scalar fallback code for vector dot product operations |
| ggml/src/ggml-cpu/arch/wasm/quants.c | Cleaned up scalar implementations in WebAssembly-specific code |
| ggml/src/ggml-cpu/arch/s390/quants.c | Removed redundant scalar fallbacks in s390 architecture code |
| ggml/src/ggml-cpu/arch/riscv/repack.cpp | Simplified RISC-V repack operations by using generic implementations |
| ggml/src/ggml-cpu/arch/riscv/quants.c | Restructured conditional compilation and removed scalar duplications |
| ggml/src/ggml-cpu/arch/powerpc/quants.c | Eliminated redundant scalar code in PowerPC architecture implementation |
Nexesenex
added a commit
to Nexesenex/croco.cpp
that referenced
this pull request
Aug 7, 2025
This reverts commit db16e28.
blime4
referenced
this pull request
in blime4/llama.cpp
Feb 5, 2026
* remove redundant code in riscv * remove redundant code in arm * remove redundant code in loongarch * remove redundant code in ppc * remove redundant code in s390 * remove redundant code in wasm * remove redundant code in x86 * remove fallback headers * fix x86 ggml_vec_dot_q8_0_q8_0
Seunghhon
pushed a commit
to Seunghhon/llama.cpp
that referenced
this pull request
Apr 26, 2026
* remove redundant code in riscv * remove redundant code in arm * remove redundant code in loongarch * remove redundant code in ppc * remove redundant code in s390 * remove redundant code in wasm * remove redundant code in x86 * remove fallback headers * fix x86 ggml_vec_dot_q8_0_q8_0
my-other-github-account
pushed a commit
to my-other-github-account/llama.cpp
that referenced
this pull request
May 15, 2026
* remove redundant code in riscv * remove redundant code in arm * remove redundant code in loongarch * remove redundant code in ppc * remove redundant code in s390 * remove redundant code in wasm * remove redundant code in x86 * remove fallback headers * fix x86 ggml_vec_dot_q8_0_q8_0
fukuro-kun
pushed a commit
to fukuro-kun/fukuro-llama-cpp-turboquant
that referenced
this pull request
Jul 5, 2026
* remove redundant code in riscv * remove redundant code in arm * remove redundant code in loongarch * remove redundant code in ppc * remove redundant code in s390 * remove redundant code in wasm * remove redundant code in x86 * remove fallback headers * fix x86 ggml_vec_dot_q8_0_q8_0
MrLordCat
referenced
this pull request
in MrLordCat/llama.cpp-rdna-lab
Jul 16, 2026
* remove redundant code in riscv * remove redundant code in arm * remove redundant code in loongarch * remove redundant code in ppc * remove redundant code in s390 * remove redundant code in wasm * remove redundant code in x86 * remove fallback headers * fix x86 ggml_vec_dot_q8_0_q8_0
zommiommy
pushed a commit
to zommiommy/llama.cpp
that referenced
this pull request
Aug 18, 2026
* remove redundant code in riscv * remove redundant code in arm * remove redundant code in loongarch * remove redundant code in ppc * remove redundant code in s390 * remove redundant code in wasm * remove redundant code in x86 * remove fallback headers * fix x86 ggml_vec_dot_q8_0_q8_0
frostyautumnleaf
pushed a commit
to frostyautumnleaf/llama.cpp
that referenced
this pull request
Oct 5, 2026
* remove redundant code in riscv * remove redundant code in arm * remove redundant code in loongarch * remove redundant code in ppc * remove redundant code in s390 * remove redundant code in wasm * remove redundant code in x86 * remove fallback headers * fix x86 ggml_vec_dot_q8_0_q8_0
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.
This PR cleans up redundant fallback implementations in each architecture, which were introduced in the previous refactor PR #13892.