DINOv3 ViT
Meta's DINOv3 vision transformers: self-supervised image features with register tokens and RoPE. Needs the gated DINOv3 licence.
Commercial use: yes.
| variant | input | backend | time (ms) | peak memory (MiB, allocated / reserved) |
|---|---|---|---|---|
dinov3-vits16 | synthetic (224x224) | original (fp32) original portable kernels portable + torch.compile TensorRT fp16 | 6.47 9.16 4.67 0.903 2.18 0.564 | 119 / 132 158 / 166 77 / 80 77 / 106 109 / 138 64 (engine) |
dinov3-vitb16 | synthetic (224x224) | original (fp32) original portable kernels | 6.95 9.33 4.86 1.40 | 367 / 390 527 / 550 201 / 206 201 / 252 |
dinov3-vitl16 | synthetic (224x224) | original (fp32) original portable kernels | 19.2 17.7 9.13 3.28 | 1199 / 1212 1772 / 1812 617 / 646 617 / 674 |
dinov3-vith16plus | synthetic (224x224) | original (fp32) original portable kernels | 48.0 25.9 13.3 9.30 | 3255 / 3276 4849 / 4876 1645 / 1668 1644 / 1694 |
Details
- Original code: https://github.com/huggingface/transformers at
v5.19.0 - Code licence: LicenseRef-DINOv3-License (permissive); files:
LICENSE.md - Weights licence: LicenseRef-DINOv3-License
- Licence evidence: https://huggingface.co/facebook/dinov3-vits16-pretrain-lvd1689m/blob/114c1379950215c8b35dfcd4e90a5c251dde0d32/LICENSE.md (DINOv3 License, the same file in every model repo; gated: accept on Hugging Face to download)
- Training data: LVD-1689M: 1.689B images curated from 17B public Instagram images by retrieval / clustering, self-supervised (no labels), per the paper; not released
- Licence note: Code and weights use the DINOv3 License (Meta: attribution and conditions apply); read it before commercial use.
- Options:
fp16_accumulate= False (precision only) - Kernel libraries:
fastbb - Variants:
dinov3-vits16,dinov3-vitb16,dinov3-vitl16,dinov3-vith16plus - Outputs: last_hidden_state, pooler_output, hidden_states
- Input size: any H x W >= 1, resized or padded inside the model
- Tested up to (portable, fp16, RTX 5060 Ti 16 GB):
dinov3-vits163000x4000 (1.0 GiB peak allocated, 1.2 reserved);dinov3-vitb163000x4000 (1.6 GiB peak allocated, 2.0 reserved);dinov3-vitl163000x4000 (2.4 GiB peak allocated, 2.9 reserved);dinov3-vith16plus3000x4000 (4.2 GiB peak allocated, 4.9 reserved) dinov3-vits16224x224, first call: portable + torch.compile 9 s (cold Inductor cache), TensorRT fp16 25 s (ONNX + engine).dinov3-vits16original 224x224: torch.autocast(fp16) around the forwarddinov3-vitb16original 224x224: torch.autocast(fp16) around the forwarddinov3-vitl16original 224x224: torch.autocast(fp16) around the forwarddinov3-vith16plusoriginal 224x224: torch.autocast(fp16) around the forwarddinov3-vits16load / first call: original 0.48 s / 0.947 s, portable 0.07 s / 0.271 s, kernels 0.06 s / 0.259 sdinov3-vitb16load / first call: original 0.68 s / 0.012 s, portable 0.38 s / 0.198 s, kernels 0.16 s / 0.291 sdinov3-vitl16load / first call: original 2.37 s / 0.023 s, portable 0.54 s / 0.18 s, kernels 0.52 s / 0.246 sdinov3-vith16plusload / first call: original 5.95 s / 0.046 s, portable 2.02 s / 0.099 s, kernels 1.4 s / 0.202 s- Protocol, first call, 3 warm-up, peak reset, median of 3 rounds x median of 5
Measured
Two disjoint seeded subsets of the val folders; each image shorter side 256 (bicubic), centre crop 224, the CLS / pooled feature; cosine kNN, vote weighted by similarity. Original = the original code named under Details, same checkpoint and protocol.
| variant | dataset | original fp32 | original fp16 | portable | kernels | note |
|---|---|---|---|---|---|---|
dinov3-vits16 | ImageNet-1k val, kNN top-1 % (k = 20, 10000 labelled / 5000 test images) | 55.38 | 55.42 | 55.42 | 55.36 | |
dinov3-vitb16 | ImageNet-1k val, kNN top-1 % (k = 20, 10000 labelled / 5000 test images) | 66.54 | 66.54 | 66.52 | 66.54 | |
dinov3-vitl16 | ImageNet-1k val, kNN top-1 % (k = 20, 10000 labelled / 5000 test images) | 75.94 | 75.92 | 75.80 | 75.88 | |
dinov3-vith16plus | ImageNet-1k val, kNN top-1 % (k = 20, 10000 labelled / 5000 test images) | 79.50 | 79.50 | 79.52 | 79.52 |
Measured on NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 939adfe8, 2026-11-06.
Parity
CPU, float32: max |diff| <= 0.0001 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 1.5 % and p99 <= 6 % of the reference's median |value| (absolute error of the output last_hidden_state).
| variant | kernels error vs original, mean / p99 | GPU, torch | kernels used |
|---|---|---|---|
dinov3-vits16 | 0.00418 / 0.01399 | RTX 5060 Ti, torch 2.14.1+cu130 | fastbb@7d058322634d:sm_120 |
dinov3-vitb16 | 0.00562 / 0.01956 | RTX 5060 Ti, torch 2.14.1+cu130 | fastbb@7d058322634d:sm_120 |
dinov3-vitl16 | 0.00773 / 0.02994 | RTX 5060 Ti, torch 2.14.1+cu130 | fastbb@7d058322634d:sm_120 |
dinov3-vith16plus | 0.00567 / 0.0234 | RTX 5060 Ti, torch 2.14.1+cu130 | fastbb@7d058322634d:sm_120 |
Limitations
- kernels replays a CUDA graph per small input shape and layer set (up to 512 px, ViT-S 1024 px), captured on the shape's second call; at most 8 per model holding at most 256 MB of outputs (a full cache replaces only graphs unused for 64 calls, other new shapes run eagerly).
- The graphs' shared memory pool (intermediates) comes on top of that limit and stays reserved: up to about 470 MB more PyTorch cache than eager for ViT-H+ at 512 px with all layers, usually under 75 MB;
model.release_graphs()frees it on the device.