SPB Git

spb/localvm-research Public License

Running LLMs larger than memory on a consumer Mac — falsification-driven research: margin-gated deferred refinement, out-of-core verification on Apple Silicon. TR-01 published.

Python 63.2% JavaScript 23.5% CSS 11.8% Shell 0.9% Makefile 0.5%

expH: full run results + analysis — SSD ceiling ~13.1 GB/s iostat-validated

Cold random reads 67 MB/s (4KiB QD1) to 13.8 GB/s (1MiB QD8, at ceiling);
<5% degradation under saturated Metal matmul; cache-contaminated cells
flagged invalid; hypothesis confirmed. Storage is not the binding
constraint at >=256KiB QD>=4 access patterns.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Simon-Pierre Boucher committed 6 h ago (Aug 12, 2026) parent f1110ee

Showing 3 changed files with +103 and −7

modified experiments/micro/expH_ssd_feasibility/analysis.md +70 −3
@@ -3,10 +3,77 @@ project: localvm-research
3 3 document: expH_ssd_feasibility/analysis
4 4 author: Simon-Pierre Boucher
5 5 contact: contact@spboucher.ai
6 created: 2026-08-11
7 status: draft
6 +created: 2026-08-12
7 +status: reviewed
8 8 ---
9 9
10 10 # Analysis — expH_ssd_feasibility
11 11
12 *To be written after results exist. Must include the seven-field block and the evidence standard of CLAUDE.md §10.*
12 +Run: `results/expH_ssd_feasibility/20260812T034359Z/` · code committed at `b4a652d`
13 +Hardware: Apple M5 Max (6P+12E, 40 GPU cores), 48 GB unified memory, APPLE SSD AP2048Z
14 +(2 TB, internal APFS), macOS 27.0 (26A5388g), Python 3.14.4, MLX 0.32.0.
15 +3 repeats/cell, adaptive budget (~3 s wall/repeat, 256 MiB floor, 8 GiB cap),
16 +8 GiB incompressible test file written with `F_NOCACHE`. `iostat -d -w 1` logged
17 +alongside as controller-level ground truth.
18 +
19 +```text
20 +Hypothesis
21 + See hypothesis.md: ≥2 GB/s uncached random reads at ≥1 MiB blocks; sharp
22 + degradation below 64 KiB; modest degradation under concurrent Metal load.
23 +
24 +Falsification criterion
25 + <500 MB/s uncached random @1 MiB, or >50% collapse under GPU load.
26 + → NOT triggered. Hypothesis survives, and understates the hardware.
27 +
28 +Method / Baseline
29 + As registered in hypothesis.md (internal sequential baseline; no straw men).
30 +
31 +Result (mean of 3 repeats; std in results.json, mostly <2%)
32 + Cold random reads (F_NOCACHE file, iostat-validated):
33 + 4 KiB QD1: 67 MB/s (16.6k IOPS) QD8: 480 MB/s (117k IOPS)
34 + 64 KiB QD1: 770 MB/s QD8: 5138 MB/s
35 + 256 KiB QD1: 2302 MB/s QD8: 11590 MB/s
36 + 1 MiB QD1: 4556 MB/s QD4: 13628 MB/s QD8: 13789 MB/s ← at ceiling
37 + iostat peak disk throughput across the whole run: 13112 MB/s → the true
38 + device ceiling is ~13 GB/s. Warm-cache peak (page cache / unified memory):
39 + 136 GB/s — a ~10× RAM:SSD ratio, far better than the ~100–250:1 cliff on
40 + discrete-GPU systems (PCIe + separate VRAM).
41 + Under concurrent MLX fp16 4096² matmul load (10 032 iterations, GPU
42 + saturated): 4 KiB QD8 480→478 MB/s; 1 MiB QD8 13789→13393 MB/s (−2.9%).
43 +
44 + INVALID CELLS (flagged, not used): every cell whose mean exceeds the
45 + iostat ceiling is cache-contaminated — all 4 MiB cells (48–55 GB/s) and
46 + threaded sequential cells at ≥256 KiB (24–34 GB/s). Cause: budget ≈ file
47 + size, so repeats re-read blocks whose F_NOCACHE pages had not yet been
48 + evicted. Sequential single-thread cells ≤14 GB/s are plausible but treated
49 + as upper bounds only.
50 +
51 +Interpretation
52 + 1. SSD weight-streaming is VIABLE on this hardware — with the right access
53 + pattern. At ~13 GB/s, a runtime spending 50% of a 100 ms/token budget on
54 + I/O can read ~650 MB/token; even QD1 1 MiB reads supply ~450 MB/token.
55 + 2. The access-pattern contract is strict: ≥256 KiB blocks at QD≥4 (or
56 + ≥1 MiB at any QD) reach ≥60% of ceiling; 4 KiB random is 200× slower
57 + than ceiling. Weight block layout must therefore bundle to ≥256 KiB —
58 + consistent with LLM-in-a-flash's row-column bundling rationale.
59 + 3. Unified-memory contention is a non-issue (<5% under full GPU matmul
60 + load): prefetch threads can run concurrently with Metal compute.
61 + 4. macOS measurement discipline established: F_NOCACHE does not bypass
62 + already-resident pages (first run read 42–115 GB/s from cache);
63 + test data must be written uncached; any figure above the concurrent
64 + iostat ceiling is contamination; 16 KiB pages make sub-16 KiB uncached
65 + I/O impossible in principle.
66 + 5. Bytes/token budget implication for candidates: interactive ≥5 tok/s
67 + leaves ≤~1.3 GB/token of SSD reads in the theoretical limit, ≤~650
68 + MB/token realistically. A 100 GB-class checkpoint is usable only if
69 + per-token touched bytes stay ~two orders of magnitude below total size
70 + — which is exactly the decoupling this project investigates.
71 +
72 +Next experiment
73 + expD/expG (progressive reconstruction + decision stability) become the
74 + binding questions: the storage substrate is not the bottleneck; the open
75 + question is whether ≤650 MB/token of *useful* residual/expert/sparse bytes
76 + suffice to preserve model behavior. Also rerun key cells with a 64 GiB
77 + test file (> RAM) to close the cache-contamination hole for sequential
78 + cells before publishing any sequential numbers.
79 +```
modified experiments/micro/expH_ssd_feasibility/hypothesis.md +13 −4
@@ -4,6 +4,7 @@ document: expH_ssd_feasibility/hypothesis
4 4 author: Simon-Pierre Boucher
5 5 contact: contact@spboucher.ai
6 6 created: 2026-08-11
7 +modified: 2026-08-12
7 8 status: draft
8 9 ---
9 10
@@ -41,12 +42,20 @@ Baseline
41 42 baseline; no straw men — we compare random vs our own sequential).
42 43
43 44 Result
44 <filled after the run>
45 + Hypothesis CONFIRMED and understated. Cold random reads: 67 MB/s (4 KiB
46 + QD1) → 13.8 GB/s (1 MiB QD8, at the iostat-validated ~13.1 GB/s device
47 + ceiling). GPU load cost <5%. 4 MiB and threaded-sequential cells were
48 + cache-contaminated and are flagged invalid. Full numbers:
49 + results/expH_ssd_feasibility/20260812T034359Z/ and analysis.md.
45 50
46 51 Interpretation
47 <filled after the run>
52 + SSD streaming is viable at ~650 MB/token (realistic) if and only if
53 + blocks are ≥256 KiB at QD≥4. Prefetch can overlap Metal compute freely.
54 + See analysis.md for the full argument and the measurement-discipline
55 + findings (F_NOCACHE semantics).
48 56
49 57 Next experiment
50 <filled after the run; likely expE (partial GEMM) or a prefetch-overlap
51 probe depending on where the knee of the curve sits>
58 + expD/expG — the substrate is not the bottleneck; whether ≤650 MB/token of
59 + useful bytes preserves behavior is. Secondary: rerun sequential cells with
60 + a 64 GiB (> RAM) file.
52 61 ```
modified research/LOG.md +20 −0
@@ -63,3 +63,23 @@ Format per entry: date/time (local, with timezone) · question · experiment ·
63 63 fast NVMe is the substrate where it is most plausible.
64 64 - **Decision:** Proceed to Phase 2 (state-of-the-art map synthesized from notes), then
65 65 Phase 3 gap generation (≥20 ideas). expH (SSD envelope) running concurrently.
66 +
67 +---
68 +
69 +## 2026-08-12 00:30 EDT — expH complete: SSD substrate envelope established
70 +
71 +- **Question:** Can the internal Apple NVMe sustain weight-streaming rates, at which block
72 + sizes, and does Metal GPU load contend with it? (charter §9.H)
73 +- **Experiment:** expH full run, 3 repeats/cell, adaptive ~3 s budgets, iostat ground truth.
74 + Results: `results/expH_ssd_feasibility/20260812T034359Z/`, code at commit `b4a652d`.
75 +- **Result:** Device ceiling ~13.1 GB/s (iostat-validated). Cold random: 67 MB/s @4 KiB QD1;
76 + 11.6 GB/s @256 KiB QD8; 13.8 GB/s @1 MiB QD8. Concurrent saturated MLX matmul costs <5%.
77 + Warm (unified memory) peak 136 GB/s → RAM:SSD ≈ 10:1, far gentler than discrete-GPU stacks.
78 + 4 MiB & threaded-sequential cells cache-contaminated (> iostat ceiling) — flagged invalid.
79 +- **Interpretation:** Storage is NOT the binding constraint: ~650 MB/token of SSD reads is
80 + realistic at interactive rates IF blocks are ≥256 KiB at QD≥4. The binding question moves
81 + to whether ≤650 MB/token of *useful* bytes preserves model behavior (expD/expG).
82 + Methodological: F_NOCACHE does not bypass resident pages; benchmark files must be written
83 + uncached; distrust any number above the concurrent iostat ceiling; 16 KiB pages.
84 +- **Decision:** Prioritize expD (progressive reconstruction) and expG (decision stability)
85 + after Phases 2–4 paperwork. Sequential-read claims embargoed until a >RAM-size-file rerun.
66 86