Repository navigation
Description
Goal
Establish, with evidence on Apple M6 (host eddie, 32 GB, macOS 27.0.1, FEAT_SME2=1 FEAT_SME=1 FEAT_I8MM=1 FEAT_DotProd=1), whether this fork's CPU path builds and produces correct output for the official BitNet b1.58 2B4T model, and what it costs. Umbrella for #2 (build), #3 (correctness) and #4 (optimization).
Why
Upstream microsoft/BitNet reports, all open as of 2026-10-31: macOS arm64 build breakage (microsoft#682, microsoft#641, microsoft#635, microsoft#618, microsoft#99) and wrong I2_S output on ARM (microsoft#585/microsoft#586, microsoft#598, microsoft#600, microsoft#610, microsoft#633). The upstream paper tested ARM on a Mac Studio M2 Ultra. None of these reports was reproduced on M6 by us; this issue is the reproduction.
Plan
- Pin this fork at the current
main(identical to upstream at filing time) and record the commit and the3rdparty/llama.cppsubmodule commit. - Build on eddie following the README, then per fix: macOS arm64 build (upstream #682, #641, #635, #618, #99) - reproduce on M6 and fix #2. Record every failure verbatim. No silent workaround.
- Run the official
ggml-model-i2_s.gguf(microsoft/bitnet-b1.58-2B-4T-gguf, 1.19 GB) and judge correctness first (see fix: I2_S wrong output on ARM (upstream #585/#586, #598, #600, #610, #633) - correctness gate and patch evaluation #3) and only then speed. - CPU lane only:
-ngl 0. Metal is not in scope (upstream has no Metal kernel; PR Add Metal backend for Apple Silicon inference microsoft/BitNet#528 is unmerged).
Acceptance
- Build recipe that works from a clean checkout, or a documented failure with logs.
- Correctness verdict against the reference (fix: I2_S wrong output on ARM (upstream #585/#586, #598, #600, #610, #633) - correctness gate and patch evaluation #3), pass or fail, with raw outputs.
- tg and pp tokens/s at 1, 4 and 8 threads with
llama-bench-style protocol, plus RSS; tagged with commit, compiler, threads and host conditions. - Results compared against a same-weights reference path (mlx-lm
bitnetmodel on Metal, BF16 or 8-bit) as a control, labelled as a different substrate. - Findings posted upstream where they are bugs we can show (reproduction, not speculation).
Out of scope
Metal / ANE paths. Other models (Falcon-E etc.) until the 2B4T result is known.
Tracked from py-quantbench low-bit baseline (link added below).
Activity
eejd commentedon Oct 31, 2026
Tracked from eejd/py-quantbench#469 (low-bit baseline on M6). Related upstream plan: eejd/agent-services-hive#682 (lane B: bitnet.cpp).
eejd commentedon Oct 31, 2026
Results of the first validation on eddie (M6, 32 GiB), from eejd/py-quantbench#474 (draft;
docs/evidence/m6-eddie-lowbit-2026-10-31/):main(= this fork at filing) does not build on arm64; after the build fixes (fix: macOS arm64 build - static libs, src1_cont, CPU-only backends, docs (#2) #5) the officialggml-model-i2_s.ggufprints@@@@and the correctness gate FAILS with NaN logits (agent run,bitnet-cpp-eddie-report).I2_Skernel fix and squared-ReLU FFN) the gate passes against an mlx-lm float32 reference: top-1 1.000, mean KL 0.0026, perplexity 7.1785 vs 7.1532. I re-ran a raw-completion sanity check (three greedy prompts) on the patched binary (sha256efb7f8179ccd...): coherent text, identical to the MLX path on the first prompt.llama-bench -r 3, one invocation per point (host label: affected by the resident agent harness): 1 thread decode 16.6 / prefill(512) 18.9 tok/s; 4 threads 48.9 / 69.8; 6 threads 62.3 / 101.3; 8 threads 52.0 / 89.7. The same model on the Metal GPU through mlx-lm: decode 112 (native pack) / 148 (8-bit repack), prefill 328.unknown pre-tokenizer type: 'falcon_e'.eejd commentedon Nov 1, 2026
Engine work merged (#5, #6, #7 at f8f0837): clean build recipe, correctness gate PASS on the official GGUF, kernel tests 58/58. The remaining speed/RSS baseline and the Metal control are tracked in eejd/py-quantbench#488. #2 and #3 stay open for their leftovers.