ARM I2_S inference produces gibberish/garbage output after commit 112f853 (CPU Optimization update)
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 48/100
- Type d'issue
- Bug
- Clarté
- Plutôt claire
- Activité
- À l'abandon
- Stack technique
- cpp
- Domaine
- machine-learning, performance
Piste de recherche
Reproduisez l’échec d’inférence sur ARM aarch64 à l’aide de run_inference.py et du modèle i2_s, puis comparez le commit fonctionnel 404980e au commit de régression 112f853. Commencez par ggml-bitnet-mad.cpp et les kernels générés par utils/codegen_tl1.py, en vérifiant les chemins NEON et de produit scalaire ; le travail est terminé lorsqu’une sortie cohérente est obtenue sur les plateformes ARM signalées sans régression de l’optimisation.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Description
After the CPU Inference Optimization update (commit 112f853), running inference with i2_s quantization on ARM (aarch64) produces completely incoherent output — random tokens with no relation to the prompt. Rolling back to commit 404980e (the last commit before the optimization merge) restores correct, coherent output.
Environment
- Hardware: Raspberry Pi 5 (8GB RAM), ARM Cortex-A76 (aarch64)
- OS: Raspberry Pi OS 64-bit (Debian 12 Bookworm)
- Compiler: Debian clang version 18.1.8
- CMake: 3.25.1
- Python: 3.9 (conda)
- Model:
microsoft/BitNet-b1.58-2B-4T-gguf(ggml-model-i2_s.gguf) - Quantization: i2_s
Steps to Reproduce
-
Clone repo at current HEAD (
01eb415):git clone --recursive https://github.com/microsoft/BitNet.git cd BitNet -
Generate kernels and build (following Adafruit guide):
python utils/codegen_tl1.py --model bitnet_b1_58-3B --BM 160,320,320 --BK 64,128,64 --bm 32,64,32 export CC=clang-18 CXX=clang++-18 rm -rf build && mkdir build && cd build cmake .. -DCMAKE_BUILD_TYPE=Release make -j$(nproc) cd .. -
Download model:
huggingface-cli download microsoft/BitNet-b1.58-2B-4T-gguf --local-dir models/BitNet-b1.58-2B-4T -
Run inference:
python run_inference.py -m models/BitNet-b1.58-2B-4T/ggml-model-i2_s.gguf -p "You are a helpful assistant" -t 4 -cnv
Broken Output (HEAD - 01eb415)
> hi how are you
ri differentorefFly increase Hurtutar run following section underestimateAD Sachs weighedision
cann RICTS Reyn taskfir-ra mark filtr castWATCHB fr ret flatten missionuche purchase parameter
gramhit associatedyuraft runeded take compound sugar contrast unsubedom conveyuffanford...
Working Output (commit 404980e)
> hi
Hello! How can I assist you today?
> what is a raspi 5
The Raspberry Pi 5 is a next-generation model of the Raspberry Pi single-board computer series...
Performance on the working commit: 9.68 tokens/second (4 threads, ARM NEON).
Bisection
The regression was introduced in commit 112f853:
112f853 [feat] I2S kernels for weight & activation parallel on Intel & ARM machine;
[feat] I2S GEMV & GEMM(llama.cpp);
[feat] quantize activation & dequantize embedding(llama.cpp);
[fix] compile bug: cannot define __ARM_FEATURE_DOTPROD(llama.cpp)
The last known working commit is 404980e (one commit before 112f853).
Notes
- The build completes without errors on both commits — the issue is runtime behavior, not compilation.
ggml-bitnet-mad.cppis compiled and linked in both cases.- NEON is detected and enabled (
NEON = 1in system_info output). - DOTPROD detection:
GGML_COMPILER_SUPPORT_DOTPROD - Failed, butCOMPILER_SUPPORTS_ARMV82_DOTPROD - Success. - This issue also appears to affect other ARM64 platforms (Ampere/Hetzner CAX servers), not just Raspberry Pi.
- The Adafruit BitNet on Raspberry Pi guide (published Sept 2025, before the optimization commit) confirms working output on Pi 4 and Pi 5 with the older codebase.
Related to #411 — same root cause. Adding Pi 5 (Cortex-A76 with dotprod) as another confirmed affected platform.
- Langage dominant
- C++
- Étoiles
- 40.3k
- Forks
- 3.7k
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Préparer son environnement
Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de microsoft/BitNet
-
Difficulté 2/5 1-3 heures Accessibilité débutants 86/100
-
i2_s SIGSEGVs at n_ubatch >= 32: BLAS backend dequantises by a row stride 4x the real packed rowOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 86/100
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 92/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
Toutes les issues de microsoft/BitNet
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
Les mainteneurs répondent en général sous 1 jour
-
[meshoptimizer] update to 1.3Ouvertecategory:port-update
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
Les mainteneurs répondent en général sous 1 jour
-
CLI jira shell completion
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Les mainteneurs répondent en général sous 1 jour