-
Notifications
You must be signed in to change notification settings - Fork 9.9k
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
common : try to fix Android CI #6780
Conversation
8eb6540
to
0a86385
Compare
@ggerganov What about simply skipping
patch exampleIndex: common/common.cpp
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/common/common.cpp b/common/common.cpp
--- a/common/common.cpp (revision 0e4802b2ecbaab04b4f829fde4a3096ca19c84b5)
+++ b/common/common.cpp (date 1713342380677)
@@ -109,6 +109,7 @@
}
#if defined(__x86_64__) && defined(__linux__)
+#ifndef __ANDROID__
#include <pthread.h>
static void cpuid(unsigned leaf, unsigned subleaf,
@@ -156,6 +157,7 @@
return result;
}
+#endif // __ANDROID__
#endif // __x86_64__ && __linux__
/**
@@ -163,6 +165,7 @@
*/
int get_math_cpu_count() {
#if defined(__x86_64__) && defined(__linux__)
+#ifndef __ANDROID__
int cpu_count = sysconf(_SC_NPROCESSORS_ONLN);
if (cpu_count < 1) {
return get_num_physical_cores();
@@ -177,7 +180,8 @@
}
}
}
-#endif
+#endif // __ANDROID__
+#endif // __x86_64__ && __linux__
return get_num_physical_cores();
}
Index: examples/llama.android/README.md
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/examples/llama.android/README.md b/examples/llama.android/README.md
--- a/examples/llama.android/README.md (revision 0e4802b2ecbaab04b4f829fde4a3096ca19c84b5)
+++ b/examples/llama.android/README.md (date 1713605825665)
@@ -1,0 +1,3 @@
+# llama.cpp/examples/llama.android
+
+Demonstration of simple android app example. Works for me locally. BTW I will have a look to the android example. It does not work. |
Thanks. I keep forgetting that the Android CI pulls from diff --git a/common/common.cpp b/common/common.cpp
index b6143e41..3039e470 100644
--- a/common/common.cpp
+++ b/common/common.cpp
@@ -108,7 +108,7 @@ int32_t get_num_physical_cores() {
return n_threads > 0 ? (n_threads <= 4 ? n_threads : n_threads / 2) : 4;
}
-#if defined(__x86_64__) && defined(__linux__) && !defined(__ANDROID__)
+#if defined(__x86_64__) && defined(__gnu_linux__)
#include <pthread.h>
static void cpuid(unsigned leaf, unsigned subleaf,
@@ -162,7 +162,7 @@ static int count_math_cpus(int cpu_count) {
* Returns number of CPUs on system that are useful for math.
*/
int get_math_cpu_count() {
-#if defined(__x86_64__) && defined(__linux__) && !defined(__ANDROID__)
+#if defined(__x86_64__) && defined(__gnu_linux__)
int cpu_count = sysconf(_SC_NPROCESSORS_ONLN);
if (cpu_count < 1) {
return get_num_physical_cores(); For now, will merge as it is to make the CI green and can improve in the future |
Noted, I will fix that also. At the moment it is impossible to load a model anyway. I will have fun with that :) |
Yes it is fixed, thanks: |
* common : disable get_math_cpu_count() until Android CI gets fixed * common : another try
ref #6414
https://github.com/ggerganov/llama.cpp/actions/runs/8757099433/job/24035025415#step:5:200