Ben Graville commited on
README: EXPERIMENTAL int8 bundle
Browse files
README.md
CHANGED
|
@@ -37,3 +37,32 @@ Core AI cannot execute on Linux; the on-device parity gate runs on macOS against
|
|
| 37 |
Derivative of EmbeddingGemma; use is subject to the
|
| 38 |
[Gemma Terms of Use](https://ai.google.dev/gemma/terms) and the
|
| 39 |
[Gemma Prohibited Use Policy](https://ai.google.dev/gemma/prohibited_use_policy).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
Derivative of EmbeddingGemma; use is subject to the
|
| 38 |
[Gemma Terms of Use](https://ai.google.dev/gemma/terms) and the
|
| 39 |
[Gemma Prohibited Use Policy](https://ai.google.dev/gemma/prohibited_use_policy).
|
| 40 |
+
|
| 41 |
+
|
| 42 |
+
## EXPERIMENTAL - int8 graph-compressed bundle (`int8/`)
|
| 43 |
+
|
| 44 |
+
> **EXPERIMENTAL. Do not use for production embeddings until vector-parity has been
|
| 45 |
+
> qualified on a Mac against the fp32 bundle above.** No numerics gate has been run on
|
| 46 |
+
> this artifact: the conversion box is Linux with no GPU delegate, so nothing here has
|
| 47 |
+
> produced a vector.
|
| 48 |
+
|
| 49 |
+
`int8/embeddinggemma-300m_int8_static.aimodel` is the fp32 bundle in
|
| 50 |
+
`model/` (this repo @ `2bee70c5bc49cafc3c9e7f88d4d0095508cbfd4b`) put through **`coreai_opt.coreai_utils.quantize_weights`
|
| 51 |
+
with `dtype=INT8`** - a Core AI *graph* compression pass that rewrites the weight
|
| 52 |
+
constants of an existing `.aimodel` in place. There is **no PyTorch round-trip and no
|
| 53 |
+
re-export**: the graph, the input signature (`seq_len 256`, 768-d output) and the
|
| 54 |
+
tokenizer are the fp32 bundle's.
|
| 55 |
+
|
| 56 |
+
| | fp32 (`model/`) | int8 (`int8/`) |
|
| 57 |
+
|---|---|---|
|
| 58 |
+
| `main.mlirb` | 1,244,157,766 B | 323,252,231 B |
|
| 59 |
+
| ratio | 1.00x | **0.26x** |
|
| 60 |
+
| producer | `coreai-core 1.0.0b2` | `coreai-core 1.0.0b2` |
|
| 61 |
+
|
| 62 |
+
The `reference.json` and `tokenizer/` beside it are byte-identical copies of the fp32
|
| 63 |
+
bundle's, carried so the folder is self-contained.
|
| 64 |
+
|
| 65 |
+
**Qualification gate before any use:** embed a fixed corpus with both bundles on a Mac
|
| 66 |
+
and compare vectors (cosine similarity per vector and retrieval-rank agreement), not
|
| 67 |
+
just spot-check output shapes. fp16 embeddinggemma is already known to fail vector
|
| 68 |
+
precision parity; int8 has not been shown to pass.
|