junmo-k commited on
Commit
3c9b6f2
·
verified ·
1 Parent(s): dc15887

ANEEmbed model package 0.1.0: EmbeddingGemma 2 for the Apple Neural Engine

Browse files
.gitattributes CHANGED
@@ -33,3 +33,6 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ embeddings.bf16 filter=lfs diff=lfs merge=lfs -text
37
+ position_embeddings.f16 filter=lfs diff=lfs merge=lfs -text
38
+ tokenizer.json filter=lfs diff=lfs merge=lfs -text
EmbeddingGemma2Text.mlpackage/Data/com.apple.CoreML/model.mlmodel ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2cfdd356adcef722503953fd65a8d9d9e765097d44f8d05fa6c11a09ba4d8e2a
3
+ size 7450049
EmbeddingGemma2Text.mlpackage/Data/com.apple.CoreML/weights/weight.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1536afc085e87791325b8165bd3c9ef6886d10862fe9c19c3d5058415688066f
3
+ size 312196800
EmbeddingGemma2Text.mlpackage/Manifest.json ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "fileFormatVersion": "1.0.0",
3
+ "itemInfoEntries": {
4
+ "32713A3E-6189-4C25-8427-C85C5CCF9C0A": {
5
+ "author": "com.apple.CoreML",
6
+ "description": "CoreML Model Specification",
7
+ "name": "model.mlmodel",
8
+ "path": "com.apple.CoreML/model.mlmodel"
9
+ },
10
+ "7987571B-099B-4753-B221-DD34A9AF9928": {
11
+ "author": "com.apple.CoreML",
12
+ "description": "CoreML Model Weights",
13
+ "name": "weights",
14
+ "path": "com.apple.CoreML/weights"
15
+ }
16
+ },
17
+ "rootModelIdentifier": "32713A3E-6189-4C25-8427-C85C5CCF9C0A"
18
+ }
EmbeddingGemma2Vision.mlpackage/Data/com.apple.CoreML/model.mlmodel ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0085b5e04a13d000fe5969adeaa13d897f5a3cb7be60c76c8685c023747f89ef
3
+ size 2053174
EmbeddingGemma2Vision.mlpackage/Data/com.apple.CoreML/weights/weight.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5b5b6dd8d80aa438bf91ba143fbe90d56a2e25bfcf685a56b990aad71cf75232
3
+ size 304078400
EmbeddingGemma2Vision.mlpackage/Manifest.json ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "fileFormatVersion": "1.0.0",
3
+ "itemInfoEntries": {
4
+ "3384970F-23B1-4A78-86B7-B8602D572C97": {
5
+ "author": "com.apple.CoreML",
6
+ "description": "CoreML Model Weights",
7
+ "name": "weights",
8
+ "path": "com.apple.CoreML/weights"
9
+ },
10
+ "5D7ED9C5-95C5-45EC-A0E2-0599BE72866F": {
11
+ "author": "com.apple.CoreML",
12
+ "description": "CoreML Model Specification",
13
+ "name": "model.mlmodel",
14
+ "path": "com.apple.CoreML/model.mlmodel"
15
+ }
16
+ },
17
+ "rootModelIdentifier": "5D7ED9C5-95C5-45EC-A0E2-0599BE72866F"
18
+ }
LICENSE ADDED
@@ -0,0 +1,201 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
NOTICE ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ EmbeddingGemma 2 for the Apple Neural Engine (ANEEmbed model package)
2
+
3
+ This package contains a Core ML conversion of google/embeddinggemma-2
4
+ (https://huggingface.co/google/embeddinggemma-2), Copyright Google LLC / Google DeepMind,
5
+ licensed under the Apache License, Version 2.0. Use of the model must also follow the
6
+ Gemma Prohibited Use Policy (https://ai.google.dev/gemma/prohibited_use_policy).
7
+
8
+ Files and their origin:
9
+ EmbeddingGemma2Text.mlpackage / .mlmodelc converted by tools/convert/build.py from the original
10
+ model.safetensors (weights stored as fp16)
11
+ embeddings.bf16 token embedding table extracted unchanged (bf16) from
12
+ the original model.safetensors
13
+ tokenizer.json the original tokenizer, unchanged
14
+ EmbeddingGemma2Vision.mlpackage / .mlmodelc the vision encoder conversion by FluidInference
15
+ position_embeddings.f16 (https://huggingface.co/FluidInference/embeddinggemma-2-coreml,
16
+ Apache-2.0), copied unchanged
17
+
18
+ Modifications relative to the original model: re-expression of the text encoder as Core ML functions
19
+ (fixed-length buckets, per-layer long-context functions), fp16 weights and activations, numerically
20
+ neutral rewrites listed in the model card. No weights were retrained or altered beyond fp16 rounding.
README.md ADDED
@@ -0,0 +1,221 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ base_model: google/embeddinggemma-2
4
+ library_name: coreml
5
+ pipeline_tag: feature-extraction
6
+ language:
7
+ - multilingual
8
+ tags:
9
+ - coreml
10
+ - apple-neural-engine
11
+ - on-device
12
+ - embeddings
13
+ - sentence-similarity
14
+ - multimodal-embedding
15
+ - gemma
16
+ ---
17
+
18
+ # EmbeddingGemma 2 for the Apple Neural Engine (text up to 8192 tokens + images)
19
+
20
+ Core ML conversion of [google/embeddinggemma-2](https://huggingface.co/google/embeddinggemma-2) that runs
21
+ **entirely on the Apple Neural Engine** (`MLComputeUnits.cpuAndNeuralEngine`, no GPU). It is the model package of
22
+ [ANEEmbed](https://github.com/junmo-kim/ANEEmbed) (an open-source Swift embedding server and CLI:
23
+ `aneembed models install` downloads this repository at a pinned revision, checks every file against
24
+ `manifest.json` and compiles it on your Mac), but it is a plain Core ML package and can be used from any Core ML
25
+ client that follows the host contract below and in `manifest.json`.
26
+
27
+ Output: the same 768-d L2-normalized embedding as
28
+ `SentenceTransformer("google/embeddinggemma-2").encode(...)` (mean pooling over all tokens, then normalization), at
29
+ cosine ≥ 0.99988 for text up to 8192 tokens and ≥ 0.99976 for images in our tests (details below). Matryoshka
30
+ truncation (512/256/128) works as in the original: keep the first d values and re-normalize.
31
+
32
+ ## Files
33
+
34
+ | File | Size | What |
35
+ |---|---|---|
36
+ | `EmbeddingGemma2Text.mlpackage` | 305 MB | text encoder, fp16 ML Program, **34 functions sharing one copy of the weights**: 6 bucket functions `embed_64 … embed_2048`, 20 sliding-layer functions `long_swa_l{i}`, 8 global-layer functions `long{4096,8192}_glb_l{5,11,17}` / `long{4096,8192}_head` |
37
+ | `embeddings.bf16` | 256 MB | token embedding table, 262,144 × 512 raw bfloat16 (little endian), unchanged from the original weights; row × √512 = model input |
38
+ | `tokenizer.json` | 31 MB | original tokenizer, unchanged |
39
+ | `EmbeddingGemma2Vision.mlpackage` | 292 MB | vision encoder `vision_70` / `vision_140` / `vision_280`, **unchanged** from [FluidInference/embeddinggemma-2-coreml](https://huggingface.co/FluidInference/embeddinggemma-2-coreml) @ `3f978dd` |
40
+ | `position_embeddings.f16` | 3 MB | vision x/y position tables (same source, unchanged) |
41
+ | `manifest.json` | | every file with sha256 and size (including the reference `.mlmodelc` compile), exact function signatures, host contract, token ids, provenance |
42
+ | `selftest.json` + `selftest.bin` | 1.8 MB | golden self-test (37 tests, one per function) to run at load time |
43
+ | `LICENSE`, `NOTICE` | | Apache-2.0, attribution |
44
+
45
+ Only the `.mlpackage` files are published; compile them on the Mac that runs them (`xcrun coremlcompiler compile
46
+ X.mlpackage .` or `MLModel.compileModel(at:)`, about 3 s; ANEEmbed does this at install). The compile is
47
+ deterministic: `manifest.json` lists the `.mlmodelc` files of the reference compile, and the same Core ML compiler
48
+ reproduces them byte for byte (another compiler version only changes the version stamp in `model.mil`).
49
+
50
+ Without the weight sharing the same 34 functions are 2.05 GB as separate packages; merged they are 305 MB. A
51
+ sliding-layer function adds about 3 MB to the merged package (its RoPE tables and graph) instead of its 14 MB of
52
+ weights.
53
+
54
+ ## How it was produced
55
+
56
+ `tools/convert/build.py` (in the ANEEmbed repository, pinned `requirements.txt`) converts the original
57
+ `model.safetensors` (revision `f9972ac22e696a105c482202646979e33e4b5a1e`, sha256 checked) with coremltools 9.0 to
58
+ fp16 ML Programs (minimum macOS 15), merges them into one multifunction package (identical weights are stored
59
+ once), compiles it with `coremlcompiler`, extracts `embeddings.bf16`, copies the vision package unchanged (sha256
60
+ checked against the published files), generates the self-test from fp32 references and writes the manifest. A clean
61
+ rebuild reproduces the weights, the compiled `model.mil`, the token table and the self-test byte for byte (the
62
+ `.mlpackage` protobuf is message-equal; its byte order and the package UUIDs differ between runs).
63
+
64
+ The text encoder is re-expressed with numerically neutral rewrites that the ANE needs:
65
+
66
+ - RMSNorm divides each row by its max-abs value first (fp16 overflow guard).
67
+ - **Attention uses a "fold" layout**: the query heads that share one K/V head are folded into the row dimension.
68
+ The usual `repeat_interleave` layout is *miscompiled* by the ANE compiler for the global layers (one K/V head)
69
+ at long sequence lengths: query heads 1–3 come back as zeros (cos 0.55 for a whole layer).
70
+ - Masks are runtime inputs and RoPE uses constant tables at absolute positions. Graph-constant masks and a runtime
71
+ positions/RoPE input both produced wrong results on the ANE in our tests.
72
+ - The per-layer-embedding projection is computed per layer from a slice of its weight, so every function carries
73
+ bit-identical weight constants and the merge can share them.
74
+
75
+ ## Using it (host contract)
76
+
77
+ All functions run with `cpuAndNeuralEngine`. Inputs are fp16, embeddings are fp32. Token rows are
78
+ `bf16 → fp32 × √512 → fp16` from `embeddings.bf16`. Text sequences are `[2] + tokenize(prompt + text) + [1]`
79
+ (bos 2, eos 1; prompts as in the original, e.g. `title: none | text: `, `task: search result | query: `).
80
+
81
+ **Up to 2048 tokens: buckets.** Pack one or more sequences back to back into the smallest `embed_S`
82
+ (S ∈ 64/128/256/512/1024/2048, up to K = max(8, S/32) sequences per call):
83
+ `inputs_embeds [1,S,512]`; `global_bias [1,1,S,S]` = 0 where row and column belong to the same sequence (or i = j),
84
+ else −10000; `local_bias` = the same AND |i−j| ≤ 512; `pool [K,S]` = 1/n_k over the rows of sequence k →
85
+ `embedding [K,768]` (unused rows are 0).
86
+
87
+ **2049 to 8192 tokens: long path.** S = 4096 if n ≤ 4096, else 8192. With `x0` the padded token rows:
88
+ for each of the 24 layers in order, sliding layers call `long_swa_l{i}` once per 1024-row chunk that contains
89
+ valid rows (input: the chunk plus 512 rows of halo on each side, zero padded; a `[1,1,1024,2048]` band/validity
90
+ bias built once per document), global layers 5/11/17 call `long{S}_glb_l{i}` on the whole sequence, and layer 23
91
+ is `long{S}_head`, which also applies the final norm, mean pooling, projection and L2 normalization. **The head's
92
+ `pool` weight must be 2⁻¹⁰ on valid rows, not 1/n** (1/n underflows fp16 inside the ANE pooling: cos 0.9996
93
+ instead of 0.9999 at n = 8192; the scale cancels in the normalization). That is 20·⌈n/1024⌉ + 4 calls. The exact
94
+ contract (shapes, biases, call order) is in `manifest.json` → `long_path`.
95
+
96
+ **Images.** Preprocess exactly like the HF `Gemma4ImageProcessor` (aspect-preserving bicubic resize to multiples of
97
+ 48 px within 9 × budget patches, pixels / 255, 16 × 16 patches), run `vision_{70,140,280}` (positions, position
98
+ embeddings from `position_embeddings.f16`, validity and 3 × 3 pooling matrix as in `manifest.json` → `vision`),
99
+ then embed `<bos> <|image> [image tokens] <image|> <eos>` with the bucket functions like a text sequence; images
100
+ and texts can share one bucket call.
101
+
102
+ ## Accuracy
103
+
104
+ Cosine similarity against the **official** model: google/embeddinggemma-2 in fp32 (our PyTorch reference equals the official transformers / sentence-transformers fp32 stack at
105
+ cosine 1.0000000 for texts of 18 to 8192 tokens), all functions on `cpuAndNeuralEngine`, Apple M5 Ultra.
106
+ Public data only: multilingual READMEs (en/ko/ja/zh/fr) of an Apache-2.0 project, the Korean and Japanese
107
+ constitutions (public domain), MIT-licensed technical docs and Apache-2.0 source code; images bundled with
108
+ scikit-learn / networkx / llama.cpp / stable-diffusion.cpp plus synthetic images.
109
+
110
+ | Category | n | min | median |
111
+ |---|---:|---:|---:|
112
+ | Text, single sequence filling the bucket (64–2048) | 36 | 0.999966 | 0.999976 |
113
+ | Text, single sequence half the bucket | 36 | 0.999950 | 0.999976 |
114
+ | Text, packed short sequences (6–200 tokens, up to K per call) | 152 | 0.999951 | 0.999973 |
115
+ | Text, one long + several short in one call (1024/2048) | 12 | 0.999961 | 0.999977 |
116
+ | Text, two long in one call (1024/2048) | 4 | 0.999975 | 0.999975 |
117
+ | **All bucket text** | **240** | **0.999950** | **0.999974** |
118
+ | Long path, 2049–4096 tokens | 14 | 0.999954 | 0.999972 |
119
+ | Long path, 4097–8192 tokens | 17 | 0.999888 | 0.999943 |
120
+ | Image, budget 70, alone (vs official fp32 image embedding) | 13 | 0.999768 | 0.999972 |
121
+ | Image, budget 140, alone | 13 | 0.999813 | 0.999975 |
122
+ | Image, budget 280, alone | 13 | 0.999954 | 0.999979 |
123
+ | Images packed with other images and a text (1024 / 2048) | 91 | 0.999769 | 0.999975 |
124
+
125
+ The image error comes almost entirely from the fp16 vision encoder: feeding the official fp32 image tokens through the
126
+ same ANE text functions gives ≥ 0.999981. The vision package was published for the GPU; on the ANE its image
127
+ tokens match official fp32 at cos ≥ 0.99914 per image (median 0.99985–0.99990).
128
+
129
+ ## Speed and memory (Apple M5 Ultra, macOS 27.0.1)
130
+
131
+ Warm median of 20 calls, `cpuAndNeuralEngine`, Swift (`MLModel.prediction`), inputs prebuilt. Another ANE
132
+ embedding service was running on the same machine during the measurements; p90 stayed within 1% of the median.
133
+
134
+ | Function | Latency |
135
+ |---|---:|
136
+ | `embed_64` | 3.19 ms |
137
+ | `embed_128` | 5.18 ms |
138
+ | `embed_256` | 10.63 ms |
139
+ | `embed_512` | 26.12 ms |
140
+ | `embed_1024` | 67.89 ms |
141
+ | `embed_2048` | 189.09 ms |
142
+ | `long_swa_l{i}` (one 1024-row chunk) | 4.49–4.61 ms |
143
+ | `long4096_glb_l{i}` / `long4096_head` | 36.2 / 36.4 ms |
144
+ | `long8192_glb_l{i}` / `long8192_head` | 151.8 / 152.4 ms |
145
+ | `vision_70` / `vision_140` / `vision_280` | 36.3 / 99.5 / 330.8 ms |
146
+
147
+ Long path end to end (Python reference orchestrator, warm median of 20; the Python/coremltools wrapper adds about
148
+ 1.3 ms per call, so a native runtime should approach the "sum of functions" column):
149
+
150
+ | Tokens | Calls | Python wall | Sum of function latencies |
151
+ |---:|---:|---:|---:|
152
+ | 2049–3072 | 64 | 510 ms | ≈ 418 ms |
153
+ | 4096 | 84 | 630 ms | ≈ 509 ms |
154
+ | 6144 | 124 | 1353 ms | ≈ 1154 ms |
155
+ | 8192 | 164 | 1582 ms | ≈ 1336 ms |
156
+
157
+ Load (first load of a model path triggers the ANE compiler; the OS caches the result per path):
158
+
159
+ | | Cold (compile) | Cached |
160
+ |---|---:|---:|
161
+ | `embed_64 … embed_2048` | 8.6 / 9.0 / 10.3 / 13.1 / 17.6 / 28.2 s (87 s) | 0.38–0.41 s each (2.3 s) |
162
+ | 20 × `long_swa_l{i}` | 2.4 s each (47 s) | 0.38 s each (7.6 s) |
163
+ | 4 × `long4096_*` / 4 × `long8192_*` | 3.6 s / 10.0 s each (14 s / 40 s) | 0.38 s each |
164
+ | all 34 text functions | 188 s | 12.9 s |
165
+ | `vision_70 / 140 / 280` | 8.1 / 10.8 / 15.4 s | 0.11–0.18 s |
166
+
167
+ Process footprint (`phys_footprint`) with functions loaded: buckets only 95 MB; all 34 text functions 690 MB
168
+ (each loaded long-path function adds 10–55 MB); vision 47–55 MB. Load only the functions up to the length you
169
+ serve.
170
+
171
+ ### End to end in ANEEmbed (Swift, over its HTTP router)
172
+
173
+ `aneembed bench`, warm median, texts of exactly N tokens with the document prompt; memory is the process
174
+ footprint after 150 s idle (the Neural Engine's own memory is not part of it).
175
+
176
+ | | Apple M4 | Apple M5 Ultra |
177
+ |---|---:|---:|
178
+ | 32 / 512 / 2048 tokens | 5.1 / 32 / 250 ms | 3.2 / 27 / 194 ms |
179
+ | 4096 / 8192 tokens (long path) | 674 / 1749 ms | 531 / 1388 ms |
180
+ | one image (266 soft tokens) | 489 ms | 383 ms |
181
+ | first install, compile included: buckets + vision / + long path | 150 s / + 134 s | 138 s / + 113 s |
182
+ | start with the compile cached, self-test included: 2048 / 8192 | 4.5 s / 27 s | 3.7 s / 21 s |
183
+ | footprint: 2048 / 8192 | 161 / 529 MB | 174 / 563 MB |
184
+
185
+ Accuracy through the ANEEmbed binary over HTTP against HF `transformers` fp32 (CPU) on the public data described
186
+ above, Apple M4: text 37–2048 tokens one per request min 0.999945 (n 72), packed requests of 14–40 short texts
187
+ min 0.999946 (n 200), 2049–4096 tokens min 0.999966 (n 8), 4097–8192 tokens min 0.999899 (n 10), images at the
188
+ official 280-token budget min 0.999954 (n 26).
189
+
190
+ ## Self-test (run it at load)
191
+
192
+ The ANE compiler output depends on the OS version, and a miscompile does not raise an error, it returns wrong
193
+ numbers. `selftest.json` / `selftest.bin` contain one deterministic test per function (37 tests): inputs are
194
+ built from token ids stored in the JSON (from this package's `LICENSE` text) and the shipped tables, or from a
195
+ procedural integer image pattern; expected fp32 outputs come from the fp32 reference (official fp32 for the vision
196
+ tests). Bucket and head tests compare embeddings by cosine; layer and vision tests compare an 8-column random
197
+ projection (digest) of the layer update / image tokens by cosine and relative error. Recommended tolerance:
198
+ cosine ≥ 0.999 everywhere, relative error ≤ 0.05; measured on M5 Ultra: cosine ≥ 0.99996 (text), ≥ 0.99990
199
+ (vision), relative error ≤ 0.006 (text layers), ≤ 0.015 (vision). A layer built with the miscompiling repeat
200
+ layout scores cosine 0.55 / relative error 1.0 on the ANE (and passes on the CPU), so the test separates the two
201
+ cleanly. Run the tests for the functions you load after loading them (about 1.6 s of ANE time for all 37) and
202
+ refuse to serve on failure ("about 1.6 s" is the sum of the function latencies above). Reference runner: `tools/convert/selftest.py run <dir>`.
203
+
204
+ ## Limitations
205
+
206
+ - Apple Neural Engine only. The package was tuned and verified with `cpuAndNeuralEngine`; other compute units are
207
+ not tested.
208
+ - Text longer than 8192 tokens must be split by the caller. Images use the HF preprocessing; llama.cpp's image
209
+ preprocessing differs, so image embeddings are not interchangeable with llama.cpp GGUF ones.
210
+ - Audio and video are not included in this package.
211
+ - First load per model path compiles for the ANE (about 3 minutes for all text functions on M5 Ultra); move the
212
+ directory, update macOS or run it from another executable and it compiles again (the OS caches the compile per
213
+ model path, OS build and executable).
214
+
215
+ ## License and attribution
216
+
217
+ Apache-2.0, see `LICENSE` and `NOTICE`. Original model: EmbeddingGemma 2 by Google DeepMind
218
+ ([google/embeddinggemma-2](https://huggingface.co/google/embeddinggemma-2)); use must also follow the
219
+ [Gemma Prohibited Use Policy](https://ai.google.dev/gemma/prohibited_use_policy). Vision encoder conversion and
220
+ position tables: [FluidInference/embeddinggemma-2-coreml](https://huggingface.co/FluidInference/embeddinggemma-2-coreml)
221
+ (Apache-2.0), unchanged.
embeddings.bf16 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:56ebbdbfd706c827f3fae1d97aa39135c7ddc0f1e6d9b12f8565f84bbfbda877
3
+ size 268435456
manifest.json ADDED
@@ -0,0 +1,2077 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "embeddinggemma-2-ane",
3
+ "manifest_version": 1,
4
+ "created": "2026-11-14",
5
+ "source_model": {
6
+ "id": "google/embeddinggemma-2",
7
+ "revision": "f9972ac22e696a105c482202646979e33e4b5a1e",
8
+ "license": "Apache-2.0",
9
+ "model.safetensors_sha256": "197a32965d4b1105faf060417baa899e193fb73cd401f42ec9295234d5553d79",
10
+ "use_policy": "https://ai.google.dev/gemma/prohibited_use_policy",
11
+ "attribution": "EmbeddingGemma 2 by Google DeepMind"
12
+ },
13
+ "vision_source": {
14
+ "id": "FluidInference/embeddinggemma-2-coreml",
15
+ "revision": "3f978ddf92cac9aa07eb2dcf6eb36cf450f3dba4",
16
+ "license": "Apache-2.0",
17
+ "note": "EmbeddingGemma2Vision.mlpackage and position_embeddings.f16 copied unchanged (sha256 equal to the HF LFS objects at this revision)"
18
+ },
19
+ "converter": {
20
+ "script": "tools/convert/build.py",
21
+ "python_packages": {
22
+ "coremltools": "9.0",
23
+ "torch": "2.7.1",
24
+ "numpy": "2.5.4",
25
+ "safetensors": "0.8.0",
26
+ "tokenizers": "0.23.3",
27
+ "transformers": "5.22.2",
28
+ "sentence-transformers": "6.3.0",
29
+ "pillow": "13.0.0",
30
+ "torchvision": "0.22.1"
31
+ },
32
+ "precision": "fp16 ML Program (compute_precision FLOAT16), minimum macOS 15",
33
+ "compute_units": "cpuAndNeuralEngine (the package is tuned and verified for the ANE only)"
34
+ },
35
+ "license": "Apache-2.0 (LICENSE, NOTICE)",
36
+ "embedding": {
37
+ "dim": 768,
38
+ "normalized": "L2, in graph",
39
+ "matryoshka_dims": [
40
+ 768,
41
+ 512,
42
+ 256,
43
+ 128
44
+ ],
45
+ "matryoshka": "keep the first d values, then L2-normalize again (host)"
46
+ },
47
+ "special_tokens": {
48
+ "pad": 0,
49
+ "eos": 1,
50
+ "bos": 2,
51
+ "image_start (<|image>)": 255999,
52
+ "image_end (<image|>)": 258882,
53
+ "image_placeholder (<|image|>, HF only)": 258880,
54
+ "audio_start": 256000,
55
+ "audio_end": 258883
56
+ },
57
+ "text_sequence": "[bos] + tokenizer.encode(prompt + text, add_special_tokens=False) + [eos]",
58
+ "prompts": {
59
+ "BitextMining": "task: search result | query: ",
60
+ "Classification": "task: classification | query: ",
61
+ "Clustering": "task: clustering | query: ",
62
+ "CodeRetrieval": "task: code retrieval | query: ",
63
+ "Document": "title: none | text: ",
64
+ "FactChecking": "task: fact checking | query: ",
65
+ "InstructionRetrieval": "task: code retrieval | query: ",
66
+ "MultilabelClassification": "task: classification | query: ",
67
+ "PairClassification": "task: sentence similarity | query: ",
68
+ "QuestionAnswering": "task: question answering | query: ",
69
+ "Reranking": "task: search result | query: ",
70
+ "Retrieval": "task: search result | query: ",
71
+ "Retrieval-document": "title: none | text: ",
72
+ "Retrieval-query": "task: search result | query: ",
73
+ "STS": "task: sentence similarity | query: ",
74
+ "SearchQuery": "task: search result | query: ",
75
+ "SentenceSimilarity": "task: sentence similarity | query: ",
76
+ "Summarization": "task: sentence similarity | query: ",
77
+ "document": "title: none | text: ",
78
+ "query": "task: search result | query: "
79
+ },
80
+ "token_table": {
81
+ "file": "embeddings.bf16",
82
+ "dtype": "bfloat16",
83
+ "byte_order": "little",
84
+ "shape": [
85
+ 262144,
86
+ 512
87
+ ],
88
+ "row_to_input": "fp32(bf16 row) * sqrt(512) (= 22.627417), then cast to fp16",
89
+ "sha256_equals": "FluidInference/embeddinggemma-2-coreml embeddings.bf16 (same bytes)"
90
+ },
91
+ "packages": {
92
+ "EmbeddingGemma2Text": {
93
+ "mlpackage": "EmbeddingGemma2Text.mlpackage",
94
+ "mlmodelc": "EmbeddingGemma2Text.mlmodelc",
95
+ "compute_units": "cpuAndNeuralEngine",
96
+ "functions": {
97
+ "embed_64": {
98
+ "inputs": [
99
+ {
100
+ "name": "inputs_embeds",
101
+ "shape": [
102
+ 1,
103
+ 64,
104
+ 512
105
+ ],
106
+ "dtype": "float16"
107
+ },
108
+ {
109
+ "name": "global_bias",
110
+ "shape": [
111
+ 1,
112
+ 1,
113
+ 64,
114
+ 64
115
+ ],
116
+ "dtype": "float16"
117
+ },
118
+ {
119
+ "name": "local_bias",
120
+ "shape": [
121
+ 1,
122
+ 1,
123
+ 64,
124
+ 64
125
+ ],
126
+ "dtype": "float16"
127
+ },
128
+ {
129
+ "name": "pool",
130
+ "shape": [
131
+ 8,
132
+ 64
133
+ ],
134
+ "dtype": "float16"
135
+ }
136
+ ],
137
+ "outputs": [
138
+ {
139
+ "name": "embedding",
140
+ "shape": [
141
+ 8,
142
+ 768
143
+ ],
144
+ "dtype": "float32"
145
+ }
146
+ ]
147
+ },
148
+ "embed_128": {
149
+ "inputs": [
150
+ {
151
+ "name": "inputs_embeds",
152
+ "shape": [
153
+ 1,
154
+ 128,
155
+ 512
156
+ ],
157
+ "dtype": "float16"
158
+ },
159
+ {
160
+ "name": "global_bias",
161
+ "shape": [
162
+ 1,
163
+ 1,
164
+ 128,
165
+ 128
166
+ ],
167
+ "dtype": "float16"
168
+ },
169
+ {
170
+ "name": "local_bias",
171
+ "shape": [
172
+ 1,
173
+ 1,
174
+ 128,
175
+ 128
176
+ ],
177
+ "dtype": "float16"
178
+ },
179
+ {
180
+ "name": "pool",
181
+ "shape": [
182
+ 8,
183
+ 128
184
+ ],
185
+ "dtype": "float16"
186
+ }
187
+ ],
188
+ "outputs": [
189
+ {
190
+ "name": "embedding",
191
+ "shape": [
192
+ 8,
193
+ 768
194
+ ],
195
+ "dtype": "float32"
196
+ }
197
+ ]
198
+ },
199
+ "embed_256": {
200
+ "inputs": [
201
+ {
202
+ "name": "inputs_embeds",
203
+ "shape": [
204
+ 1,
205
+ 256,
206
+ 512
207
+ ],
208
+ "dtype": "float16"
209
+ },
210
+ {
211
+ "name": "global_bias",
212
+ "shape": [
213
+ 1,
214
+ 1,
215
+ 256,
216
+ 256
217
+ ],
218
+ "dtype": "float16"
219
+ },
220
+ {
221
+ "name": "local_bias",
222
+ "shape": [
223
+ 1,
224
+ 1,
225
+ 256,
226
+ 256
227
+ ],
228
+ "dtype": "float16"
229
+ },
230
+ {
231
+ "name": "pool",
232
+ "shape": [
233
+ 8,
234
+ 256
235
+ ],
236
+ "dtype": "float16"
237
+ }
238
+ ],
239
+ "outputs": [
240
+ {
241
+ "name": "embedding",
242
+ "shape": [
243
+ 8,
244
+ 768
245
+ ],
246
+ "dtype": "float32"
247
+ }
248
+ ]
249
+ },
250
+ "embed_512": {
251
+ "inputs": [
252
+ {
253
+ "name": "inputs_embeds",
254
+ "shape": [
255
+ 1,
256
+ 512,
257
+ 512
258
+ ],
259
+ "dtype": "float16"
260
+ },
261
+ {
262
+ "name": "global_bias",
263
+ "shape": [
264
+ 1,
265
+ 1,
266
+ 512,
267
+ 512
268
+ ],
269
+ "dtype": "float16"
270
+ },
271
+ {
272
+ "name": "local_bias",
273
+ "shape": [
274
+ 1,
275
+ 1,
276
+ 512,
277
+ 512
278
+ ],
279
+ "dtype": "float16"
280
+ },
281
+ {
282
+ "name": "pool",
283
+ "shape": [
284
+ 16,
285
+ 512
286
+ ],
287
+ "dtype": "float16"
288
+ }
289
+ ],
290
+ "outputs": [
291
+ {
292
+ "name": "embedding",
293
+ "shape": [
294
+ 16,
295
+ 768
296
+ ],
297
+ "dtype": "float32"
298
+ }
299
+ ]
300
+ },
301
+ "embed_1024": {
302
+ "inputs": [
303
+ {
304
+ "name": "inputs_embeds",
305
+ "shape": [
306
+ 1,
307
+ 1024,
308
+ 512
309
+ ],
310
+ "dtype": "float16"
311
+ },
312
+ {
313
+ "name": "global_bias",
314
+ "shape": [
315
+ 1,
316
+ 1,
317
+ 1024,
318
+ 1024
319
+ ],
320
+ "dtype": "float16"
321
+ },
322
+ {
323
+ "name": "local_bias",
324
+ "shape": [
325
+ 1,
326
+ 1,
327
+ 1024,
328
+ 1024
329
+ ],
330
+ "dtype": "float16"
331
+ },
332
+ {
333
+ "name": "pool",
334
+ "shape": [
335
+ 32,
336
+ 1024
337
+ ],
338
+ "dtype": "float16"
339
+ }
340
+ ],
341
+ "outputs": [
342
+ {
343
+ "name": "embedding",
344
+ "shape": [
345
+ 32,
346
+ 768
347
+ ],
348
+ "dtype": "float32"
349
+ }
350
+ ]
351
+ },
352
+ "embed_2048": {
353
+ "inputs": [
354
+ {
355
+ "name": "inputs_embeds",
356
+ "shape": [
357
+ 1,
358
+ 2048,
359
+ 512
360
+ ],
361
+ "dtype": "float16"
362
+ },
363
+ {
364
+ "name": "global_bias",
365
+ "shape": [
366
+ 1,
367
+ 1,
368
+ 2048,
369
+ 2048
370
+ ],
371
+ "dtype": "float16"
372
+ },
373
+ {
374
+ "name": "local_bias",
375
+ "shape": [
376
+ 1,
377
+ 1,
378
+ 2048,
379
+ 2048
380
+ ],
381
+ "dtype": "float16"
382
+ },
383
+ {
384
+ "name": "pool",
385
+ "shape": [
386
+ 64,
387
+ 2048
388
+ ],
389
+ "dtype": "float16"
390
+ }
391
+ ],
392
+ "outputs": [
393
+ {
394
+ "name": "embedding",
395
+ "shape": [
396
+ 64,
397
+ 768
398
+ ],
399
+ "dtype": "float32"
400
+ }
401
+ ]
402
+ },
403
+ "long_swa_l0": {
404
+ "inputs": [
405
+ {
406
+ "name": "hidden_window",
407
+ "shape": [
408
+ 1,
409
+ 2048,
410
+ 512
411
+ ],
412
+ "dtype": "float16"
413
+ },
414
+ {
415
+ "name": "inputs_embeds",
416
+ "shape": [
417
+ 1,
418
+ 1024,
419
+ 512
420
+ ],
421
+ "dtype": "float16"
422
+ },
423
+ {
424
+ "name": "bias",
425
+ "shape": [
426
+ 1,
427
+ 1,
428
+ 1024,
429
+ 2048
430
+ ],
431
+ "dtype": "float16"
432
+ }
433
+ ],
434
+ "outputs": [
435
+ {
436
+ "name": "hidden_out",
437
+ "shape": [
438
+ 1,
439
+ 1024,
440
+ 512
441
+ ],
442
+ "dtype": "float16"
443
+ }
444
+ ]
445
+ },
446
+ "long_swa_l1": {
447
+ "inputs": [
448
+ {
449
+ "name": "hidden_window",
450
+ "shape": [
451
+ 1,
452
+ 2048,
453
+ 512
454
+ ],
455
+ "dtype": "float16"
456
+ },
457
+ {
458
+ "name": "inputs_embeds",
459
+ "shape": [
460
+ 1,
461
+ 1024,
462
+ 512
463
+ ],
464
+ "dtype": "float16"
465
+ },
466
+ {
467
+ "name": "bias",
468
+ "shape": [
469
+ 1,
470
+ 1,
471
+ 1024,
472
+ 2048
473
+ ],
474
+ "dtype": "float16"
475
+ }
476
+ ],
477
+ "outputs": [
478
+ {
479
+ "name": "hidden_out",
480
+ "shape": [
481
+ 1,
482
+ 1024,
483
+ 512
484
+ ],
485
+ "dtype": "float16"
486
+ }
487
+ ]
488
+ },
489
+ "long_swa_l2": {
490
+ "inputs": [
491
+ {
492
+ "name": "hidden_window",
493
+ "shape": [
494
+ 1,
495
+ 2048,
496
+ 512
497
+ ],
498
+ "dtype": "float16"
499
+ },
500
+ {
501
+ "name": "inputs_embeds",
502
+ "shape": [
503
+ 1,
504
+ 1024,
505
+ 512
506
+ ],
507
+ "dtype": "float16"
508
+ },
509
+ {
510
+ "name": "bias",
511
+ "shape": [
512
+ 1,
513
+ 1,
514
+ 1024,
515
+ 2048
516
+ ],
517
+ "dtype": "float16"
518
+ }
519
+ ],
520
+ "outputs": [
521
+ {
522
+ "name": "hidden_out",
523
+ "shape": [
524
+ 1,
525
+ 1024,
526
+ 512
527
+ ],
528
+ "dtype": "float16"
529
+ }
530
+ ]
531
+ },
532
+ "long_swa_l3": {
533
+ "inputs": [
534
+ {
535
+ "name": "hidden_window",
536
+ "shape": [
537
+ 1,
538
+ 2048,
539
+ 512
540
+ ],
541
+ "dtype": "float16"
542
+ },
543
+ {
544
+ "name": "inputs_embeds",
545
+ "shape": [
546
+ 1,
547
+ 1024,
548
+ 512
549
+ ],
550
+ "dtype": "float16"
551
+ },
552
+ {
553
+ "name": "bias",
554
+ "shape": [
555
+ 1,
556
+ 1,
557
+ 1024,
558
+ 2048
559
+ ],
560
+ "dtype": "float16"
561
+ }
562
+ ],
563
+ "outputs": [
564
+ {
565
+ "name": "hidden_out",
566
+ "shape": [
567
+ 1,
568
+ 1024,
569
+ 512
570
+ ],
571
+ "dtype": "float16"
572
+ }
573
+ ]
574
+ },
575
+ "long_swa_l4": {
576
+ "inputs": [
577
+ {
578
+ "name": "hidden_window",
579
+ "shape": [
580
+ 1,
581
+ 2048,
582
+ 512
583
+ ],
584
+ "dtype": "float16"
585
+ },
586
+ {
587
+ "name": "inputs_embeds",
588
+ "shape": [
589
+ 1,
590
+ 1024,
591
+ 512
592
+ ],
593
+ "dtype": "float16"
594
+ },
595
+ {
596
+ "name": "bias",
597
+ "shape": [
598
+ 1,
599
+ 1,
600
+ 1024,
601
+ 2048
602
+ ],
603
+ "dtype": "float16"
604
+ }
605
+ ],
606
+ "outputs": [
607
+ {
608
+ "name": "hidden_out",
609
+ "shape": [
610
+ 1,
611
+ 1024,
612
+ 512
613
+ ],
614
+ "dtype": "float16"
615
+ }
616
+ ]
617
+ },
618
+ "long_swa_l6": {
619
+ "inputs": [
620
+ {
621
+ "name": "hidden_window",
622
+ "shape": [
623
+ 1,
624
+ 2048,
625
+ 512
626
+ ],
627
+ "dtype": "float16"
628
+ },
629
+ {
630
+ "name": "inputs_embeds",
631
+ "shape": [
632
+ 1,
633
+ 1024,
634
+ 512
635
+ ],
636
+ "dtype": "float16"
637
+ },
638
+ {
639
+ "name": "bias",
640
+ "shape": [
641
+ 1,
642
+ 1,
643
+ 1024,
644
+ 2048
645
+ ],
646
+ "dtype": "float16"
647
+ }
648
+ ],
649
+ "outputs": [
650
+ {
651
+ "name": "hidden_out",
652
+ "shape": [
653
+ 1,
654
+ 1024,
655
+ 512
656
+ ],
657
+ "dtype": "float16"
658
+ }
659
+ ]
660
+ },
661
+ "long_swa_l7": {
662
+ "inputs": [
663
+ {
664
+ "name": "hidden_window",
665
+ "shape": [
666
+ 1,
667
+ 2048,
668
+ 512
669
+ ],
670
+ "dtype": "float16"
671
+ },
672
+ {
673
+ "name": "inputs_embeds",
674
+ "shape": [
675
+ 1,
676
+ 1024,
677
+ 512
678
+ ],
679
+ "dtype": "float16"
680
+ },
681
+ {
682
+ "name": "bias",
683
+ "shape": [
684
+ 1,
685
+ 1,
686
+ 1024,
687
+ 2048
688
+ ],
689
+ "dtype": "float16"
690
+ }
691
+ ],
692
+ "outputs": [
693
+ {
694
+ "name": "hidden_out",
695
+ "shape": [
696
+ 1,
697
+ 1024,
698
+ 512
699
+ ],
700
+ "dtype": "float16"
701
+ }
702
+ ]
703
+ },
704
+ "long_swa_l8": {
705
+ "inputs": [
706
+ {
707
+ "name": "hidden_window",
708
+ "shape": [
709
+ 1,
710
+ 2048,
711
+ 512
712
+ ],
713
+ "dtype": "float16"
714
+ },
715
+ {
716
+ "name": "inputs_embeds",
717
+ "shape": [
718
+ 1,
719
+ 1024,
720
+ 512
721
+ ],
722
+ "dtype": "float16"
723
+ },
724
+ {
725
+ "name": "bias",
726
+ "shape": [
727
+ 1,
728
+ 1,
729
+ 1024,
730
+ 2048
731
+ ],
732
+ "dtype": "float16"
733
+ }
734
+ ],
735
+ "outputs": [
736
+ {
737
+ "name": "hidden_out",
738
+ "shape": [
739
+ 1,
740
+ 1024,
741
+ 512
742
+ ],
743
+ "dtype": "float16"
744
+ }
745
+ ]
746
+ },
747
+ "long_swa_l9": {
748
+ "inputs": [
749
+ {
750
+ "name": "hidden_window",
751
+ "shape": [
752
+ 1,
753
+ 2048,
754
+ 512
755
+ ],
756
+ "dtype": "float16"
757
+ },
758
+ {
759
+ "name": "inputs_embeds",
760
+ "shape": [
761
+ 1,
762
+ 1024,
763
+ 512
764
+ ],
765
+ "dtype": "float16"
766
+ },
767
+ {
768
+ "name": "bias",
769
+ "shape": [
770
+ 1,
771
+ 1,
772
+ 1024,
773
+ 2048
774
+ ],
775
+ "dtype": "float16"
776
+ }
777
+ ],
778
+ "outputs": [
779
+ {
780
+ "name": "hidden_out",
781
+ "shape": [
782
+ 1,
783
+ 1024,
784
+ 512
785
+ ],
786
+ "dtype": "float16"
787
+ }
788
+ ]
789
+ },
790
+ "long_swa_l10": {
791
+ "inputs": [
792
+ {
793
+ "name": "hidden_window",
794
+ "shape": [
795
+ 1,
796
+ 2048,
797
+ 512
798
+ ],
799
+ "dtype": "float16"
800
+ },
801
+ {
802
+ "name": "inputs_embeds",
803
+ "shape": [
804
+ 1,
805
+ 1024,
806
+ 512
807
+ ],
808
+ "dtype": "float16"
809
+ },
810
+ {
811
+ "name": "bias",
812
+ "shape": [
813
+ 1,
814
+ 1,
815
+ 1024,
816
+ 2048
817
+ ],
818
+ "dtype": "float16"
819
+ }
820
+ ],
821
+ "outputs": [
822
+ {
823
+ "name": "hidden_out",
824
+ "shape": [
825
+ 1,
826
+ 1024,
827
+ 512
828
+ ],
829
+ "dtype": "float16"
830
+ }
831
+ ]
832
+ },
833
+ "long_swa_l12": {
834
+ "inputs": [
835
+ {
836
+ "name": "hidden_window",
837
+ "shape": [
838
+ 1,
839
+ 2048,
840
+ 512
841
+ ],
842
+ "dtype": "float16"
843
+ },
844
+ {
845
+ "name": "inputs_embeds",
846
+ "shape": [
847
+ 1,
848
+ 1024,
849
+ 512
850
+ ],
851
+ "dtype": "float16"
852
+ },
853
+ {
854
+ "name": "bias",
855
+ "shape": [
856
+ 1,
857
+ 1,
858
+ 1024,
859
+ 2048
860
+ ],
861
+ "dtype": "float16"
862
+ }
863
+ ],
864
+ "outputs": [
865
+ {
866
+ "name": "hidden_out",
867
+ "shape": [
868
+ 1,
869
+ 1024,
870
+ 512
871
+ ],
872
+ "dtype": "float16"
873
+ }
874
+ ]
875
+ },
876
+ "long_swa_l13": {
877
+ "inputs": [
878
+ {
879
+ "name": "hidden_window",
880
+ "shape": [
881
+ 1,
882
+ 2048,
883
+ 512
884
+ ],
885
+ "dtype": "float16"
886
+ },
887
+ {
888
+ "name": "inputs_embeds",
889
+ "shape": [
890
+ 1,
891
+ 1024,
892
+ 512
893
+ ],
894
+ "dtype": "float16"
895
+ },
896
+ {
897
+ "name": "bias",
898
+ "shape": [
899
+ 1,
900
+ 1,
901
+ 1024,
902
+ 2048
903
+ ],
904
+ "dtype": "float16"
905
+ }
906
+ ],
907
+ "outputs": [
908
+ {
909
+ "name": "hidden_out",
910
+ "shape": [
911
+ 1,
912
+ 1024,
913
+ 512
914
+ ],
915
+ "dtype": "float16"
916
+ }
917
+ ]
918
+ },
919
+ "long_swa_l14": {
920
+ "inputs": [
921
+ {
922
+ "name": "hidden_window",
923
+ "shape": [
924
+ 1,
925
+ 2048,
926
+ 512
927
+ ],
928
+ "dtype": "float16"
929
+ },
930
+ {
931
+ "name": "inputs_embeds",
932
+ "shape": [
933
+ 1,
934
+ 1024,
935
+ 512
936
+ ],
937
+ "dtype": "float16"
938
+ },
939
+ {
940
+ "name": "bias",
941
+ "shape": [
942
+ 1,
943
+ 1,
944
+ 1024,
945
+ 2048
946
+ ],
947
+ "dtype": "float16"
948
+ }
949
+ ],
950
+ "outputs": [
951
+ {
952
+ "name": "hidden_out",
953
+ "shape": [
954
+ 1,
955
+ 1024,
956
+ 512
957
+ ],
958
+ "dtype": "float16"
959
+ }
960
+ ]
961
+ },
962
+ "long_swa_l15": {
963
+ "inputs": [
964
+ {
965
+ "name": "hidden_window",
966
+ "shape": [
967
+ 1,
968
+ 2048,
969
+ 512
970
+ ],
971
+ "dtype": "float16"
972
+ },
973
+ {
974
+ "name": "inputs_embeds",
975
+ "shape": [
976
+ 1,
977
+ 1024,
978
+ 512
979
+ ],
980
+ "dtype": "float16"
981
+ },
982
+ {
983
+ "name": "bias",
984
+ "shape": [
985
+ 1,
986
+ 1,
987
+ 1024,
988
+ 2048
989
+ ],
990
+ "dtype": "float16"
991
+ }
992
+ ],
993
+ "outputs": [
994
+ {
995
+ "name": "hidden_out",
996
+ "shape": [
997
+ 1,
998
+ 1024,
999
+ 512
1000
+ ],
1001
+ "dtype": "float16"
1002
+ }
1003
+ ]
1004
+ },
1005
+ "long_swa_l16": {
1006
+ "inputs": [
1007
+ {
1008
+ "name": "hidden_window",
1009
+ "shape": [
1010
+ 1,
1011
+ 2048,
1012
+ 512
1013
+ ],
1014
+ "dtype": "float16"
1015
+ },
1016
+ {
1017
+ "name": "inputs_embeds",
1018
+ "shape": [
1019
+ 1,
1020
+ 1024,
1021
+ 512
1022
+ ],
1023
+ "dtype": "float16"
1024
+ },
1025
+ {
1026
+ "name": "bias",
1027
+ "shape": [
1028
+ 1,
1029
+ 1,
1030
+ 1024,
1031
+ 2048
1032
+ ],
1033
+ "dtype": "float16"
1034
+ }
1035
+ ],
1036
+ "outputs": [
1037
+ {
1038
+ "name": "hidden_out",
1039
+ "shape": [
1040
+ 1,
1041
+ 1024,
1042
+ 512
1043
+ ],
1044
+ "dtype": "float16"
1045
+ }
1046
+ ]
1047
+ },
1048
+ "long_swa_l18": {
1049
+ "inputs": [
1050
+ {
1051
+ "name": "hidden_window",
1052
+ "shape": [
1053
+ 1,
1054
+ 2048,
1055
+ 512
1056
+ ],
1057
+ "dtype": "float16"
1058
+ },
1059
+ {
1060
+ "name": "inputs_embeds",
1061
+ "shape": [
1062
+ 1,
1063
+ 1024,
1064
+ 512
1065
+ ],
1066
+ "dtype": "float16"
1067
+ },
1068
+ {
1069
+ "name": "bias",
1070
+ "shape": [
1071
+ 1,
1072
+ 1,
1073
+ 1024,
1074
+ 2048
1075
+ ],
1076
+ "dtype": "float16"
1077
+ }
1078
+ ],
1079
+ "outputs": [
1080
+ {
1081
+ "name": "hidden_out",
1082
+ "shape": [
1083
+ 1,
1084
+ 1024,
1085
+ 512
1086
+ ],
1087
+ "dtype": "float16"
1088
+ }
1089
+ ]
1090
+ },
1091
+ "long_swa_l19": {
1092
+ "inputs": [
1093
+ {
1094
+ "name": "hidden_window",
1095
+ "shape": [
1096
+ 1,
1097
+ 2048,
1098
+ 512
1099
+ ],
1100
+ "dtype": "float16"
1101
+ },
1102
+ {
1103
+ "name": "inputs_embeds",
1104
+ "shape": [
1105
+ 1,
1106
+ 1024,
1107
+ 512
1108
+ ],
1109
+ "dtype": "float16"
1110
+ },
1111
+ {
1112
+ "name": "bias",
1113
+ "shape": [
1114
+ 1,
1115
+ 1,
1116
+ 1024,
1117
+ 2048
1118
+ ],
1119
+ "dtype": "float16"
1120
+ }
1121
+ ],
1122
+ "outputs": [
1123
+ {
1124
+ "name": "hidden_out",
1125
+ "shape": [
1126
+ 1,
1127
+ 1024,
1128
+ 512
1129
+ ],
1130
+ "dtype": "float16"
1131
+ }
1132
+ ]
1133
+ },
1134
+ "long_swa_l20": {
1135
+ "inputs": [
1136
+ {
1137
+ "name": "hidden_window",
1138
+ "shape": [
1139
+ 1,
1140
+ 2048,
1141
+ 512
1142
+ ],
1143
+ "dtype": "float16"
1144
+ },
1145
+ {
1146
+ "name": "inputs_embeds",
1147
+ "shape": [
1148
+ 1,
1149
+ 1024,
1150
+ 512
1151
+ ],
1152
+ "dtype": "float16"
1153
+ },
1154
+ {
1155
+ "name": "bias",
1156
+ "shape": [
1157
+ 1,
1158
+ 1,
1159
+ 1024,
1160
+ 2048
1161
+ ],
1162
+ "dtype": "float16"
1163
+ }
1164
+ ],
1165
+ "outputs": [
1166
+ {
1167
+ "name": "hidden_out",
1168
+ "shape": [
1169
+ 1,
1170
+ 1024,
1171
+ 512
1172
+ ],
1173
+ "dtype": "float16"
1174
+ }
1175
+ ]
1176
+ },
1177
+ "long_swa_l21": {
1178
+ "inputs": [
1179
+ {
1180
+ "name": "hidden_window",
1181
+ "shape": [
1182
+ 1,
1183
+ 2048,
1184
+ 512
1185
+ ],
1186
+ "dtype": "float16"
1187
+ },
1188
+ {
1189
+ "name": "inputs_embeds",
1190
+ "shape": [
1191
+ 1,
1192
+ 1024,
1193
+ 512
1194
+ ],
1195
+ "dtype": "float16"
1196
+ },
1197
+ {
1198
+ "name": "bias",
1199
+ "shape": [
1200
+ 1,
1201
+ 1,
1202
+ 1024,
1203
+ 2048
1204
+ ],
1205
+ "dtype": "float16"
1206
+ }
1207
+ ],
1208
+ "outputs": [
1209
+ {
1210
+ "name": "hidden_out",
1211
+ "shape": [
1212
+ 1,
1213
+ 1024,
1214
+ 512
1215
+ ],
1216
+ "dtype": "float16"
1217
+ }
1218
+ ]
1219
+ },
1220
+ "long_swa_l22": {
1221
+ "inputs": [
1222
+ {
1223
+ "name": "hidden_window",
1224
+ "shape": [
1225
+ 1,
1226
+ 2048,
1227
+ 512
1228
+ ],
1229
+ "dtype": "float16"
1230
+ },
1231
+ {
1232
+ "name": "inputs_embeds",
1233
+ "shape": [
1234
+ 1,
1235
+ 1024,
1236
+ 512
1237
+ ],
1238
+ "dtype": "float16"
1239
+ },
1240
+ {
1241
+ "name": "bias",
1242
+ "shape": [
1243
+ 1,
1244
+ 1,
1245
+ 1024,
1246
+ 2048
1247
+ ],
1248
+ "dtype": "float16"
1249
+ }
1250
+ ],
1251
+ "outputs": [
1252
+ {
1253
+ "name": "hidden_out",
1254
+ "shape": [
1255
+ 1,
1256
+ 1024,
1257
+ 512
1258
+ ],
1259
+ "dtype": "float16"
1260
+ }
1261
+ ]
1262
+ },
1263
+ "long4096_glb_l5": {
1264
+ "inputs": [
1265
+ {
1266
+ "name": "hidden",
1267
+ "shape": [
1268
+ 1,
1269
+ 4096,
1270
+ 512
1271
+ ],
1272
+ "dtype": "float16"
1273
+ },
1274
+ {
1275
+ "name": "inputs_embeds",
1276
+ "shape": [
1277
+ 1,
1278
+ 4096,
1279
+ 512
1280
+ ],
1281
+ "dtype": "float16"
1282
+ },
1283
+ {
1284
+ "name": "key_bias",
1285
+ "shape": [
1286
+ 1,
1287
+ 1,
1288
+ 1,
1289
+ 4096
1290
+ ],
1291
+ "dtype": "float16"
1292
+ }
1293
+ ],
1294
+ "outputs": [
1295
+ {
1296
+ "name": "hidden_out",
1297
+ "shape": [
1298
+ 1,
1299
+ 4096,
1300
+ 512
1301
+ ],
1302
+ "dtype": "float16"
1303
+ }
1304
+ ]
1305
+ },
1306
+ "long4096_glb_l11": {
1307
+ "inputs": [
1308
+ {
1309
+ "name": "hidden",
1310
+ "shape": [
1311
+ 1,
1312
+ 4096,
1313
+ 512
1314
+ ],
1315
+ "dtype": "float16"
1316
+ },
1317
+ {
1318
+ "name": "inputs_embeds",
1319
+ "shape": [
1320
+ 1,
1321
+ 4096,
1322
+ 512
1323
+ ],
1324
+ "dtype": "float16"
1325
+ },
1326
+ {
1327
+ "name": "key_bias",
1328
+ "shape": [
1329
+ 1,
1330
+ 1,
1331
+ 1,
1332
+ 4096
1333
+ ],
1334
+ "dtype": "float16"
1335
+ }
1336
+ ],
1337
+ "outputs": [
1338
+ {
1339
+ "name": "hidden_out",
1340
+ "shape": [
1341
+ 1,
1342
+ 4096,
1343
+ 512
1344
+ ],
1345
+ "dtype": "float16"
1346
+ }
1347
+ ]
1348
+ },
1349
+ "long4096_glb_l17": {
1350
+ "inputs": [
1351
+ {
1352
+ "name": "hidden",
1353
+ "shape": [
1354
+ 1,
1355
+ 4096,
1356
+ 512
1357
+ ],
1358
+ "dtype": "float16"
1359
+ },
1360
+ {
1361
+ "name": "inputs_embeds",
1362
+ "shape": [
1363
+ 1,
1364
+ 4096,
1365
+ 512
1366
+ ],
1367
+ "dtype": "float16"
1368
+ },
1369
+ {
1370
+ "name": "key_bias",
1371
+ "shape": [
1372
+ 1,
1373
+ 1,
1374
+ 1,
1375
+ 4096
1376
+ ],
1377
+ "dtype": "float16"
1378
+ }
1379
+ ],
1380
+ "outputs": [
1381
+ {
1382
+ "name": "hidden_out",
1383
+ "shape": [
1384
+ 1,
1385
+ 4096,
1386
+ 512
1387
+ ],
1388
+ "dtype": "float16"
1389
+ }
1390
+ ]
1391
+ },
1392
+ "long4096_head": {
1393
+ "inputs": [
1394
+ {
1395
+ "name": "hidden",
1396
+ "shape": [
1397
+ 1,
1398
+ 4096,
1399
+ 512
1400
+ ],
1401
+ "dtype": "float16"
1402
+ },
1403
+ {
1404
+ "name": "inputs_embeds",
1405
+ "shape": [
1406
+ 1,
1407
+ 4096,
1408
+ 512
1409
+ ],
1410
+ "dtype": "float16"
1411
+ },
1412
+ {
1413
+ "name": "key_bias",
1414
+ "shape": [
1415
+ 1,
1416
+ 1,
1417
+ 1,
1418
+ 4096
1419
+ ],
1420
+ "dtype": "float16"
1421
+ },
1422
+ {
1423
+ "name": "pool",
1424
+ "shape": [
1425
+ 1,
1426
+ 4096
1427
+ ],
1428
+ "dtype": "float16"
1429
+ }
1430
+ ],
1431
+ "outputs": [
1432
+ {
1433
+ "name": "embedding",
1434
+ "shape": [
1435
+ 1,
1436
+ 768
1437
+ ],
1438
+ "dtype": "float32"
1439
+ }
1440
+ ]
1441
+ },
1442
+ "long8192_glb_l5": {
1443
+ "inputs": [
1444
+ {
1445
+ "name": "hidden",
1446
+ "shape": [
1447
+ 1,
1448
+ 8192,
1449
+ 512
1450
+ ],
1451
+ "dtype": "float16"
1452
+ },
1453
+ {
1454
+ "name": "inputs_embeds",
1455
+ "shape": [
1456
+ 1,
1457
+ 8192,
1458
+ 512
1459
+ ],
1460
+ "dtype": "float16"
1461
+ },
1462
+ {
1463
+ "name": "key_bias",
1464
+ "shape": [
1465
+ 1,
1466
+ 1,
1467
+ 1,
1468
+ 8192
1469
+ ],
1470
+ "dtype": "float16"
1471
+ }
1472
+ ],
1473
+ "outputs": [
1474
+ {
1475
+ "name": "hidden_out",
1476
+ "shape": [
1477
+ 1,
1478
+ 8192,
1479
+ 512
1480
+ ],
1481
+ "dtype": "float16"
1482
+ }
1483
+ ]
1484
+ },
1485
+ "long8192_glb_l11": {
1486
+ "inputs": [
1487
+ {
1488
+ "name": "hidden",
1489
+ "shape": [
1490
+ 1,
1491
+ 8192,
1492
+ 512
1493
+ ],
1494
+ "dtype": "float16"
1495
+ },
1496
+ {
1497
+ "name": "inputs_embeds",
1498
+ "shape": [
1499
+ 1,
1500
+ 8192,
1501
+ 512
1502
+ ],
1503
+ "dtype": "float16"
1504
+ },
1505
+ {
1506
+ "name": "key_bias",
1507
+ "shape": [
1508
+ 1,
1509
+ 1,
1510
+ 1,
1511
+ 8192
1512
+ ],
1513
+ "dtype": "float16"
1514
+ }
1515
+ ],
1516
+ "outputs": [
1517
+ {
1518
+ "name": "hidden_out",
1519
+ "shape": [
1520
+ 1,
1521
+ 8192,
1522
+ 512
1523
+ ],
1524
+ "dtype": "float16"
1525
+ }
1526
+ ]
1527
+ },
1528
+ "long8192_glb_l17": {
1529
+ "inputs": [
1530
+ {
1531
+ "name": "hidden",
1532
+ "shape": [
1533
+ 1,
1534
+ 8192,
1535
+ 512
1536
+ ],
1537
+ "dtype": "float16"
1538
+ },
1539
+ {
1540
+ "name": "inputs_embeds",
1541
+ "shape": [
1542
+ 1,
1543
+ 8192,
1544
+ 512
1545
+ ],
1546
+ "dtype": "float16"
1547
+ },
1548
+ {
1549
+ "name": "key_bias",
1550
+ "shape": [
1551
+ 1,
1552
+ 1,
1553
+ 1,
1554
+ 8192
1555
+ ],
1556
+ "dtype": "float16"
1557
+ }
1558
+ ],
1559
+ "outputs": [
1560
+ {
1561
+ "name": "hidden_out",
1562
+ "shape": [
1563
+ 1,
1564
+ 8192,
1565
+ 512
1566
+ ],
1567
+ "dtype": "float16"
1568
+ }
1569
+ ]
1570
+ },
1571
+ "long8192_head": {
1572
+ "inputs": [
1573
+ {
1574
+ "name": "hidden",
1575
+ "shape": [
1576
+ 1,
1577
+ 8192,
1578
+ 512
1579
+ ],
1580
+ "dtype": "float16"
1581
+ },
1582
+ {
1583
+ "name": "inputs_embeds",
1584
+ "shape": [
1585
+ 1,
1586
+ 8192,
1587
+ 512
1588
+ ],
1589
+ "dtype": "float16"
1590
+ },
1591
+ {
1592
+ "name": "key_bias",
1593
+ "shape": [
1594
+ 1,
1595
+ 1,
1596
+ 1,
1597
+ 8192
1598
+ ],
1599
+ "dtype": "float16"
1600
+ },
1601
+ {
1602
+ "name": "pool",
1603
+ "shape": [
1604
+ 1,
1605
+ 8192
1606
+ ],
1607
+ "dtype": "float16"
1608
+ }
1609
+ ],
1610
+ "outputs": [
1611
+ {
1612
+ "name": "embedding",
1613
+ "shape": [
1614
+ 1,
1615
+ 768
1616
+ ],
1617
+ "dtype": "float32"
1618
+ }
1619
+ ]
1620
+ }
1621
+ }
1622
+ },
1623
+ "EmbeddingGemma2Vision": {
1624
+ "mlpackage": "EmbeddingGemma2Vision.mlpackage",
1625
+ "mlmodelc": "EmbeddingGemma2Vision.mlmodelc",
1626
+ "compute_units": "cpuAndNeuralEngine",
1627
+ "functions": {
1628
+ "vision_70": {
1629
+ "inputs": [
1630
+ {
1631
+ "name": "patches",
1632
+ "shape": [
1633
+ 1,
1634
+ 630,
1635
+ 768
1636
+ ],
1637
+ "dtype": "float16"
1638
+ },
1639
+ {
1640
+ "name": "positions",
1641
+ "shape": [
1642
+ 1,
1643
+ 630,
1644
+ 2
1645
+ ],
1646
+ "dtype": "float16"
1647
+ },
1648
+ {
1649
+ "name": "pool",
1650
+ "shape": [
1651
+ 70,
1652
+ 630
1653
+ ],
1654
+ "dtype": "float16"
1655
+ },
1656
+ {
1657
+ "name": "valid",
1658
+ "shape": [
1659
+ 1,
1660
+ 630
1661
+ ],
1662
+ "dtype": "float16"
1663
+ },
1664
+ {
1665
+ "name": "position_embeddings",
1666
+ "shape": [
1667
+ 1,
1668
+ 630,
1669
+ 768
1670
+ ],
1671
+ "dtype": "float16"
1672
+ }
1673
+ ],
1674
+ "outputs": [
1675
+ {
1676
+ "name": "image_tokens",
1677
+ "shape": [
1678
+ 1,
1679
+ 70,
1680
+ 512
1681
+ ],
1682
+ "dtype": "float16"
1683
+ }
1684
+ ]
1685
+ },
1686
+ "vision_140": {
1687
+ "inputs": [
1688
+ {
1689
+ "name": "patches",
1690
+ "shape": [
1691
+ 1,
1692
+ 1260,
1693
+ 768
1694
+ ],
1695
+ "dtype": "float16"
1696
+ },
1697
+ {
1698
+ "name": "positions",
1699
+ "shape": [
1700
+ 1,
1701
+ 1260,
1702
+ 2
1703
+ ],
1704
+ "dtype": "float16"
1705
+ },
1706
+ {
1707
+ "name": "pool",
1708
+ "shape": [
1709
+ 140,
1710
+ 1260
1711
+ ],
1712
+ "dtype": "float16"
1713
+ },
1714
+ {
1715
+ "name": "valid",
1716
+ "shape": [
1717
+ 1,
1718
+ 1260
1719
+ ],
1720
+ "dtype": "float16"
1721
+ },
1722
+ {
1723
+ "name": "position_embeddings",
1724
+ "shape": [
1725
+ 1,
1726
+ 1260,
1727
+ 768
1728
+ ],
1729
+ "dtype": "float16"
1730
+ }
1731
+ ],
1732
+ "outputs": [
1733
+ {
1734
+ "name": "image_tokens",
1735
+ "shape": [
1736
+ 1,
1737
+ 140,
1738
+ 512
1739
+ ],
1740
+ "dtype": "float16"
1741
+ }
1742
+ ]
1743
+ },
1744
+ "vision_280": {
1745
+ "inputs": [
1746
+ {
1747
+ "name": "patches",
1748
+ "shape": [
1749
+ 1,
1750
+ 2520,
1751
+ 768
1752
+ ],
1753
+ "dtype": "float16"
1754
+ },
1755
+ {
1756
+ "name": "positions",
1757
+ "shape": [
1758
+ 1,
1759
+ 2520,
1760
+ 2
1761
+ ],
1762
+ "dtype": "float16"
1763
+ },
1764
+ {
1765
+ "name": "pool",
1766
+ "shape": [
1767
+ 280,
1768
+ 2520
1769
+ ],
1770
+ "dtype": "float16"
1771
+ },
1772
+ {
1773
+ "name": "valid",
1774
+ "shape": [
1775
+ 1,
1776
+ 2520
1777
+ ],
1778
+ "dtype": "float16"
1779
+ },
1780
+ {
1781
+ "name": "position_embeddings",
1782
+ "shape": [
1783
+ 1,
1784
+ 2520,
1785
+ 768
1786
+ ],
1787
+ "dtype": "float16"
1788
+ }
1789
+ ],
1790
+ "outputs": [
1791
+ {
1792
+ "name": "image_tokens",
1793
+ "shape": [
1794
+ 1,
1795
+ 280,
1796
+ 512
1797
+ ],
1798
+ "dtype": "float16"
1799
+ }
1800
+ ]
1801
+ }
1802
+ }
1803
+ }
1804
+ },
1805
+ "buckets": [
1806
+ {
1807
+ "function": "embed_64",
1808
+ "tokens": 64,
1809
+ "slots": 8
1810
+ },
1811
+ {
1812
+ "function": "embed_128",
1813
+ "tokens": 128,
1814
+ "slots": 8
1815
+ },
1816
+ {
1817
+ "function": "embed_256",
1818
+ "tokens": 256,
1819
+ "slots": 8
1820
+ },
1821
+ {
1822
+ "function": "embed_512",
1823
+ "tokens": 512,
1824
+ "slots": 16
1825
+ },
1826
+ {
1827
+ "function": "embed_1024",
1828
+ "tokens": 1024,
1829
+ "slots": 32
1830
+ },
1831
+ {
1832
+ "function": "embed_2048",
1833
+ "tokens": 2048,
1834
+ "slots": 64
1835
+ }
1836
+ ],
1837
+ "bucket_contract": {
1838
+ "use": "texts/images of total length <= 2048 rows; pick the smallest S >= total rows of the packed sequences",
1839
+ "inputs_embeds": "[1,S,512] fp16: sequences back to back from row 0, zero rows after",
1840
+ "global_bias": "[1,1,S,S] fp16: 0 if row i and column j belong to the same sequence or i == j, else -10000",
1841
+ "local_bias": "[1,1,S,S] fp16: global_bias AND |i-j| <= 512 (else -10000); equals global_bias when S <= 512",
1842
+ "pool": "[K,S] fp16: row k = 1/n_k over the n_k rows of sequence k, 0 elsewhere; unused rows all 0 (any positive per-row constant gives the same normalized output; 1/n_k is verified)",
1843
+ "embedding": "[K,768] fp32: row k = L2-normalized embedding of sequence k; unused rows are 0",
1844
+ "positions": "none: RoPE uses absolute positions 0..S-1 inside the graph (exact, RoPE is relative and the bias is block diagonal)"
1845
+ },
1846
+ "long_path": {
1847
+ "tokens": [
1848
+ 2049,
1849
+ 8192
1850
+ ],
1851
+ "buckets": [
1852
+ 4096,
1853
+ 8192
1854
+ ],
1855
+ "S": "4096 if n <= 4096 else 8192",
1856
+ "chunk": 1024,
1857
+ "halo": 512,
1858
+ "sliding_window": 512,
1859
+ "sliding_layers": [
1860
+ 0,
1861
+ 1,
1862
+ 2,
1863
+ 3,
1864
+ 4,
1865
+ 6,
1866
+ 7,
1867
+ 8,
1868
+ 9,
1869
+ 10,
1870
+ 12,
1871
+ 13,
1872
+ 14,
1873
+ 15,
1874
+ 16,
1875
+ 18,
1876
+ 19,
1877
+ 20,
1878
+ 21,
1879
+ 22
1880
+ ],
1881
+ "global_layers": [
1882
+ 5,
1883
+ 11,
1884
+ 17,
1885
+ 23
1886
+ ],
1887
+ "inputs": {
1888
+ "x0": "[1,S,512] fp16 token rows (as for buckets), rows >= n zero",
1889
+ "chunk_bias(b)": "[1,1,1024,2048] fp16: query row q = b*1024 + r, key row k = b*1024 - 512 + c; 0 if (|q-k| <= 512 and 0 <= k < n) or k == q, else -10000",
1890
+ "key_bias": "[1,1,1,S] fp16: 0 for k < n, else -10000",
1891
+ "pool": "[1,S] fp16: 2^-10 (0.0009765625) for rows < n, else 0. Not 1/n: 1/n underflows fp16 in the in-graph pooling for large n (cos 0.9996 instead of 0.9999 at n=8192); the scale cancels in the L2 normalization"
1892
+ },
1893
+ "call_order": [
1894
+ "x = x0",
1895
+ "for layer i in 0..23:",
1896
+ " sliding i: xp = [512 zero rows; x; 512 zero rows]; for each chunk b with b*1024 < n: out[b*1024:(b+1)*1024] = long_swa_l{i}(hidden_window=xp[b*1024 : b*1024+2048], inputs_embeds=x0[b*1024:(b+1)*1024], bias=chunk_bias(b)).hidden_out; chunks with b*1024 >= n keep their rows; x = out (read all chunks from the previous x: double buffer)",
1897
+ " global i in {5,11,17}: x = long{S}_glb_l{i}(hidden=x, inputs_embeds=x0, key_bias).hidden_out",
1898
+ " i = 23: embedding = long{S}_head(hidden=x, inputs_embeds=x0, key_bias, pool).embedding [1,768] fp32"
1899
+ ],
1900
+ "calls": "20 * ceil(n/1024) + 4",
1901
+ "host_side_work": "token lookup and scale (same as buckets), halo padding / slicing, bias construction (per document; reuse across the 20 sliding layers). No host math on activations: the final norm, pooling, projection and L2 normalize run in long{S}_head."
1902
+ },
1903
+ "vision": {
1904
+ "package": "EmbeddingGemma2Vision",
1905
+ "functions": {
1906
+ "vision_70": {
1907
+ "max_tokens": 70,
1908
+ "patches": 630
1909
+ },
1910
+ "vision_140": {
1911
+ "max_tokens": 140,
1912
+ "patches": 1260
1913
+ },
1914
+ "vision_280": {
1915
+ "max_tokens": 280,
1916
+ "patches": 2520
1917
+ }
1918
+ },
1919
+ "preprocessing": "HF Gemma4ImageProcessor: RGB, aspect-preserving resize to the largest H x W (multiples of 48 px) with H*W <= 9*B*256 px, bicubic + antialias, rescale 1/255 (no normalize; the model applies 2x-1); patches row-major [16 rows][16 cols][RGB] = 768 values; pad to 9*B patches",
1920
+ "inputs": {
1921
+ "patches": "[1,9B,768] fp16",
1922
+ "positions": "[1,9B,2] fp16 (x, y) patch coords, -1 for padding",
1923
+ "position_embeddings": "[1,9B,768] fp16 = table[0][x] + table[1][y] from position_embeddings.f16 ([2,1024,768] fp16), 0 for padding",
1924
+ "valid": "[1,9B] fp16 1/0",
1925
+ "pool": "[B,9B] fp16: 1/9 at [(x//3) + (cols//3)*(y//3), p] for valid patch p"
1926
+ },
1927
+ "output": "image_tokens [1,B,512] fp16; the first (valid patches / 9) rows are the image tokens",
1928
+ "sequence": "rows = [bos*sqrt(512), boi*sqrt(512), image tokens (unscaled), eoi*sqrt(512), eos*sqrt(512)] -> bucket embed_S like a text sequence (packable with texts and other images)",
1929
+ "default_budget": 280
1930
+ },
1931
+ "selftest": {
1932
+ "files": [
1933
+ "selftest.json",
1934
+ "selftest.bin"
1935
+ ],
1936
+ "tests": 37,
1937
+ "tolerance": {
1938
+ "bucket": {
1939
+ "min_cos": 0.999,
1940
+ "zero_rows_max_abs": 0.001
1941
+ },
1942
+ "head": {
1943
+ "min_cos": 0.999
1944
+ },
1945
+ "swa": {
1946
+ "min_cos": 0.999,
1947
+ "max_rel_err": 0.05
1948
+ },
1949
+ "glb": {
1950
+ "min_cos": 0.999,
1951
+ "max_rel_err": 0.05
1952
+ },
1953
+ "vision": {
1954
+ "min_cos": 0.999,
1955
+ "max_rel_err": 0.05
1956
+ }
1957
+ },
1958
+ "runner": "tools/convert/selftest.py run <dir>"
1959
+ },
1960
+ "files": [
1961
+ {
1962
+ "path": "LICENSE",
1963
+ "size": 11357,
1964
+ "sha256": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4"
1965
+ },
1966
+ {
1967
+ "path": "NOTICE",
1968
+ "size": 1453,
1969
+ "sha256": "3e04d452d9bf50054b490a028b30a1677ad5c77a0bb6a1dddb0d36e2081269d3"
1970
+ },
1971
+ {
1972
+ "path": "embeddings.bf16",
1973
+ "size": 268435456,
1974
+ "sha256": "56ebbdbfd706c827f3fae1d97aa39135c7ddc0f1e6d9b12f8565f84bbfbda877"
1975
+ },
1976
+ {
1977
+ "path": "position_embeddings.f16",
1978
+ "size": 3145728,
1979
+ "sha256": "17de9480acc23638c0634a97ed89e51ed664433256d7d6f109587dcd91c79124"
1980
+ },
1981
+ {
1982
+ "path": "selftest.bin",
1983
+ "size": 1709760,
1984
+ "sha256": "1ae9d6e81d6eac8da5640182f4363803661b55d14d49a9b46ab7ba8be45524b1"
1985
+ },
1986
+ {
1987
+ "path": "selftest.json",
1988
+ "size": 112014,
1989
+ "sha256": "f14cdf197f1ef5a939ba03517b5384d3375072367df564b6511144262d848541"
1990
+ },
1991
+ {
1992
+ "path": "tokenizer.json",
1993
+ "size": 32170510,
1994
+ "sha256": "4d777ef5bdc1aa36227abdfb77c3e49e7b9c892d16e1b6bda41c393504828be4"
1995
+ },
1996
+ {
1997
+ "path": "EmbeddingGemma2Text.mlmodelc/coremldata.bin",
1998
+ "size": 5366,
1999
+ "sha256": "9282f1a78ac87745427aba8bae813b374631e5bfff92ba96a0c8eb40cd0bfd0e"
2000
+ },
2001
+ {
2002
+ "path": "EmbeddingGemma2Text.mlmodelc/metadata.json",
2003
+ "size": 82735,
2004
+ "sha256": "695b2a2c9a0bc06ef119328549815e8465a255c8003e0eaf662d2945e01136f6"
2005
+ },
2006
+ {
2007
+ "path": "EmbeddingGemma2Text.mlmodelc/model.mil",
2008
+ "size": 7473257,
2009
+ "sha256": "09754c87e90d48a46dbfdac2b9aa070640bc3582638ad85bf7be2b7a5693a2d7"
2010
+ },
2011
+ {
2012
+ "path": "EmbeddingGemma2Text.mlmodelc/analytics/coremldata.bin",
2013
+ "size": 243,
2014
+ "sha256": "81d44a0c9fe7741747854e8b7b46d0ecd54c603c4d0633dd6f8ca4f668021508"
2015
+ },
2016
+ {
2017
+ "path": "EmbeddingGemma2Text.mlmodelc/weights/weight.bin",
2018
+ "size": 312196800,
2019
+ "sha256": "1536afc085e87791325b8165bd3c9ef6886d10862fe9c19c3d5058415688066f"
2020
+ },
2021
+ {
2022
+ "path": "EmbeddingGemma2Text.mlpackage/Manifest.json",
2023
+ "size": 617,
2024
+ "sha256": "df8ae7c289f64e5804301b493388dd9c529d13587e3863ddc0b70df9ad8b8745"
2025
+ },
2026
+ {
2027
+ "path": "EmbeddingGemma2Text.mlpackage/Data/com.apple.CoreML/model.mlmodel",
2028
+ "size": 7450049,
2029
+ "sha256": "2cfdd356adcef722503953fd65a8d9d9e765097d44f8d05fa6c11a09ba4d8e2a"
2030
+ },
2031
+ {
2032
+ "path": "EmbeddingGemma2Text.mlpackage/Data/com.apple.CoreML/weights/weight.bin",
2033
+ "size": 312196800,
2034
+ "sha256": "1536afc085e87791325b8165bd3c9ef6886d10862fe9c19c3d5058415688066f"
2035
+ },
2036
+ {
2037
+ "path": "EmbeddingGemma2Vision.mlmodelc/coremldata.bin",
2038
+ "size": 689,
2039
+ "sha256": "679f85a67377cd33ae3701c3a23d892a32ccc7b7eb5db35993613b76d03b8f89"
2040
+ },
2041
+ {
2042
+ "path": "EmbeddingGemma2Vision.mlmodelc/metadata.json",
2043
+ "size": 12351,
2044
+ "sha256": "ed7353815cf2677bf39f3fec1140c44f17caa4c6c6fbf43a6c66b3af1527f358"
2045
+ },
2046
+ {
2047
+ "path": "EmbeddingGemma2Vision.mlmodelc/model.mil",
2048
+ "size": 2067962,
2049
+ "sha256": "65c5dfcb7eb44593ff092a87cee27baf29df695cf2c0150ef444c5aae715839c"
2050
+ },
2051
+ {
2052
+ "path": "EmbeddingGemma2Vision.mlmodelc/analytics/coremldata.bin",
2053
+ "size": 243,
2054
+ "sha256": "401bf26776e315d568c0009c52f0262f25d1bcc61fa24e215fb7257070282953"
2055
+ },
2056
+ {
2057
+ "path": "EmbeddingGemma2Vision.mlmodelc/weights/weight.bin",
2058
+ "size": 304078400,
2059
+ "sha256": "5b5b6dd8d80aa438bf91ba143fbe90d56a2e25bfcf685a56b990aad71cf75232"
2060
+ },
2061
+ {
2062
+ "path": "EmbeddingGemma2Vision.mlpackage/Manifest.json",
2063
+ "size": 617,
2064
+ "sha256": "376afe7b51608637312cd15a0a89b1d7863f9779502aaf5f12fa6b14c4272d8d"
2065
+ },
2066
+ {
2067
+ "path": "EmbeddingGemma2Vision.mlpackage/Data/com.apple.CoreML/model.mlmodel",
2068
+ "size": 2053174,
2069
+ "sha256": "0085b5e04a13d000fe5969adeaa13d897f5a3cb7be60c76c8685c023747f89ef"
2070
+ },
2071
+ {
2072
+ "path": "EmbeddingGemma2Vision.mlpackage/Data/com.apple.CoreML/weights/weight.bin",
2073
+ "size": 304078400,
2074
+ "sha256": "5b5b6dd8d80aa438bf91ba143fbe90d56a2e25bfcf685a56b990aad71cf75232"
2075
+ }
2076
+ ]
2077
+ }
position_embeddings.f16 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:17de9480acc23638c0634a97ed89e51ed664433256d7d6f109587dcd91c79124
3
+ size 3145728
selftest.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1ae9d6e81d6eac8da5640182f4363803661b55d14d49a9b46ab7ba8be45524b1
3
+ size 1709760
selftest.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4d777ef5bdc1aa36227abdfb77c3e49e7b9c892d16e1b6bda41c393504828be4
3
+ size 32170510