Views
No views yet
input_ids and attention_mask, both [1, 256] int64[1, 384], mean-pooled and L2-normalised inside the graph1_Pooling/config.json and modules.json rather than inferred from the family name.
Getting it wrong does not throw; it returns vectors that look fine and rank wrong.query: in front of the text and expects it at
inference. That happens before tokenisation, so the .pte never sees it as anything
but tokens — and leaving it out does not throw. It returns a plausible vector that
retrieves worse.| build | file | size (MB) | Mac ms* | backend takes | worst cosine vs eager | retrieval budget |
|---|---|---|---|---|---|---|
| fp32 | embed_multilingual_e5_small_xnnpack_fp32.pte | 470.2 | 21.3 | 78.5% | 1.000000 | 0% |
| fp16 | embed_multilingual_e5_small_xnnpack_fp16.pte | 235.2 | 31.4 | 67.6% | 1.000000 | 1% |
| Core ML (fp16, iOS) | embed_multilingual_e5_small_coreml_all.pte | 235.8 | 3.9 | 100.0% | 0.999979 | 15% |
F.scaled_dot_product_attention does not survive export as one operation. The edge
dialect lowers it through _safe_softmax, whose guard against a row with no unmasked key
at all leaves 11 operations XNNPACK cannot take, in every attention
block — scalar_tensor, where, mul.Scalar, logical_not, eq, full_like, any.dim. Each one cuts the subgraph in two.attn_implementation="eager": transformers then builds the mask
itself, as torch.finfo(dtype).min, instead of handing F.sdpa a boolean mask
for PyTorch to fill with -inf.-inf, and this arm never produces one. So the two differ only about rows that have no
unmasked key at all — sdpa zeroes them, this one gives them a uniform row — and those are
padding rows, which the pooling discards and which every real query row masks out anyway.
Measured with all but eight positions masked, as adversarial as this shape gets, the two
graphs agree to 1.4e-07.embed_multilingual_e5_small_xnnpack_int8.pte is 406.7 MB against fp16's 235.2 MB. Dynamic int8 quantises the
linear weights and leaves the token embedding table in fp32, and here that table is
384 MB of the 470.2 MB model — 82%. The size a build comes out at is
0.5 + 1.5 x (table share) times the fp16 build; at 82% that is
1.73, so there was never a smaller file to be had.