Complation error on Fedora release 39 (Thirty Nine) with clang 17.0.6

Open Beginner friendly
#509 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
68/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
cpp, fedora, linux
Domain
build-system

Research direction

Open src/ggml-bitnet-mad.cpp around line 811 and reproduce the build on Fedora 39 with clang 17.0.6. Verify that the reported constness error is resolved and that BitNet compiles successfully after the targeted change.

Written by the indexing model from the issue text.

Description

Compilation fails with message:

while building BitNet on linux with clang17 I have following error:

      |                                      ^
/root/bitnet/BitNet/src/ggml-bitnet-mad.cpp:811:18: error: cannot initialize a variable of type 'int8_t *' (aka 'signed char *') with an rvalue of type 'const int8_t *' (aka 'const signed char *')
  811 |         int8_t * y_col = y + col * by;
      |                  ^       ~~~~~~~~~~~~`

possible solution:

diff --git a/src/ggml-bitnet-mad.cpp b/src/ggml-bitnet-mad.cpp
index 4ba9d65..019e25c 100644
--- a/src/ggml-bitnet-mad.cpp
+++ b/src/ggml-bitnet-mad.cpp
@@ -808,7 +808,7 @@ void ggml_vec_dot_i2_i8_s_Nx1(int n, float * s, size_t bs, const void * vx, size
             accu[iy] = _mm256_setzero_si256();
         }

-        int8_t * y_col = y + col * by;
+        const int8_t * y_col = y + col * by;

         for (int i = 0; i < group32_num; i++) {
             const uint8_t *px = x + i * 1024;
@@ -1053,4 +1053,4 @@ void ggml_vec_dot_i2_i8_s(int n, float * s, size_t bs, const void * vx, size_t b
     {
         ggml_vec_dot_i2_i8_s_1x1(n, s, bs, vx, bx, vy, by, nrc);
     }
-}

it compiles.

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

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.

More from microsoft/BitNet

All issues in microsoft/BitNet

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.