ARM i2_s (1.58-bit) CPU path produces constant output; fix in pinned llama.cpp submodule
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 停滞
- 技术栈
- cpp
调研方向
从 ggml/src/ggml-cpu/quants.c 和 ggml/src/ggml-cpu/ggml-cpu.c 开始,然后查看上游 pull request #6,并在已固定版本的 llama.cpp 子模块中复现 ARM i2_s 情况。将依赖 prompt 的输出和精确整数一致性与标量参考实现进行比较;当子模块 pin 包含该修复且 ARM 路径不再产生恒定输出时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
The ARM CPU path for i2_s (1.58-bit ternary) produces constant, prompt-independent output (@@@@) on AArch64, while the x86 AVX2 path is correct and Metal aborts on tensor type 36. This affects builds using the pinned 3rdparty/llama.cpp submodule (isHuangXin/llama.cpp @ release-bitnet-embedding-0.6b-270m).
Root cause is in the ARM fallback of ggml_vec_dot_i2_i8_s in ggml/src/ggml-cpu/quants.c: it unpacked the 2-bit weights with a sequential layout instead of the interleaved layout the dequantizer and AVX2 path use, remapped the ternary codes instead of keeping the raw 0/1/2 the caller subtracts against, and only handled one of the two vec-dot calling conventions. Confirmed by reverting one file at a time on a clean tree (reverting quants.c brings the constant output back).
Fix (2 files, quants.c + ggml-cpu.c) submitted upstream to the pinned fork:
https://github.com/isHuangXin/llama.cpp/pull/6
Tested on Apple M2, same i2_s GGUF before and after: coherent prompt-dependent output restored (5 of 5 distinct prompts distinct), about 30 tok/s generation vs about 2 tok/s on the scalar path, and 48 of 48 exact-integer parity against an independent scalar reference. This lines up with the open issues #468 (to_float UB) and #585 (i2_s layout).
Credit: the degeneracy was first isolated in a two-node verification pass by John Reed (github.com/jar9, Meridian North). Once the submodule pin picks up the fix by commit, the BitNet ARM CPU path is restored.
- 主要语言
- C++
- 星标
- 40.4k
- 派生
- 3.7k
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 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
-
Warning: `huggingface-cli` is deprecated and no longer works. Use `hf` instead.可能已有人在做 @ousamabenyounes 于 59 天前认领。 未关闭
难度 1/5 1 小时以内 新手友好度 92/100
-
难度 2/5 1-3 小时 新手友好度 76/100
相似的 Issue
-
Status: Awaiting triage
难度 2/5 1-3 小时 新手友好度 75/100
espressif/arduino-esp32#12984 ·
维护者通常 1 天内回复
-
torch_ops/logprob.cu does not compile with the serving container's nvcc (13.3.73); check_torch_ops.py cannot run as shipped可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1 小时以内 新手友好度 72/100
ashhart/TensorFold#535 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
agent:Windows bug
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复