Skip to content

Add CPU backend check and i2 dequantize helper for GGML - #626

Open
Cmr-Ms (Cmr-Ms) wants to merge 2 commits into
microsoft:mainfrom
Cmr-Ms:main
Open

Add CPU backend check and i2 dequantize helper for GGML#626
Cmr-Ms (Cmr-Ms) wants to merge 2 commits into
microsoft:mainfrom
Cmr-Ms:main

Conversation

@Cmr-Ms

@Cmr-Ms Cmr-Ms (Cmr-Ms) commented Sep 10, 2026

Copy link
Copy Markdown

@microsoft-github-policy-service agree

Require GGML backend to be CPU in ggml_bitnet_transform_tensor and update source include paths. Update src/CMakeLists.txt to add required ggml headers/sources and include directories. Add dequantize_row_i2_s implementation and adjust includes in ggml-bitnet-mad.cpp and ggml-bitnet-lut.cpp to reference llama.cpp/ggml sources (ggml-quants.h, ggml-cpu-impl.h). These changes ensure CPU-only transforms, correct header resolution, and provide an i2 dequantization helper.
@Cmr-Ms

Cmr-Ms (Cmr-Ms) commented Sep 10, 2026

Copy link
Copy Markdown
Author

Relates to #595.

BitNet自身のsrc/CMakeLists.txtでGGML_SOURCES_BITNETが2回代入されており、
1回目の値(ggml-bitnet-mad.cpp)が2回目の代入で上書きされ、
ビルド対象から静かに脱落していました。
これによりquantize_i2_sが未定義シンボルになる経路の一つになっていた可能性があります。
#606 はllama.cppサブモジュール側のggml-base/ggml-cpu構造の問題を対処しており、
本PRとは別レイヤーの修正です)

あわせてquantize_i2_sに対応するdequantize_row_i2_sの実装が
存在しなかったため追加しました。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant