BitNet icon indicating copy to clipboard operation
BitNet copied to clipboard

Getting Errors When following Readme Instruction on ARM

Open zwx109473 opened this issue 1 year ago • 1 comments

In file included from /root/BitNet/3rdparty/llama.cpp/ggml/src/./ggml-quants.h:4, from /root/BitNet/src/ggml-bitnet-lut.cpp:9: /root/BitNet/3rdparty/llama.cpp/ggml/src/./ggml-common.h:154:16: warning: ISO C++ prohibits anonymous structs [-Wpedantic] 154 | struct { | ^ /root/BitNet/3rdparty/llama.cpp/ggml/src/./ggml-common.h:175:16: warning: ISO C++ prohibits anonymous structs [-Wpedantic] 175 | struct { | ^ /root/BitNet/3rdparty/llama.cpp/ggml/src/./ggml-common.h:196:16: warning: ISO C++ prohibits anonymous structs [-Wpedantic] 196 | struct { | ^ In file included from /root/BitNet/3rdparty/llama.cpp/ggml/src/./ggml-quants.h:4, from /root/BitNet/src/ggml-bitnet-lut.cpp:9: /root/BitNet/3rdparty/llama.cpp/ggml/src/./ggml-common.h:261:16: warning: ISO C++ prohibits anonymous structs [-Wpedantic] 261 | struct { | ^ /root/BitNet/3rdparty/llama.cpp/ggml/src/./ggml-common.h:288:16: warning: ISO C++ prohibits anonymous structs [-Wpedantic] 288 | struct { | ^ /root/BitNet/3rdparty/llama.cpp/ggml/src/./ggml-common.h:305:16: warning: ISO C++ prohibits anonymous structs [-Wpedantic] 305 | struct { | ^ In file included from /root/BitNet/src/ggml-bitnet-lut.cpp:10: /root/BitNet/3rdparty/llama.cpp/ggml/src/../../../../include/bitnet-lut-kernels.h:24:6: warning: no previous declaration for ‘void per_tensor_quant(int, void*, void*)’ [-Wmissing-declarations] 24 | void per_tensor_quant(int k, void* lut_scales_, void* b_) {{ | ^~~~~~~~~~~~~~~~ /root/BitNet/3rdparty/llama.cpp/ggml/src/../../../../include/bitnet-lut-kernels.h:53:6: warning: no previous declaration for ‘void partial_max_reset(void*)’ [-Wmissing-declarations] 53 | void partial_max_reset(void* lut_scales_) {{ | ^~~~~~~~~~~~~~~~~ /root/BitNet/3rdparty/llama.cpp/ggml/src/../../../../include/bitnet-lut-kernels.h: In function ‘void tbl_impl_14336_4096(int32_t*, int8_t*, uint8_t*)’: /root/BitNet/3rdparty/llama.cpp/ggml/src/../../../../include/bitnet-lut-kernels.h:190:50: note: use ‘-flax-vector-conversions’ to permit conversions between vectors with differing element types or numbers of subparts 190 | const int8x16_t vec_zero = vdupq_n_s16(0x0000); | ^ /root/BitNet/3rdparty/llama.cpp/ggml/src/../../../../include/bitnet-lut-kernels.h:190:43: error: cannot convert ‘int16x8_t’ to ‘const int8x16_t’ in initialization 190 | const int8x16_t vec_zero = vdupq_n_s16(0x0000); | ~~~~~~~~~~~^~~~~~~~ | | | int16x8_t /root/BitNet/3rdparty/llama.cpp/ggml/src/../../../../include/bitnet-lut-kernels.h:202:44: error: cannot convert ‘const int8x16_t’ to ‘int16x8_t’ 202 | vec_c[i] = vandq_s16(vec_c[i], vec_zero); | ^~~~~~~~ | | | const int8x16_t In file included from /root/BitNet/3rdparty/llama.cpp/ggml/src/../../../../include/ggml-bitnet.h:7, from /root/BitNet/src/ggml-bitnet-lut.cpp:8: /usr/lib/gcc/aarch64-linux-gnu/10.3.1/include/arm_neon.h:1591:37: note: initializing argument 2 of ‘int16x8_t vandq_s16(int16x8_t, int16x8_t)’ 1591 | vandq_s16 (int16x8_t __a, int16x8_t __b) | ~~~~~~~~~~^~~ In file included from /root/BitNet/src/ggml-bitnet-lut.cpp:10: /root/BitNet/3rdparty/llama.cpp/ggml/src/../../../../include/bitnet-lut-kernels.h:217:22: error: invalid operands to binary + (have ‘int16x8_t’ and ‘int8x16_t’) 217 | vec_c[0] += vec_v_left_0.val[0]; | ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /root/BitNet/3rdparty/llama.cpp/ggml/src/../../../../include/bitnet-lut-kernels.h:217:22: note: in evaluation of ‘operator+=(int16x8_t, int8x16_t)’ /root/BitNet/3rdparty/llama.cpp/ggml/src/../../../../include/bitnet-lut-kernels.h:218:22: error: invalid operands to binary + (have ‘int16x8_t’ and ‘int8x16_t’) 218 | vec_c[0] += vec_v_right_0.val[0]; | ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~ /root/BitNet/3rdparty/llama.cpp/ggml/src/../../../../include/bitnet-lut-kernels.h:218:22: note: in evaluation of ‘operator+=(int16x8_t, int8x16_t)’ /root/BitNet/3rdparty/llama.cpp/ggml/src/../../../../include/bitnet-lut-kernels.h:219:22: error: invalid operands to binary + (have ‘int16x8_t’ and ‘int8x16_t’) 219 | vec_c[1] += vec_v_left_0.val[1]; | ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /root/BitNet/3rdparty/llama.cpp/ggml/src/../../../../include/bitnet-lut-kernels.h:219:22: note: in evaluation of ‘operator+=(int16x8_t, int8x16_t)’ /root/BitNet/3rdparty/llama.cpp/ggml/src/../../../../include/bitnet-lut-kernels.h:220:22: error: invalid operands to binary + (have ‘int16x8_t’ and ‘int8x16_t’) 220 | vec_c[1] += vec_v_right_0.val[1]; | ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~ /root/BitNet/3rdparty/llama.cpp/ggml/src/../../../../include/bitnet-lut-kernels.h:220:22: note: in evaluation of ‘operator+=(int16x8_t, int8x16_t)’ /root/BitNet/3rdparty/llama.cpp/ggml/src/../../../../include/bitnet-lut-kernels.h:231:22: error: invalid operands to binary + (have ‘int16x8_t’ and ‘int8x16_t’) 231 | vec_c[0] += vec_v_left_1.val[0]; | ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /root/BitNet/3rdparty/llama.cpp/ggml/src/../../../../include/bitnet-lut-kernels.h:231:22: note: in evaluation of ‘operator+=(int16x8_t, int8x16_t)’ /root/BitNet/3rdparty/llama.cpp/ggml/src/../../../../include/bitnet-lut-kernels.h:232:22: error: invalid operands to binary + (have ‘int16x8_t’ and ‘int8x16_t’) 232 | vec_c[0] += vec_v_right_1.val[0]; | ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~ /root/BitNet/3rdparty/llama.cpp/ggml/src/../../../../include/bitnet-lut-kernels.h:232:22: note: in evaluation of ‘operator+=(int16x8_t, int8x16_t)’ /root/BitNet/3rdparty/llama.cpp/ggml/src/../../../../include/bitnet-lut-kernels.h:233:22: error: invalid operands to binary + (have ‘int16x8_t’ and ‘int8x16_t’) 233 | vec_c[1] += vec_v_left_1.val[1]; | ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /root/BitNet/3rdparty/llama.cpp/ggml/src/../../../../include/bitnet-lut-kernels.h:233:22: note: in evaluation of ‘operator+=(int16x8_t, int8x16_t)’ /root/BitNet/3rdparty/llama.cpp/ggml/src/../../../../include/bitnet-lut-kernels.h:234:22: error: invalid operands to binary + (have ‘int16x8_t’ and ‘int8x16_t’) 234 | vec_c[1] += vec_v_right_1.val[1]; | ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~ /root/BitNet/3rdparty/llama.cpp/ggml/src/../../../../include/bitnet-lut-kernels.h:234:22: note: in evaluation of ‘operator+=(int16x8_t, int8x16_t)’ /root/BitNet/3rdparty/llama.cpp/ggml/src/../../../../include/bitnet-lut-kernels.h:245:22: error: invalid operands to binary + (have ‘int16x8_t’ and ‘int8x16_t’) 245 | vec_c[2] += vec_v_left_2.val[0]; | ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /root/BitNet/3rdparty/llama.cpp/ggml/src/../../../../include/bitnet-lut-kernels.h:245:22: note: in evaluation of ‘operator+=(int16x8_t, int8x16_t)’ /root/BitNet/3rdparty/llama.cpp/ggml/src/../../../../include/bitnet-lut-kernels.h:246:22: error: invalid operands to binary + (have ‘int16x8_t’ and ‘int8x16_t’) 246 | vec_c[2] += vec_v_right_2.val[0]; | ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~ /root/BitNet/3rdparty/llama.cpp/ggml/src/../../../../include/bitnet-lut-kernels.h:246:22: note: in evaluation of ‘operator+=(int16x8_t, int8x16_t)’ /root/BitNet/3rdparty/llama.cpp/ggml/src/../../../../include/bitnet-lut-kernels.h:247:22: error: invalid operands to binary + (have ‘int16x8_t’ and ‘int8x16_t’) 247 | vec_c[3] += vec_v_left_2.val[1]; | ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /root/BitNet/3rdparty/llama.cpp/ggml/src/../../../../include/bitnet-lut-kernels.h:247:22: note: in evaluation of ‘operator+=(int16x8_t, int8x16_t)’ /root/BitNet/3rdparty/llama.cpp/ggml/src/../../../../include/bitnet-lut-kernels.h:248:22: error: invalid operands to binary + (have ‘int16x8_t’ and ‘int8x16_t’) 248 | vec_c[3] += vec_v_right_2.val[1]; | ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~ /root/BitNet/3rdparty/llama.cpp/ggml/src/../../../../include/bitnet-lut-kernels.h:248:22: note: in evaluation of ‘operator+=(int16x8_t, int8x16_t)’ /root/BitNet/3rdparty/llama.cpp/ggml/src/../../../../include/bitnet-lut-kernels.h:259:22: error: invalid operands to binary + (have ‘int16x8_t’ and ‘int8x16_t’) 259 | vec_c[2] += vec_v_left_3.val[0]; | ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /root/BitNet/3rdparty/llama.cpp/ggml/src/../../../../include/bitnet-lut-kernels.h:259:22: note: in evaluation of ‘operator+=(int16x8_t, int8x16_t)’ /root/BitNet/3rdparty/llama.cpp/ggml/src/../../../../include/bitnet-lut-kernels.h:260:22: error: invalid operands to binary + (have ‘int16x8_t’ and ‘int8x16_t’) 260 | vec_c[2] += vec_v_right_3.val[0]; | ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~ /root/BitNet/3rdparty/llama.cpp/ggml/src/../../../../include/bitnet-lut-kernels.h:260:22: note: in evaluation of ‘operator+=(int16x8_t, int8x16_t)’ /root/BitNet/3rdparty/llama.cpp/ggml/src/../../../../include/bitnet-lut-kernels.h:261:22: error: invalid operands to binary + (have ‘int16x8_t’ and ‘int8x16_t’) 261 | vec_c[3] += vec_v_left_3.val[1]; | ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /root/BitNet/3rdparty/llama.cpp/ggml/src/../../../../include/bitnet-lut-kernels.h:261:22: note: in evaluation of ‘operator+=(int16x8_t, int8x16_t)’ /root/BitNet/3rdparty/llama.cpp/ggml/src/../../../../include/bitnet-lut-kernels.h:262:22: error: invalid operands to binary + (have ‘int16x8_t’ and ‘int8x16_t’) 262 | vec_c[3] += vec_v_right_3.val[1]; | ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~ /root/BitNet/3rdparty/llama.cpp/ggml/src/../../../../include/bitnet-lut-kernels.h:262:22: note: in evaluation of ‘operator+=(int16x8_t, int8x16_t)’ /root/BitNet/3rdparty/llama.cpp/ggml/src/../../../../include/bitnet-lut-kernels.h: At global scope: /root/BitNet/3rdparty/llama.cpp/ggml/src/../../../../include/bitnet-lut-kernels.h:287:9: warning: no previous declaration for ‘int32_t qgemm_lut_14336_4096(void*, void*, void*, void*, void*)’ [-Wmissing-declarations] 287 | int32_t qgemm_lut_14336_4096(void* A, void* LUT, void* Scales, void* LUT_Scales, void* C) { | ^~~~~~~~~~~~~~~~~~~~ In file included from /root/BitNet/src/ggml-bitnet-lut.cpp:10: /root/BitNet/3rdparty/llama.cpp/ggml/src/../../../../include/bitnet-lut-kernels.h:299:2: warning: extra ‘;’ [-Wpedantic] 299 | }; | ^ /root/BitNet/3rdparty/llama.cpp/ggml/src/../../../../include/bitnet-lut-kernels.h: In function ‘void tbl_impl_4096_14336(int32_t*, int8_t*, uint8_t*)’: /root/BitNet/3rdparty/llama.cpp/ggml/src/../../../../include/bitnet-lut-kernels.h:308:43: error: cannot convert ‘int16x8_t’ to ‘const int8x16_t’ in initialization 308 | const int8x16_t vec_zero = vdupq_n_s16(0x0000); | ~~~~~~~~~~~^~~~~~~~ | | | int16x8_t /root/BitNet/3rdparty/llama.cpp/ggml/src/../../../../include/bitnet-lut-kernels.h:320:44: error: cannot convert ‘const int8x16_t’ to ‘int16x8_t’ 320 | vec_c[i] = vandq_s16(vec_c[i], vec_zero);

zwx109473 avatar Nov 15 '24 07:11 zwx109473

In the log files I am getting this when running python setup_env.py -md /root/Llama3-8B-1.58-100B-tokens -q i2_s on linux server with arm CPU.

zwx109473 avatar Nov 15 '24 07:11 zwx109473

@zwx109473 I had similar issues (Debian container image running on Mac M1 - aarch64) until I discovered (help from my issue) that the clang install script did not set CC and CXX environment variables, and therefore the process was using gcc rather than clang. Fixing that allowed me to build successfully.

noppej avatar Nov 19 '24 12:11 noppej