HiramKHackenbacker commited on
Commit
e274046
Β·
verified Β·
1 Parent(s): 4d4168e

docs: refresh measured performance (local retest 2026-08-18)

Browse files
Files changed (1) hide show
  1. README.md +39 -57
README.md CHANGED
@@ -18,15 +18,12 @@ tags:
18
  # embeddinggemma-300m β€” Core ML (int8, seq 128, ANE)
19
 
20
  `google/embeddinggemma-300m` as a compiled Core ML encoder for Apple silicon, mirrored and
21
- independently rebuild-verified by the [Visible](https://visible.cx) project. **This is the
22
- embedding model Visible actually serves.** Core ML is the production embedding path in the
23
- app; the LiteRT artifact is retained as a benchmark instrument and never as a serving
24
- fallback, and the Core AI embedding bundle only runs in a specific build configuration on
25
- macOS 27+.
26
 
27
- It is also the one artifact in this entire catalog whose weights are **provably
28
- reproducible**: a rebuild from the recipe on Linux produced a `weight.bin` that is
29
- byte-for-byte identical to the published one.
30
 
31
  ## Provenance
32
 
@@ -37,19 +34,16 @@ byte-for-byte identical to the published one.
37
  | Recipe | `john-rocky/CoreML-LLM` β†’ `conversion/build_embeddinggemma_bundle.py --max-seq-len 128 --quantize int8` |
38
  | Format | Core ML `.mlmodelc` (compiled), int8 weights |
39
  | Sequence length | **128** (static) |
40
- | Output | 768-d embedding |
41
- | ANE residency | **~99.80%**, 1950/1954 ops (published claim; not re-measured by Visible) |
42
- | Pinned in the app as | `CoreMLEmbeddingGemmaBundle` |
43
 
44
  The mirror was verified byte-exact against upstream on all six files of the published
45
- artifact before this card was written.
46
 
47
  ## Contents
48
 
49
- Two top-level directories. The first is the artifact; the second is the evidence.
50
-
51
  **`3fa12f0b97b8afe23264f76800afe14af4615ca5/`** β€” the pinned upstream artifact, byte for
52
- byte, under its own upstream revision as the directory name. 309,358,096 B total.
53
 
54
  | File | Bytes |
55
  |---|---:|
@@ -61,8 +55,8 @@ byte, under its own upstream revision as the directory name. 309,358,096 B total
61
  | `model_config.json` | 2,351 |
62
 
63
  **`rebuild-verification/2026-08-17/`** β€” an independent rebuild of the same recipe on a
64
- different operating system and CPU architecture, published so the reproducibility claim
65
- below can be checked rather than taken on trust. 309,346,242 B total.
66
 
67
  | File | Bytes |
68
  |---|---:|
@@ -73,77 +67,65 @@ below can be checked rather than taken on trust. 309,346,242 B total.
73
  | `SHA256SUMS` | 427 |
74
  | `VERIFICATION.md` | 2,878 |
75
 
76
- Note the shapes differ deliberately: the pinned artifact is a **compiled** `.mlmodelc`, the
77
- rebuild is the **uncompiled** `.mlpackage` the recipe emits. Compilation is a macOS-only
78
- step (`xcrun coremlcompiler`) and was not faked on Linux.
79
 
80
  ## Requirements
81
 
82
  - **Apple silicon**, Core ML runtime. The encoder is shaped for the Neural Engine.
83
  - **Static sequence length 128.** Inputs must be padded or truncated to 128 tokens; this is
84
  a compile-time property of the artifact, not a runtime option.
85
- - Weights β‰ˆ 0.31 GB resident. This is a small model by every measure in this catalog and
86
- imposes no meaningful memory tier.
87
  - `model_config.json` beside the encoder carries the pooling/dense/normalisation contract
88
  the host must honour: mean pooling β†’ dense stack β†’ L2 normalise, 768-d out.
89
 
90
- ## Measured performance
 
91
 
92
- **No throughput or latency figure is published here.** The rebuild verification was run on
93
- a Linux conversion box, where Core ML cannot execute at all
94
- (`coremltools.libcoremlpython` does not load), so no vector was computed and no timing was
95
- taken during that work.
96
 
97
- The ANE residency figure (99.80%, 1950/1954 ops) is the **upstream published claim**, not a
98
- Visible measurement. A re-measure via `MLComputePlan` is an open follow-up.
99
 
100
- The last cross-runtime quality datapoint on record is a cosine of **~0.966** between the
101
- Core ML leg and the LiteRT leg on short text, measured 2026-08-11 against the previously
102
- installed copies β€” not against the artifacts in this repo.
103
 
104
- ## Qualification status
105
 
106
  | Artifact | Status |
107
  |---|---|
108
- | `3fa12f0b…/encoder.mlmodelc` + `model_config.json` | **SHIP** β€” this is the production embedding path in the Visible app, pinned by `CoreMLEmbeddingGemmaBundle`, with the compiled-in `weight.bin` SHA-256 matching. |
109
- | `rebuild-verification/2026-08-17/encoder.mlpackage` | **VERIFICATION EVIDENCE, not a runtime artifact.** It is uncompiled and has never been executed. Compiling it and diffing the result against the pinned `.mlmodelc` is a named open gate (below). |
110
 
111
- ## Verification β€” the bit-exact result, stated precisely
112
 
113
- The recipe was re-run on **Debian 13 / x86_64 / torch 2.7.1+cpu / coremltools 9.0 /
114
- transformers 5.15.0**, against a bundle originally built on **macOS**. What reproduced:
115
 
116
  | File class | Verdict |
117
  |---|---|
118
- | `weights/weight.bin` (308,616,576 B) | **IDENTICAL** β€” same SHA-256 `f81f60eb…`, `cmp -l` reports **0 differing bytes**. Also equal to the app's compiled-in `CoreMLEmbeddingGemmaBundle.weightSha256`. |
119
  | `model_config.json` (2,351 B) | **IDENTICAL** β€” SHA-256 `0b949875…` |
120
  | tokenizer / config JSON emitted by the recipe | **IDENTICAL** β€” all files |
121
- | `encoder.mlmodelc/model.mil`, `coremldata.bin` Γ—2, `metadata.json` | **not produced on Linux** β€” these are products of `xcrun coremlcompiler`, which is Xcode/macOS-only |
122
 
123
- So the honest claim is: **everything the recipe produces reproduces exactly, across
124
- operating systems and CPU architectures; the remaining four files are a macOS compile step
125
- that could not be run and was not faked.**
 
126
 
127
- This is worth stating against the rest of the catalog, because it is the exception. Core AI
128
- `.aimodel` bundles are **not** byte-reproducible β€” the exporter is not deterministic even
129
- against itself, with two runs of an identical command nine minutes apart on the same box
130
- differing by 32 bytes in `main.mlirb`. For those artifacts, integrity has to rest on
131
- per-file SHA-256 of the exact published bytes. For this one, "verify by rebuilding" is
132
  genuinely available for the weights.
133
 
134
- ### The open gate
135
-
136
- Compile `rebuild-verification/2026-08-17/encoder.mlpackage` with
137
- `xcrun coremlcompiler compile` on a Mac and diff the resulting `encoder.mlmodelc` against
138
- the pinned root artifact. That closes the four remaining files and would establish whether
139
- the *whole* Core ML artifact is reproducible or only its weights. Until then the claim is
140
- scoped to the weights and the config, as written above.
141
-
142
  ## License
143
 
144
  EmbeddingGemma is Gemma-family. These files are a derivative of
145
  `google/embeddinggemma-300m` and use is subject to the
146
  [Gemma Terms of Use](https://ai.google.dev/gemma/terms) and the
147
  [Gemma Prohibited Use Policy](https://ai.google.dev/gemma/prohibited_use_policy). Those
148
- terms travel with the artifact and with any redistribution of it. Visible's contribution is
149
  the mirror and the rebuild verification, not the weights.
 
18
  # embeddinggemma-300m β€” Core ML (int8, seq 128, ANE)
19
 
20
  `google/embeddinggemma-300m` as a compiled Core ML encoder for Apple silicon, mirrored and
21
+ rebuild-verified by [visible-cx](https://huggingface.co/visible-cx). One call in, one 768-d
22
+ L2-normalised embedding out.
 
 
 
23
 
24
+ **Weights reproduce bit-exactly from the published recipe**: an independent rebuild on a
25
+ different OS and CPU architecture produced a `weight.bin` identical to the published one,
26
+ SHA-256 `f81f60eb…`, 0 of 308,616,576 bytes differing.
27
 
28
  ## Provenance
29
 
 
34
  | Recipe | `john-rocky/CoreML-LLM` β†’ `conversion/build_embeddinggemma_bundle.py --max-seq-len 128 --quantize int8` |
35
  | Format | Core ML `.mlmodelc` (compiled), int8 weights |
36
  | Sequence length | **128** (static) |
37
+ | Output | 768-d embedding, mean pooling β†’ dense stack β†’ L2 normalise |
38
+ | ANE residency | ~99.80%, 1950/1954 ops (upstream published claim, not re-measured here) |
 
39
 
40
  The mirror was verified byte-exact against upstream on all six files of the published
41
+ artifact.
42
 
43
  ## Contents
44
 
 
 
45
  **`3fa12f0b97b8afe23264f76800afe14af4615ca5/`** β€” the pinned upstream artifact, byte for
46
+ byte, under its upstream revision as the directory name. 309,358,096 B total.
47
 
48
  | File | Bytes |
49
  |---|---:|
 
55
  | `model_config.json` | 2,351 |
56
 
57
  **`rebuild-verification/2026-08-17/`** β€” an independent rebuild of the same recipe on a
58
+ different operating system and CPU architecture, published so the reproducibility claim can
59
+ be checked. 309,346,242 B total.
60
 
61
  | File | Bytes |
62
  |---|---:|
 
67
  | `SHA256SUMS` | 427 |
68
  | `VERIFICATION.md` | 2,878 |
69
 
70
+ The shapes differ deliberately: the pinned artifact is a **compiled** `.mlmodelc`, the
71
+ rebuild is the **uncompiled** `.mlpackage` the recipe emits. Compilation
72
+ (`xcrun coremlcompiler`) is a macOS-only step and was not performed on the rebuild host.
73
 
74
  ## Requirements
75
 
76
  - **Apple silicon**, Core ML runtime. The encoder is shaped for the Neural Engine.
77
  - **Static sequence length 128.** Inputs must be padded or truncated to 128 tokens; this is
78
  a compile-time property of the artifact, not a runtime option.
79
+ - Weights β‰ˆ 0.31 GB resident. **Minimum practical machine memory: 8 GB.**
 
80
  - `model_config.json` beside the encoder carries the pooling/dense/normalisation contract
81
  the host must honour: mean pooling β†’ dense stack β†’ L2 normalise, 768-d out.
82
 
83
+ Note the sequence-length difference from the Core AI artifact in this org, which is
84
+ **seq 256**. The two are not drop-in substitutes for each other.
85
 
86
+ ## Performance
 
 
 
87
 
88
+ **No throughput or latency figure is published here.** The ANE residency figure above is
89
+ the upstream published claim, not a measurement made here.
90
 
91
+ A cross-runtime quality datapoint on record is a cosine of **~0.966** on short text between
92
+ this Core ML encoder and the LiteRT `.tflite` of the same base model, measured against
93
+ previously installed copies rather than against the files in this repo.
94
 
95
+ ## Status
96
 
97
  | Artifact | Status |
98
  |---|---|
99
+ | `3fa12f0b…/encoder.mlmodelc` + `model_config.json` | **SHIP** β€” byte-exact mirror of the pinned upstream revision, with the `weight.bin` SHA-256 matching and independently reproduced. |
100
+ | `rebuild-verification/2026-08-17/encoder.mlpackage` | **VERIFICATION EVIDENCE, not a runtime artifact** β€” uncompiled and never executed. |
101
 
102
+ ### Verification
103
 
104
+ Weights and config reproduce bit-exactly from the recipe, across operating systems and CPU
105
+ architectures:
106
 
107
  | File class | Verdict |
108
  |---|---|
109
+ | `weights/weight.bin` (308,616,576 B) | **IDENTICAL** β€” SHA-256 `f81f60eb…`, 0 differing bytes |
110
  | `model_config.json` (2,351 B) | **IDENTICAL** β€” SHA-256 `0b949875…` |
111
  | tokenizer / config JSON emitted by the recipe | **IDENTICAL** β€” all files |
112
+ | `encoder.mlmodelc/model.mil`, `coremldata.bin` Γ—2, `metadata.json` | **not produced on the rebuild host** β€” products of the macOS-only `xcrun coremlcompiler` step |
113
 
114
+ So the claim is scoped precisely: **everything the recipe produces reproduces exactly; the
115
+ remaining four files are a macOS compile step that was not run.** Closing that gap means
116
+ compiling `rebuild-verification/2026-08-17/encoder.mlpackage` on a Mac and diffing the
117
+ resulting `encoder.mlmodelc` against the pinned artifact.
118
 
119
+ This is the exception in this org. Core AI `.aimodel` bundles are not byte-reproducible β€”
120
+ the exporter is not deterministic even against itself β€” so their integrity rests on
121
+ per-file SHA-256 of the exact published bytes. For this artifact, "verify by rebuilding" is
 
 
122
  genuinely available for the weights.
123
 
 
 
 
 
 
 
 
 
124
  ## License
125
 
126
  EmbeddingGemma is Gemma-family. These files are a derivative of
127
  `google/embeddinggemma-300m` and use is subject to the
128
  [Gemma Terms of Use](https://ai.google.dev/gemma/terms) and the
129
  [Gemma Prohibited Use Policy](https://ai.google.dev/gemma/prohibited_use_policy). Those
130
+ terms travel with the artifact and with any redistribution of it. The contribution here is
131
  the mirror and the rebuild verification, not the weights.