HiramKHackenbacker commited on
Commit
bf9b59e
·
verified ·
1 Parent(s): 5aa56c1

8b cap bundle: README with provenance, KV arithmetic, digests

Browse files
Files changed (1) hide show
  1. aff4-c128000/README.md +67 -0
aff4-c128000/README.md ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # LFM2.5 8B-A1B — aff4 D2 at the checkpoint's maximum context (128,000)
2
+
3
+ Core AI bundle for Apple Silicon Macs. **Byte-for-byte the `aff4/` D2 recipe** — affine-int4
4
+ experts (K-block 64, gather_qmm kernel), lm_head untied and quantized int8 **symmetric**
5
+ per-block-32, attention matmul fp16 — with exactly one argument changed:
6
+ `--max-ctx 128000` in place of `16384`.
7
+
8
+ ## Why this is one bundle and not a tier ladder
9
+
10
+ The LFM2.5 export declares its KV sequence dimension as a **dynamic** `torch.export.Dim`, not a
11
+ pinned extent. The saved asset says so:
12
+
13
+ main ST keyCache Float16 6 x 1 x 8 x ? x 64
14
+ main ST valueCache Float16 6 x 1 x 8 x ? x 64
15
+ main ST convState Float16 18 x 1 x 2048 x 2
16
+
17
+ Those descriptors are **character-identical** to the cap-16,384 build. At runtime
18
+ `KVCacheFactory` resolves `.auto` to `GrowingKVCache`, whose `defaultSize` is the constant
19
+ **256 tokens** regardless of the declared cap; it doubles on demand. So raising the cap
20
+ allocates nothing — memory scales with use, not with declaration.
21
+
22
+ Measured cost of the change: `main.mlirb` moved **+22 bytes** (5,707,008,966 -> 5,707,008,988),
23
+ and the first differing byte is at offset 5,706,962,354 — **99.99918% of the file is byte
24
+ identical**, every constant included. For reference, running the identical export command twice
25
+ differs by ~22,000 bytes. The weights are the D2 weights; the fp32-oracle rows cannot move.
26
+
27
+ ## 128,000, not 131,072
28
+
29
+ `config.json` gives `max_position_embeddings = 128000` with `rope_type "default"`,
30
+ `rope_theta 5e6` and **no scaling factor**. 131,072 would be 3,072 positions past everything the
31
+ checkpoint declares. This bundle stops where the checkpoint does.
32
+
33
+ ## What a context window costs
34
+
35
+ 18 of 24 layers are short-convolution mixers whose entire state is `convState` — **147,456
36
+ bytes, fixed, capacity-invariant**. All long-range state rides 6 GQA layers at
37
+ `6 x 8 kv-heads x 64 head_dim x 2 B x 2` = **12,288 B/token**.
38
+
39
+ | window | KV allocated (`GrowingKVCache` rounds to a power of two) |
40
+ |---:|---:|
41
+ | 4,096 | 0.047 GiB |
42
+ | 16,384 | 0.188 GiB |
43
+ | 65,536 | 0.750 GiB |
44
+ | 128,000 | 1.500 GiB (131,072 slots) |
45
+
46
+ The whole ladder from 4k to the checkpoint maximum spans 1.45 GiB.
47
+
48
+ ## Files and sha256
49
+
50
+ metadata.json 647 B e00a70e5820db09928bc338efc01e6abd6f2d7ca19b6f2ff062c202ceb2a7d39
51
+ *.aimodel/main.hash 32 B 7b999d0d329b497afab466891180638116181971c6fe19c956c116cf65b0db1c
52
+ *.aimodel/main.mlirb 5707008988 B 446df156d77cc1b5d2a54c49bb573930cbe22d0281bd7e16f86f24e5da55a663
53
+ *.aimodel/metadata.json 105 B bea3d473ac849d482e4ef338dcdafc1cc8b3db833b07494f903a339a4fe5bd23
54
+ tokenizer/chat_template.jinja 4779 B b2881deb506bdff56bf6ac46aaa33292c119953f82fedaf276634fcc4282a559
55
+ tokenizer/tokenizer.json 17905598 B 695be7802a0e4b8a81048f0ff5ebb7fc811a0ba5a6be63dbb24deb5a81096f41
56
+ tokenizer/tokenizer_config.json 315 B b53c3caceb7fa0de424e1aa67b3cc5008cd2f8b8d2426a8fa221ef3cf1a949d5
57
+ Total: 5,724,920,464 bytes
58
+
59
+ The three tokenizer files are byte-identical to the pinned `aff4/` D2 bundle.
60
+
61
+ Built 2026-08-27, `coreai-torch 0.4.1` / `coreai-core 1.0.0b2`, producer
62
+ `coreai-core 1.0.0b2`, rc=0, 294 s, peak export RSS 46.74 GB.
63
+
64
+ **Not yet compiled or run on a Mac.** No token has been generated from this bundle at any
65
+ context.
66
+
67
+ License: LFM Open License v1.0, inherited from LiquidAI/LFM2.5-8B-A1B (see LICENSE at repo root).