-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
Conversation
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.
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 |
This PR cleans up redundant fallback implementations in each architecture, which were introduced in the previous refactor PR #13892.