BitNet
BitNet copied to clipboard
The CPU with ARM architecture failed to run `env_setup.py`.
The CPU with ARM architecture failed to run env_setup.py. Make the following modifications:
- Change the code from
posix_memalign(&ptr, 64, size);
return ptr;
to
if posix_memalign(&ptr, 64, size) != 0:
return nullptr;
- Change the code from
vec_c[{6}] += vec_v_left_{0}.val[0];
vec_c[{6}] += vec_v_right_{0}.val[0];
vec_c[{7}] += vec_v_left_{0}.val[1];
vec_c[{7}] += vec_v_right_{0}.val[1];
to
vec_c[{6}] = vaddq_s16(vec_c[{6}], vmovl_s8(vget_low_s8(vec_v_left_{0}.val[0])));
vec_c[{6}] = vaddq_s16(vec_c[{6}], vmovl_s8(vget_low_s8(vec_v_right_{0}.val[0])));
vec_c[{7}] = vaddq_s16(vec_c[{7}], vmovl_s8(vget_low_s8(vec_v_left_{0}.val[1])));
vec_c[{7}] = vaddq_s16(vec_c[{7}], vmovl_s8(vget_low_s8(vec_v_right_{0}.val[1])));
- Change the code from
const int8x16_t vec_zero = vdupq_n_s16(0x0000);
to
const int16x8_t vec_zero = vdupq_n_s16(0x0000);
After modification, it can be successful
https://github.com/microsoft/BitNet/issues/240