microsoft / microsoft/BitNet

Infinite compilation when using setup.py

Open
#251 7 comments 7 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

Hi everyone
I got a mac M1 and I tried to build bitnet, everythings ran fine until I ran python setup_env.py -md models/BitNet-b1.58-2B-4T -q i2_s

When I run it, I only got INFO:root:Compiling the code using CMake. and then... nothing for an hour
It only make my computer burn for 1 hour

I checked logs/generate_build_files.log and here what I got :

-- Accelerate framework found
-- Metal framework found
-- OpenMP found
-- BLAS found, Libraries: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework
-- BLAS found, Includes:
-- Using llamafile
-- Warning: ccache not found - consider installing it for faster compilation or disable this warning with GGML_CCACHE=OFF
-- CMAKE_SYSTEM_PROCESSOR: arm64
-- ARM detected
-- Configuring done (0.3s)
-- Generating done (0.1s)
-- Build files have been written to: /Users/teo/repo/BitNet/build

So nothing very revelant... here log/compile.log

/Users/teo/repo/BitNet/3rdparty/llama.cpp/ggml/src/../include/ggml.h:585:9: note: 'backend' has been explicitly marked deprecated here
  585 |         GGML_DEPRECATED(enum ggml_backend_type backend, "use the buffer type to find the storage location of the tensor");
      |         ^
/Users/teo/repo/BitNet/3rdparty/llama.cpp/ggml/src/../include/ggml.h:192:61: note: expanded from macro 'GGML_DEPRECATED'
  192 | #    define GGML_DEPRECATED(func, hint) func __attribute__((deprecated(hint)))
      |                                                             ^
/Users/teo/repo/BitNet/src/ggml-bitnet-lut.cpp:74:15: warning: unused variable 'bits' [-Wunused-variable]
   74 |     const int bits = ggml_bitnet_get_type_bits(src0->type);
      |               ^~~~
/Users/teo/repo/BitNet/src/ggml-bitnet-lut.cpp:70:131: warning: unused parameter 'dst' [-Wunused-parameter]
   70 | size_t ggml_bitnet_mul_mat_get_wsize(const struct ggml_tensor * src0, const struct ggml_tensor * src1, const struct ggml_tensor * dst) {
      |

Just a bunch or warnings, no errors here
logs/codegen.log is empty

I don't really know what happened, seems to be stuck in an infinite loop when compiling, if you have some ideas...

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 with the python setup_env.py -md models/BitNet-b1.58-2B-4T -q i2_s entry point and inspect how it invokes CMake. Compare logs/generate_build_files.log with logs/compile.log, including the warnings from src/ggml-bitnet-lut.cpp; logs/codegen.log is empty. Done means the command completes on a Mac M1 or reports a reproducible, actionable compilation error.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp, python
Domain
build-system, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.