aien-sovereign-core-mv
AienOS host runtime: inference scheduling, paged KV state, the aien CLI and Spark verification tooling. Its inference engine is in alpha testing (DGX Spark GB10); Omega is the implementation destination.
Brought by drakestapleton
aien-sovereign-core-mv / docs / inference / evidence / bitnet-t1-20261015 / NOTES.md
| 1 | # BitNet T1: ternary loader, host only, 2026-10-15 |
| 2 | |
| 3 | Design: `~/handoffs/2026-10-15-ternary-engine-design.md` section 5 row T1. Code: |
| 4 | `crates/aien-inference-abi/src/bitnet_omega.rs`. No chip run, nothing of Microsoft's run. |
| 5 | Master: `BitNet-b1.58-2B-4T-bf16/model.safetensors`, sha256 `529637ff...5ae1` (pinned in code). |
| 6 | Layout id: `omega-trit2-rm16-hfrows-v1` (16 trits per little-endian u32, omega's code |
| 7 | 0b00 = 0, 0b01 = +1, 0b10 = -1, 0b11 refused; `[n][k/16]`; checkpoint row order). |
| 8 | |
| 9 | ## Gates |
| 10 | |
| 11 | | gate | result | receipt | |
| 12 | |---|---|---| |
| 13 | | config refusals by name (family, relu2, tied, bf16, quantisation, unknown keys) | pass | unit tests `refuses_*` | |
| 14 | | trit grid validated, 0b11 refused with row and column | pass | `trit_grid_is_validated_no_0b11` | |
| 15 | | q,k,v and gate,up stacked: trits and one scale per segment | pass | byte test, `byte_test_passes_and_stacks_*` | |
| 16 | | RSS bound, measured in a child process (three full-width layers, 16k vocab): embedding + larger loader phase + 24 MB | growth 203,575,296 B, bound 224,067,584 B (calc:05935794) | `rss-gate.txt` | |
| 17 | | real checkpoint: resident bytes | 849,387,060 B, about 0.85 GB (calc:f379a7e8) | `real-load.txt` | |
| 18 | | real checkpoint: tensors, uploads, peak RSS | exactly the 332 expected tensors; 121 uploads; peak 986,660,864 B over start, bound 1,052,155,024 B (calc:33d3fb7b) | `real-load.txt` | |
| 19 | | real checkpoint: our scales equal the reference int2 scales (spec 6, layers 0, 15, 29) | all 21 equal | `real-load.txt` | |
| 20 | | gguf trit agreement (informational, parsed here) | 2,026,762,053 of 2,084,044,800 agree, 97.2514 % (calc:736bea70) | `gguf-agreement.txt` | |
| 21 | |
| 22 | ## Negative controls |
| 23 | |
| 24 | - A k,v row swap inside the stacked qkv fails the byte test (`stored row 256`). |
| 25 | - A plus/minus plane swap fails the byte test. |
| 26 | - A k,v scale swap fails the byte test (`segment K ... scale`). |
| 27 | - One word-table byte moved by one code step fails the byte test. |
| 28 | - Layer 1's input and post-attention norms swapped on the host fails the byte test. |
| 29 | - An unexpected tensor (a q_proj bias, a stored down_proj scale) or a missing sub-norm is |
| 30 | refused by name before any weight is read. |
| 31 | - Two uploaders break the RSS bound: one keeping an f32 image of every matrix and the table |
| 32 | (growth 1,143,644,160 B) and one keeping an f32 copy of layer 0's qkv only |
| 33 | (243,077,120 B), both against 224,067,584 B. |
| 34 | |
| 35 | ## What the gguf count says |
| 36 | |
| 37 | The test asserts all three of these. Block size 128 decodes (agreement 6,473,881 of 6,553,600 on layer 0 q; block 64 gives |
| 38 | 3,789,499). q and k agree in checkpoint row order, not in the interleaved-RoPE order, so the |
| 39 | gguf keeps the HF rows. The 2.7 % that differ follow from the scale: the gguf quantised with |
| 40 | its own f32 mean (layer 0 q 1.2188548), we with PyTorch's bf16 steps (1.21875, the reference |
| 41 | int2 checkpoint's value), so weights near the half-scale boundary fall either side. |
| 42 | |
| 43 | CALC-EXEMPT: the figures without a calc id are measured values copied from the receipt files named beside them. |