Windows Compilation Fails: CMake errors in setup_env and missing `const` in ggml-bitnet-mad
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 76/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 静か
- 技術スタック
- cmake, cpp
調査の方向性
setup_env.py と src/ggml-bitnet-mad.cpp から始め、Issue に記載されている Windows ClangCL 構成と AVX2 コンパイルを再現します。Windows ビルドを実行し、正常に完了することを確認して、報告された両方のコンパイラーエラーが解決されていることを検証します。
索引モデルが issue の本文から書いたものです。
説明
Bug Description:
When attempting to compile BitNet from source on a standard Windows environment, the build fails in two separate places:
###Bug 1: CMake Generator Failure in setup_env .py
The compiler script passes the -T ClangCL argument to CMake on Windows. However, it does not explicitly specify a Generator (like -G "Visual Studio 17 2022"). On many Windows systems, CMake will default to the NMake Makefiles generator, which immediately crashes because NMake does not support the -T toolset flag.
Error log:
Generator NMake Makefiles does not support toolset specification, but toolset ClangCL was specified.
The Fix for Bug 1:
In setup_env .py (Line 72), explicitly define the Visual Studio Generator so CMake can actually use the ClangCL toolset.
Change from:
OS_EXTRA_ARGS = {
"Windows":["-T", "ClangCL"],
}
Change to:
OS_EXTRA_ARGS = {
"Windows":["-G", "Visual Studio 17 2022", "-T", "ClangCL"],
}
Bug 2: Missing const type-cast in ggml-bitnet-mad .cpp
Once CMake successfully generates the build files using ClangCL, the actual C++ compilation crashes. The strict Windows Clang compiler rejects an assignment on line 811 inside the AVX2 block of src/ggml-bitnet-mad .cpp because a const modifier was forgotten.
Error log:
error : cannot initialize a variable of type 'int8_t *' with an rvalue of type 'const int8_t *'
The Fix for Bug 2:
In src/ggml-bitnet-mad .cpp (Line 811), the pointer y is explicitly declared as a constant on line 794, so y_col must also be a constant.
Change from:
int8_t * y_col = y + col * by;
Change to:
const int8_t * y_col = y + col * by;
With these two tiny fixes applied, the system compiles flawlessly out-of-the-box on Windows using AVX2 and Clang!
- 主要言語
- C++
- スター
- 40.3k
- フォーク
- 3.7k
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/BitNet のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
-
i2_s SIGSEGVs at n_ubatch >= 32: BLAS backend dequantises by a row stride 4x the real packed row オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
microsoft/BitNet の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
AXERA-TECH/ax-llm#77 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
games-on-whales/wolf#509 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
-
bug-unconfirmed
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100