-
Notifications
You must be signed in to change notification settings - Fork 10k
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
ggml : fix arm build #10890
ggml : fix arm build #10890
Conversation
Signed-off-by: Adrien Gallouët <[email protected]>
Signed-off-by: Adrien Gallouët <[email protected]>
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.
Looks good:
- M1 Pro
-- ARM detected
-- Performing Test COMPILER_SUPPORTS_FP16_FORMAT_I3E
-- Performing Test COMPILER_SUPPORTS_FP16_FORMAT_I3E - Failed
-- Performing Test GGML_COMPILER_SUPPORT_DOTPROD
-- Performing Test GGML_COMPILER_SUPPORT_DOTPROD - Success
-- Performing Test GGML_COMPILER_SUPPORT_I8MM
-- Performing Test GGML_COMPILER_SUPPORT_I8MM - Failed
-- ARM feature DOTPROD enabled
-- ARM feature FMA enabled
-- ARM feature FP16_VECTOR_ARITHMETIC enabled
-- Adding CPU backend variant ggml-cpu: -march=native+dotprod __ARM_FEATURE_DOTPROD
- M2 Ultra
-- ARM detected
-- Performing Test COMPILER_SUPPORTS_FP16_FORMAT_I3E
-- Performing Test COMPILER_SUPPORTS_FP16_FORMAT_I3E - Failed
-- Performing Test GGML_COMPILER_SUPPORT_DOTPROD
-- Performing Test GGML_COMPILER_SUPPORT_DOTPROD - Success
-- Performing Test GGML_COMPILER_SUPPORT_I8MM
-- Performing Test GGML_COMPILER_SUPPORT_I8MM - Success
-- ARM feature DOTPROD enabled
-- ARM feature MATMUL_INT8 enabled
-- ARM feature FMA enabled
-- ARM feature FP16_VECTOR_ARITHMETIC enabled
-- Adding CPU backend variant ggml-cpu: -march=native+dotprod+i8mm __ARM_FEATURE_DOTPROD;__ARM_FEATURE_MATMUL_INT8
Note: llamafile sgemm uses |
Just for information, that way we need to check all required features as
while
|
Ok, it is using |
And many other flags too, especially for cross-compilation, that's why I think we should have a generic flag setting when |
Which flags are you thinking about? |
Sometimes we need to force Cross-compiling is always complicated anyway, some iterations will be needed so having a generic flag could help. |
It might make more sense to pass these kind of flags with |
On Android termux Snapdragon 8 gen 1 gives With this commit it produces unusable binaries. cat /proc/cpuinfo processor : 1 processor : 2 processor : 3 processor : 4 processor : 5 processor : 6 processor : 7 |
I encounterred the error "Failed to get ARM features" when I tried to compile the Android example with this build. |
#On Android termux Snapdragon 8 gen 1 gives With Snapdragon 8 gen 1 I can only build with -march=native+nosve . Seems like it's sve implementation is bad. |
Maybe we could add more tests for features (SVE), and disable them explicitly with the |
* ggml: GGML_NATIVE uses -mcpu=native on ARM Signed-off-by: Adrien Gallouët <[email protected]> * ggml: Show detected features with GGML_NATIVE Signed-off-by: Adrien Gallouët <[email protected]> * remove msvc support, add GGML_CPU_ARM_ARCH option * disable llamafile in android example * march -> mcpu, skip adding feature macros ggml-ci --------- Signed-off-by: Adrien Gallouët <[email protected]> Co-authored-by: Adrien Gallouët <[email protected]>
-mcpu=native
withGGML_NATIVE
for arm, but additionally check for dotprod and i8mm because not every compiler enables themGGML_CPU_ARM_ARCH
that can be used to specify the architecture whenGGML_NATIVE
is disabledGGML_SVE
, use-DGGML_NATIVE=OFF -DGGML_CPU_ARM_ARCH=armv8.6-a+sve
for the same effectggml_backend_cpu_get_features
Supersedes #10752