docs: refresh measured performance (local retest 2026-08-18)
Browse files
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 |
-
|
| 22 |
-
|
| 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 |
-
|
| 28 |
-
|
| 29 |
-
|
| 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 |
|
| 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
|
| 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
|
| 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 |
-
|
| 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 |
-
|
| 77 |
-
rebuild is the **uncompiled** `.mlpackage` the recipe emits. Compilation
|
| 78 |
-
|
| 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.
|
| 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 |
-
|
|
|
|
| 91 |
|
| 92 |
-
|
| 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 |
-
|
| 98 |
-
|
| 99 |
|
| 100 |
-
|
| 101 |
-
Core ML
|
| 102 |
-
installed copies
|
| 103 |
|
| 104 |
-
##
|
| 105 |
|
| 106 |
| Artifact | Status |
|
| 107 |
|---|---|
|
| 108 |
-
| `3fa12f0bβ¦/encoder.mlmodelc` + `model_config.json` | **SHIP** β
|
| 109 |
-
| `rebuild-verification/2026-08-17/encoder.mlpackage` | **VERIFICATION EVIDENCE, not a runtime artifact
|
| 110 |
|
| 111 |
-
## Verification
|
| 112 |
|
| 113 |
-
|
| 114 |
-
|
| 115 |
|
| 116 |
| File class | Verdict |
|
| 117 |
|---|---|
|
| 118 |
-
| `weights/weight.bin` (308,616,576 B) | **IDENTICAL** β
|
| 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
|
| 122 |
|
| 123 |
-
So the
|
| 124 |
-
|
| 125 |
-
|
|
|
|
| 126 |
|
| 127 |
-
This is
|
| 128 |
-
|
| 129 |
-
|
| 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.
|
| 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.
|