ARM i2_s (1.58-bit) CPU path produces constant output; fix in pinned llama.cpp submodule
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- cpp
- Lĩnh vực
- machine-learning, performance
Hướng nghiên cứu
Bắt đầu với ggml/src/ggml-cpu/quants.c và ggml/src/ggml-cpu/ggml-cpu.c, sau đó xem xét upstream pull request #6 và tái hiện trường hợp ARM i2_s trên submodule llama.cpp đã được ghim. So sánh đầu ra phụ thuộc vào prompt và tính tương đương chính xác của số nguyên với tham chiếu vô hướng; hoàn tất khi pin của submodule bao gồm bản sửa lỗi và đường dẫn ARM không còn tạo ra đầu ra hằng số.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- C++
- Star
- 40.3k
- Fork
- 3.7k
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microsoft/BitNet
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
-
i2_s SIGSEGVs at n_ubatch >= 32: BLAS backend dequantises by a row stride 4x the real packed rowĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Tất cả issue của microsoft/BitNet
Issue tương tự
-
bug chart-audit
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
godotengine/godot#124120 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Component: R Type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
apache/arrow#51695 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
HasBacktrace Priority-Critical
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
azerothcore/azerothcore-wotlk#27921 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area/ysql kind/bug priority/medium
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
yugabyte/yugabyte-db#34584 ·
Maintainer thường phản hồi trong vòng 1 ngày