dinov2_vits14 β€” ExecuTorch

  • Source: facebookresearch/dinov2 (torch.hub)
  • License: Apache-2.0
  • Input: [[1, 3, 518, 518]] β€” RGB, ImageNet norm, 518x518
  • Output: cls token [1,384], patch tokens [1,1369,384]

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 dinov2_vits14_xnnpack_fp32.pte 88.4 1.000000 159.0
fp16 dinov2_vits14_xnnpack_fp16.pte 44.8 0.999945 283.7
Core ML (fp16, iOS) dinov2_vits14_coreml_all.pte 44.7 0.999863 41.2

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: 50.8 ms).

Checked in the task's own units

Correlation is a first filter, and on an embedding it is a weak one. 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: each of 52 photographs appears twice, once as itself and once centre-cropped to 90% and re-encoded as JPEG, and every build has to match each copy back to its own original.

build copies matched to their original worst score shift budget spent
fp32 104 / 104 0.0000 0%
fp16 104 / 104 0.0050 8%
Core ML 104 / 104 0.0086 15%

The closest decision eager makes on this set β€” the gap between the right original and the next-best image β€” is 0.0595, and the bar is half of it.

Withdrawn: int8 (2026-08-27)

dinov2_vits14_xnnpack_int8.pte was published and has been withdrawn. It was cleared on the wrong number: an earlier card entry read "cosine similarity of the embeddings, median 0.9986 over 10 real images", which is correlation wearing a task metric's clothes β€” it never asked whether a retrieval answer moved.

Re-measured on the test above, it still matches all 104 copies to their originals, but it moves a pair score by 0.0375 against a closest decision of 0.0595 β€” 63% of the room available, against a bar of 50%. And that number is generous: this shelf calibrated the int8 build on these same photographs, so scoring it here flatters it.

At 24.9 MB it was the smallest build and the reason to reach for it was size. fp16 is 44.8 MB and spends 8% of the same budget.

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, 384] 3.219e-05 1.000000
1 [1, 1369, 384] 4.311e-04 1.000000

XNNPACK delegate coverage (fp32): 66.7% (414/621 ops); ops left on the portable kernels: aten.expand_copy.default x49, aten.squeeze_copy.dims x36, aten.native_layer_norm.default x25, 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 x1

Conversion

torch.export -> to_edge_transform_and_lower(partitioner) -> .pte (conversion scripts: executorch-models)

Downloads last month
54
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for mlboydaisuke/DINOv2-ViT-S14-ExecuTorch

Quantized
(7)
this model

Collection including mlboydaisuke/DINOv2-ViT-S14-ExecuTorch