File size: 5,162 Bytes
acbb72b | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | # Measurements and technical notes
See the [current report](../validation/2026-11-16-five-bucket/REPORT.txt) and
[release validation summary](../validation/2026-11-16-five-bucket/release-validation.json).
| Measurement | Result |
|---|---|
| Rewritten forward vs stock HF FP32, 16 fixtures | Minimum cosine 0.999999999997; max absolute error 2.82e-7 |
| Native Core ML vs fresh stock HF FP32, 16 fixtures | Minimum cosine 0.99992672; max absolute error 0.00221308 |
| Long fixtures | 1151-token document, 1630-token multilingual text, exact 2048 tokens, plus short text padded to 2048 |
| Corpus | 1,499/1,500 FiQA documents; one 2212-token document excluded without truncation |
| Corpus norms | 0.999999893–1.000000097; finite, nonzero 768-dimensional vectors |
| Previous owned output overlap | All 1,491 overlapping outputs exactly unchanged |
| Sequential corpus inference, excluding tokenization | 56.64 documents/s; p50 7.34 ms; p95 35.73 ms |
| Five-function cold / cached load | 164.93 s / 3.95 s; package compilation separately 2.38 s |
| Matched long-input calls, 55 measured | ANE mean 300.24 ms; Metal Q8 mean 435.10 ms; aggregate 1.45× |
| Exact 2048-token median | ANE 299.55 ms; Metal Q8 726.67 ms (2.43×) |
| Exact 1025-token median | Essentially tied: ANE 299.53 ms; Metal Q8 299.22 ms |
The matched benchmark uses identical complete token IDs, two warmup rounds and five measured rounds over 11 inputs. It includes input allocation, prediction and normalized output copying, and excludes tokenization/model loading. Metal uses llama.cpp b11600, yzma 1.30.0, direct `llama_encode`, and Q8_0 weights; ANE uses FP16 weights with FP32 final normalization. These are direct runtime paths with different precision and host APIs, not exact application wrappers. No downstream head projection is applied. The comparison does not show an ANE advantage at every length.
Core ML compute plans report preferred placement and estimated cost, not an
Instruments runtime trace or a guarantee of ANE-only execution on other systems.
`cpuAndNeuralEngine` permits CPU operations; validation checks the transformer
core separately. Fresh stock-HF checks are bounded fixtures. Historical results
are labeled separately. These measure conversion fidelity, not broad retrieval
quality or suitability for every application.
Final FP32 normalization is intentional: the initial all-FP16 output failed a
strict unit-norm gate on one 413-token document. Keeping only the final L2
arithmetic in FP32 fixed it; that document remains a regression fixture.
## Reproduction and limitations
The converter uses Python 3.12.9, Torch 2.7.0, Transformers 5.19.0, Core ML Tools
9.0, NumPy 2.2.6 and safetensors 0.8.0. Full pins, source hashes, fixtures and
instructions are in the [included converter](../conversion/README.md).
This artifact merges the four exports retained from the validated November 12
build with a new s2048 export from November 16. The forward implementation,
source weights and dependency pins are unchanged. Individual conversion
fingerprints are preserved; they are not presented as one identical build.
The final merged package is validated directly. A fresh s2048 rebuild reproduced
identical weight-file bytes and an identical parsed model graph; the historical
s128 rebuild did too. Whole-package byte identity across rebuilds is not claimed:
UUIDs and protobuf map ordering vary.
Adding s2048 increased package size by 16,489,148 bytes (15.73 MiB, 2.96%).
Merely downloading a function does not load it. Applications should load larger
functions on demand and explicitly release idle functions; lazy loading without
eviction eventually retains the full set.
On the measured M2/macOS 27.2.1 run, s2048 alone used about **649 MiB wired neural memory**; s128+s2048 used **932 MiB**; all five recently active functions used **2,031 MiB**. These are separate from ordinary process footprint. Explicitly releasing s2048 removed its wired allocation immediately: zero wired when it was alone, or 283 MiB while s128 remained active. About 592 MiB remained reclaimable after releasing s2048; after releasing both functions, zero was wired and about 874 MiB remained reclaimable. Releasing a function therefore does not imply that every cached page disappears immediately. Older macOS 15 tests required explicit release rather than relying on idle reclaimability.
Disk weight sharing does not eliminate per-function neural allocations. Full-app
8 GiB safety with bucket eviction and llama.cpp fallback, and the exact
specialization-cache invalidation rules, remain unvalidated. First loading can
take minutes. This repository provides the converted model, not a production
memory/fallback implementation.
The model derives from Google DeepMind's Apache-2.0 checkpoint. The fixed-shape
forward adapts Transformers v5.19.0; overflow-safe normalization formulas adapt
the MIT-licensed [QVAC exporter](https://github.com/tetherto/qvac-fabric-llm.cpp/blob/2ed826df0c0eefc7135e9c3acc45aaa277f9b6ff/examples/embedding-coreml/export_coreml.py).
See `NOTICE`, `LICENSE` and `licenses/`. This is an independent conversion, not
an official Google release.
|