Skip to content

ggml-cpu : deduplicate scalar implementations #14897

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

Merged
merged 9 commits into from
Jul 28, 2025
Merged

Conversation

xctan
Copy link
Collaborator

@xctan xctan commented Jul 27, 2025

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
@ggerganov ggerganov requested a review from slaren July 28, 2025 06:02
@slaren slaren requested a review from Copilot July 28, 2025 15:39
Copy link

@Copilot Copilot AI left a comment

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
47 checks passed
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.

3 participants