Replies: 1 comment
-
I'm also experiencing this in VirtualBox. I was able to build
Diff (based on the 1.7.4 tag)diff --git a/ggml/include/ggml-cpu.h b/ggml/include/ggml-cpu.h
index 3aa71ba..452e59c 100644
--- a/ggml/include/ggml-cpu.h
+++ b/ggml/include/ggml-cpu.h
@@ -3,6 +3,10 @@
#include "ggml.h"
#include "ggml-backend.h"
+// VirtualBox: __AVX2__ is defined, but certain extensions cause compiler errors.
+// For now, undefine it:
+#undef __AVX2__
+
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/ggml/src/ggml-cpu/ggml-cpu-aarch64.cpp b/ggml/src/ggml-cpu/ggml-cpu-aarch64.cpp
index 622c63f..b2767b4 100644
--- a/ggml/src/ggml-cpu/ggml-cpu-aarch64.cpp
+++ b/ggml/src/ggml-cpu/ggml-cpu-aarch64.cpp
@@ -18,6 +18,11 @@
#include "ggml-cpu-aarch64.h"
+
+// VirtualBox: __AVX2__ is defined, but certain extensions cause compiler errors.
+// For now, undefine it:
+#undef __AVX2__
+
// TODO: move to include file?
template <int K> constexpr int QK_0() {
if constexpr (K == 4) {
@@ -114,7 +119,7 @@ static inline __m512 __avx512_repeat_f32cx16_load(__m128i x) {
return _mm512_loadu_ps(tmp);
}
#endif
-static inline __m256 __avx_f32cx8_load(ggml_fp16_t *x) {
+static inline __m256 __avx_f32cx8_load(const ggml_fp16_t *x) {
float tmp[8];
for (int i = 0; i < 8; i++) {
@@ -123,7 +128,7 @@ static inline __m256 __avx_f32cx8_load(ggml_fp16_t *x) {
return _mm256_loadu_ps(tmp);
}
-static inline __m256 __avx_repeat_f32cx8_load(ggml_fp16_t *x) {
+static inline __m256 __avx_repeat_f32cx8_load(const ggml_fp16_t *x) {
float tmp[8];
for (int i = 0; i < 4; i++) {
@@ -133,7 +138,7 @@ static inline __m256 __avx_repeat_f32cx8_load(ggml_fp16_t *x) {
return _mm256_loadu_ps(tmp);
}
-static inline __m256 __avx_rearranged_f32cx8_load(ggml_fp16_t *x, __m128i arrangeMask) {
+static inline __m256 __avx_rearranged_f32cx8_load(const ggml_fp16_t *x, __m128i arrangeMask) {
uint16_t tmphalf[8];
float tmp[8];
diff --git a/ggml/src/ggml-cpu/ggml-cpu-quants.c b/ggml/src/ggml-cpu/ggml-cpu-quants.c
index 8e14722..63530f8 100644
--- a/ggml/src/ggml-cpu/ggml-cpu-quants.c
+++ b/ggml/src/ggml-cpu/ggml-cpu-quants.c
@@ -31,6 +31,10 @@
// some compilers don't provide _mm256_set_m128i, e.g. gcc 7
#define MM256_SET_M128I(a, b) _mm256_insertf128_si256(_mm256_castsi128_si256(b), (a), 1)
+// VirtualBox: __AVX2__ is defined, but certain extensions cause compiler errors.
+// For now, undefine it:
+#undef __AVX2__
+
#if defined(__AVX__) || defined(__AVX2__) || defined(__AVX512F__) || defined(__SSSE3__)
// multiply int8_t, add results pairwise twice
static inline __m128i mul_sum_i8_pairs(const __m128i x, const __m128i y) {
Note: I haven't verified that these changes don't cause issues at runtime. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I executed
make tiny.en
and got a lot of 'invalid conversion' errors:The verson is v1.7.4 and I buiit it in a virtualbox machine which has no GPU. I know nothing about neither c++ programming nor AI, there were also no anwsers availabe from Google, what should I do to fix those errors?
Thanks for any help.
Beta Was this translation helpful? Give feedback.
All reactions