Card: base_model_relation: quantized (so the conversion lists under the base model's Quantizations, not Finetunes)
2ad5b26 verified |
Download README.md from mlboydaisuke/SigLIP2-base-patch16-224-ExecuTorch: direct link, hf CLI and curl.
- Browser
- Download file 3.63 kB
-
https://huggingface.co/mlboydaisuke/SigLIP2-base-patch16-224-ExecuTorch/resolve/main/README.md
- Command line
-
hf download hf://mlboydaisuke/SigLIP2-base-patch16-224-ExecuTorch/README.md
-
curl -L -o README.md https://huggingface.co/mlboydaisuke/SigLIP2-base-patch16-224-ExecuTorch/resolve/main/README.md
3.63 kB
| license: apache-2.0 | |
| tags: | |
| - executorch | |
| - xnnpack | |
| - pte | |
| - on-device | |
| - zero-shot-image-classification | |
| base_model: | |
| - google/siglip2-base-patch16-224 | |
| base_model_relation: quantized | |
| # siglip2_base_p16_image β ExecuTorch | |
| - **Source**: google/siglip2-base-patch16-224 | |
| - **License**: Apache-2.0 | |
| - **Input**: [[1, 3, 224, 224]] β RGB scaled to [-1, 1] (mean .5, std .5), 224x224 | |
| - **Output**: image embedding [1,768] from the attention pooler (unnormalized; L2-normalize before cosine) | |
| ## Variants | |
| All variants take and return fp32 tensors β swap the `.pte` file, keep your app code. | |
| | build | file | size (MB) | parity vs fp32 eager (worst corr) | Mac median (ms)* | | |
| |-----------|------|-----------|------------------------------------|------------------| | |
| | fp32 | `siglip2_base_p16_image_xnnpack_fp32.pte` | 371.7 | 0.999994 | 195.6 | | |
| | fp16 | `siglip2_base_p16_image_xnnpack_fp16.pte` | 187.3 | 0.999986 | 227.8 | | |
| | Core ML (fp16, iOS) | `siglip2_base_p16_image_coreml_all.pte` | 185.1 | 0.999806 | 4.4 | | |
| The Core ML build is the same graph lowered to Apple's Neural Engine instead of | |
| XNNPACK, which is CPU-only. Measured on an iPhone 17 Pro across seven models, it | |
| runs **3.5x to 13.9x faster (median 12x)** at roughly half the file size β for | |
| example Depth-Anything-V2-Small at 500.8 ms against 42.7 ms, and MODNet at 81.7 ms | |
| against 5.9 ms. It computes in fp16 and is iOS-only; the XNNPACK files stay the | |
| portable option and are what runs on Android. | |
| \*Mac arm64, single process, median of 10 β a reference point for relative cost | |
| only, not a device number (torch eager fp32 on the same machine: 34.4 ms). | |
| ### Checked in the task's own units | |
| Correlation is a first filter, and on an embedding it is a weak one: a build can read | |
| 0.999 against eager and still move an answer, because what decides is whether the error is | |
| smaller than the gap between the answer a query gets and the runner-up. | |
| The test is **near-duplicate retrieval** over 52 photographs, each also present centre-cropped to 90% and re-encoded as JPEG. Every item has one obviously | |
| correct nearest neighbour, and each build has to find it. | |
| | build | correct neighbour kept | worst score shift | budget spent | | |
| |---|---|---|---| | |
| | fp32 | 104 of 104 | 0.0015 | 5% | | |
| | fp16 | 104 of 104 | 0.0015 | 5% | | |
| | Core ML (fp16, iOS) | 104 of 104 | 0.0083 | 28% | | |
| The closest decision eager makes on this set is **0.0298**, and the bar is half of | |
| it. An earlier version of this card cleared int8 on "cosine similarity of the embeddings", | |
| which is correlation wearing a task metric's clothes β it never asked whether a retrieval | |
| answer moved. | |
| ## Verification (executorch 1.4.0, torch 2.13.0) | |
| Parity is measured against the fp32 eager model on real image input; `corr` is | |
| the correlation over all elements of each output tensor. | |
| | output | shape | max_abs_diff | corr | | |
| |--------|-------|--------------|------| | |
| | 0 | [1, 768] | 1.195e-02 | 0.999994 | | |
| XNNPACK delegate coverage (fp32): 68.6% (395/576 ops); ops left on the portable kernels: `aten.expand_copy.default` x48, `aten.native_layer_norm.default` x26, `aten.mul.Scalar` x24, `aten.logical_not.default` x24, `aten.eq.Scalar` x12, `aten.full_like.default` x12, `aten.any.dim` x12, `aten.where.self` x12, `aten.select_copy.int` x3, `aten.split_with_sizes_copy.default` x2, `aten.addmm.default` x2, `aten.repeat.default` x1, `aten.embedding.default` x1, `aten.unsqueeze_copy.default` x1, `aten.squeeze_copy.dims` x1 | |
| ## Conversion | |
| torch.export -> to_edge_transform_and_lower(partitioner) -> .pte | |
| (conversion scripts: [executorch-models](https://github.com/john-rocky/executorch-models)) | |