Skip to content

ggml-cpu : deduplicate scalar implementations - #14897

Merged
slaren merged 9 commits into
ggml-org:masterfrom
xctan:cpu-dedup
Jul 28, 2025
Merged

slaren merged 9 commits into
ggml-org:masterfrom
xctan:cpu-dedup

Conversation

@xctan

@xctan xctan commented Jul 27, 2025

Copy link
Copy Markdown
Contributor

This PR cleans up redundant fallback implementations in each architecture, which were introduced in the previous refactor PR #13892.

@github-actions github-actions Bot added the ggml changes relating to the ggml tensor library for machine learning label Jul 27, 2025
Comment thread ggml/src/ggml-cpu/arch/x86/quants.c Resolved
@ggerganov
ggerganov requested a review from slaren July 28, 2025 06:02
@slaren
slaren requested a review from Copilot July 28, 2025 15:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@slaren
slaren merged commit db16e28 into ggml-org:master Jul 28, 2025
Nexesenex added a commit to Nexesenex/croco.cpp that referenced this pull request Aug 7, 2025
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
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants