microsoft / microsoft/BitNet

The CPU with ARM architecture failed to run `env_setup.py`.

Open
#235 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
40.3k
Forks
3.7k
PR merge metrics
No merged PRs in 30d

Description

The CPU with ARM architecture failed to run env_setup.py. Make the following modifications:

  1. Change the code from
posix_memalign(&ptr, 64, size);
return ptr;

to

if posix_memalign(&ptr, 64, size) != 0:
    return nullptr;
  1. 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])));
  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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running env_setup.py on an ARM CPU and locate the C++ code containing the three snippets: posix_memalign, the vec_c updates, and vec_zero. Apply the requested ARM-compatible changes and verify that env_setup.py completes successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, python
Domain
backend, build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.