I2_S produces incorrect output on aarch64
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 25/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 停滞
- 技術スタック
- cpp
調査の方向性
ピン留めされた 3rdparty/llama.cpp サブモジュールから開始し、quants.c、ggml-cpu-i2s.c、ggml_gemm_i2_i8_s、ggml_vec_dot_i2_i8_s に注目してください。aarch64 上で記載された llama-cli コマンドを使って再現し、その後、perplexity と GEMV/GEMM カーネルの出力を x86 と比較してください。アーキテクチャ間で出力と perplexity が一致すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
I2_S inference is broken on aarch64. The model loads and runs, but output is nonsense — it does not crash, so it looks like a bad model rather than a broken kernel.
On an Orange Pi 5 Plus (RK3588, Debian 12, GCC 12.2) with microsoft/BitNet-b1.58-2B-4T's official ggml-model-i2_s.gguf:
$ llama-cli -m ggml-model-i2_s.gguf -p "The capital of France is" -n 12 --temp 0
> The capital of France is ????????????????
[ Prompt: 0.7 t/s | Generation: 0.7 t/s ]
The same file on x86-64 gives The capital of France is Paris. at ~40 t/s. Model md5 verified identical on both machines.
Three separate bugs, all in 3rdparty/llama.cpp code paths that x86 never compiles:
QK_I2_Sis 128 under AVX2 but 64 under__ARM_NEON, in bothquants.candggml-cpu-i2s.c. It is the on-disk block size, so it must match the file format on every architecture.- The scalar
vec_dotfallback decodes the block-interleaved weight layout sequentially. ggml_gemm_i2_i8_s's ACT_PARALLEL branch invertsggml_vec_dot_i2_i8_s'snrcsemantics, corrupting prefill.
There is also no NEON path for I2_S at all — aarch64 unpacks one 2-bit weight at a time.
Fixes in https://github.com/isHuangXin/llama.cpp/pull/2, against the pinned 3rdparty/llama.cpp submodule. After them, perplexity on aarch64 matches x86 to 0.161% (74.0952 vs 73.9758, same model and corpus), and kernel output is bit-identical for both GEMV and GEMM.
This may be the same root cause as #55.
- 主要言語
- C++
- スター
- 40.3k
- フォーク
- 3.7k
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- 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時間 初心者へのやさしさ 76/100
microsoft/BitNet の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
cp-algorithms/cp-algorithms#1715 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
Icinga/icinga2#11058 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
status:needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
PX4/PX4-Autopilot#28924 ·
メンテナーはふだん 1 日以内に返信
-
component: split-view platform: windows
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
zen-browser/desktop#15616 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信