DINOv3 ConvNeXt
Meta's DINOv3 distilled into ConvNeXt backbones (T, S, B, L): image features. Needs the gated DINOv3 licence.
stable Fork of huggingface/[email protected] · backends: portable, kernels
- Paper DINOv3 arXiv · first released 13 Aug 2025
- Authors’ code facebookresearch/dinov3 (PyTorch), not the code forked here: The weights are Meta's, but we load the Hugging Face transformers format and port its model code rather than Meta's repo.
Paper 2025 Added in 0.1.0 Evaluated with 0.2.0
Use it
pip install fastforks Lean install with only what this model needs: pip install fastforks-core
from fastforks import features
model = features.load("dinov3-convnext-tiny") # kernels on a supported GPU, else portable PyTorch
result = model(image)
result.last_hidden_state # also: pooler_output
result.backend # what ran: mode, device, dtype, kernels fastforks bench dinov3-convnext-tiny Times the model on this machine. load(…, mode="portable") or mode="kernels" picks a backend; usage guide.
Speed and memory
Every backend on one GPU (RTX 5060 Ti 16 GB) and the same input, the authors’ code included. Kernels runs fp16. Portable runs fp16 on CUDA.
Input: synthetic, 224x224 (the task’s standard size)
| Backend | dtype | Time per call (ms) | vs original fp32 | Peak memory allocated / reserved | Load (s) | First call (s) |
|---|---|---|---|---|---|---|
| Original fp32 | fp32 | 2.96 | – | 151 MiB/162 MiB | 0.2 | 0.41 |
| Original fp16Transformers FP16 weights and inputs, pooler output; full kNN accuracy checked | fp16 | 3.60 | 0.82× | 91 MiB/128 MiB | 0.1 | 0.00 |
| Portable fp32 | fp32 | not measured | – | – | – | – |
| Portable | fp16 | 3.04 | 0.97× | 93 MiB/108 MiB | 0.5 | 0.42 |
| Kernels | fp16 | 1.22 | 2.4× | 59 MiB/110 MiB | 0.2 | 0.10 |
| Portable + torch.compile | 1.96 | 1.5× | 123 MiB/148 MiB | 8 (build) | – | |
| TensorRT fp16 | fp16 | 0.681 | 4.3× | 72 MiBenginenot comparable | 23 (build) | – |
Measured on RTX 5060 Ti 16 GB, torch 2.14.1+cu130, 2026-11-01 to 2026-11-17. First call, 3 warm-up, peak reset, median of 3 rounds x median of 5. Ratios divide two
times of this table (same GPU, same input). Original fp16 is the authors’ own precision option, else torch.autocast. torch.compile and TensorRT: build time instead of load time. TensorRT memory (engine, not comparable) is the GPU memory the engine took, read from the driver because TensorRT allocates outside PyTorch, so it can't be compared with the PyTorch peaks of the other rows.
Other devices
| Device | Backend | dtype | ms / call | Peak memory | Output vs reference | Input |
|---|---|---|---|---|---|---|
| Apple M1 Pro 16 GB MPS, torch 2.14.1, 2026-11-13 | Original | fp32 | 13.2 | 579 MiB process | – | 224x224 |
| Portable | fp16 | 10.6 | 431 MiB process | matches | 224x224 | |
| Portable | fp32 | 11.5 | 450 MiB process | matches | 224x224 | |
| Kernels | fp16 | not implemented | – | 224x224 | ||
| NVIDIA L4 CUDA, torch 2.14.1+cu130, 2026-11-07 | Portable | fp16 | 5.03 | 68 MiB/88 MiB | – | 224x224 |
| Kernels | fp16 | 1.46 | 59 MiB/90 MiB | – | 224x224 | |
| NVIDIA L40S CUDA, torch 2.14.1+cu130, 2026-11-07 | Portable | fp16 | 3.47 | 68 MiB/88 MiB | – | 224x224 |
| Kernels | fp16 | 0.965 | 59 MiB/90 MiB | – | 224x224 | |
| NVIDIA A10 CUDA, torch 2.14.1+cu130, 2026-11-07 | Portable | fp16 | 3.09 | 68 MiB/88 MiB | – | 224x224 |
| Kernels | fp16 | 1.34 | 59 MiB/90 MiB | – | 224x224 | |
| NVIDIA A100-SXM4-40GB CUDA, torch 2.14.1+cu130, 2026-11-07 | Portable | fp16 | 3.53 | 68 MiB/88 MiB | – | 224x224 |
| Kernels | fp16 | 1.79 | 59 MiB/90 MiB | – | 224x224 | |
| NVIDIA RTX PRO 6000 CUDA, torch 2.14.1+cu130, 2026-11-08 | Portable | fp16 | 1.07 | 92 MiB/108 MiB | – | 224x224 |
| Kernels | fp16 | 0.973 | 59 MiB/110 MiB | – | 224x224 | |
CUDA memory is torch’s peak allocated / reserved; Apple has no such counter, so the Mac rows show the process footprint (weights, Python and torch included). “Output vs reference” compares the device’s output with the stored golden output under the card’s tolerance; – = not checked on that device. Kernels “not implemented” = no kernels for this model on that backend yet: it runs portable there.
Licence and weights
Commercial use allowed
- Code
- LicenseRef-DINOv3-License LICENSE.md
- Weights
- LicenseRef-DINOv3-License source
- Training data
- distilled from the DINOv3 ViT-7B teacher on LVD-1689M (1.689B images curated from public Instagram images), self-supervised, per the paper; not released
- Code and weights use the DINOv3 License (Meta: attribution and conditions apply); read it before commercial use.
Our reading of the licences, not legal advice.
Weights
dinov3-convnext-tiny-pretrain-lvd1689m/model.safetensors 111 MB· hosted on Hugging Facefastforks downloads and checks these files on first use (fastforks download dinov3-convnext-tiny).
Accuracy
The test set through the authors’ code and through ours: same checkpoint, same protocol. The distance between the original’s fp32 and fp16 runs is what half precision alone costs; our runs should stay within it.
ImageNet-1k val
kNN top-1 % (k = 20, 10000 labelled / 5000 test images)
| Run | dtype | top-1 % ↑ | Δ top-1 % vs fp32 original | images | ms / image |
|---|---|---|---|---|---|
| Original fp32 | fp32 | 62.50 | reference | 5000 | 1.36 |
| Original fp16 | fp16 | 62.50 | ±0.00 | 5000 | 0.690 |
| Portable fp32 | fp32 | 62.52 | +0.02 | 5000 | 1.38 |
| Portable | fp16 | 62.50 | ±0.00 | 5000 | 0.558 |
| Kernels | fp16 | 62.44 | −0.06 | 5000 | 0.333 |
| Original .half() | fp16 | 62.48 | −0.02 | 5000 | 0.638 |
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 authors’ code, same checkpoint and protocol. Measured on original fp32, original fp16: RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-06; portable fp32: RTX 5060 Ti, torch 2.14.1+cu130, fastforks 7c91993, 2026-10-31; portable, kernels: RTX 5060 Ti, torch 2.14.1+cu130, fastforks 939adfe8, 2026-11-06; original .half(): RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-17.
Closeness to the original
Beyond the test-set scores: the raw output of ours against the original’s fp32 output on the same input, pixel by pixel. CPU, float32: max |diff| <= 0.0001 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 1 % and p99 <= 4 % of the reference's median |value| (absolute error of the output last_hidden_state).
| Check | Tolerance | Measured |
|---|---|---|
| CPU fp32, max |diff| | ≤ 0.0001 (relative) | not recorded |
| GPU default dtypes, mean |diff| | ≤ 0.01 (relative) | 0.00491 (relative) |
| GPU default dtypes, p99 |diff| | ≤ 0.04 (relative) | 0.01731 (relative) |
Recorded for dinov3-convnext-tiny on RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-04, with these kernels: fvm_convfvm_seg
Details
DINOv3 ConvNeXt T/S/B/L (Meta, 2025), distilled from the DINOv3 ViT-7B: stride-32 grid features + pooled token (Hugging Face format checkpoints). Gated weights: accept the DINOv3 licence on each model's Hugging Face page, download model.safetensors yourself and put it under FASTFORKS_WEIGHTS_PATH (path and SHA-256 in the load error); fastforks does not send HF_TOKEN there.
- Input / output
- Input: one RGB image. Output: dense patch features and a pooled image feature.
- Input size
- any H x W >= 1, resized or padded inside the model; tested up to 3000x4000 (1,946 MiB allocated)
- Outputs
last_hidden_state,pooler_output- Checkpoint
arch="tiny"- CUDA kernels
fvm_convfused convolutions for image classifiersfvm_segfused kernels for Mask2Former and OneFormer
- Apple (MPS)
- fp32, fp16
Full reference, generated from the repository
Meta's DINOv3 distilled into ConvNeXt backbones (T, S, B, L): image features. Needs the gated DINOv3 licence.
Commercial use: yes.
| variant | input | backend | time (ms) | peak memory (MiB, allocated / reserved) |
|---|---|---|---|---|
dinov3-convnext-tiny | synthetic (224x224) | original (fp32) original portable kernels portable + torch.compile TensorRT fp16 | 2.96 3.60 3.04 1.22 1.96 0.681 | 151 / 162 91 / 128 93 / 108 59 / 110 123 / 148 126 / 158 |
dinov3-convnext-small | synthetic (224x224) | original (fp32) original portable kernels portable + torch.compile TensorRT fp16 | 5.97 6.62 5.42 1.98 3.41 1.17 | 233 / 274 133 / 168 134 / 150 100 / 132 165 / 188 232 / 252 |
dinov3-convnext-base | synthetic (224x224) | original (fp32) original portable kernels portable + torch.compile TensorRT fp16 | 7.38 6.62 5.71 2.19 3.41 1.45 | 384 / 394 207 / 232 208 / 232 174 / 214 241 / 252 400 / 430 |
dinov3-convnext-large | synthetic (224x224) | original (fp32) original portable kernels portable + torch.compile TensorRT fp16 | 10.5 6.72 5.45 3.61 4.30 2.50 | 819 / 898 418 / 430 419 / 430 409 / 452 459 / 470 804 / 824 |
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-convnext-tiny-pretrain-lvd1689m/blob/10d30274b4d445111e2d5bf75ac93bbd94db274b/LICENSE.md (DINOv3 License; gated: accept on Hugging Face to download)
- Training data: distilled from the DINOv3 ViT-7B teacher on LVD-1689M (1.689B images curated from public Instagram images), self-supervised, per the paper; not released
- Licence note: Code and weights use the DINOv3 License (Meta: attribution and conditions apply); read it before commercial use.
- Kernel libraries:
fvm_conv,fvm_seg - Variants:
dinov3-convnext-tiny,dinov3-convnext-small,dinov3-convnext-base,dinov3-convnext-large - Outputs: last_hidden_state, pooler_output
- Input size: any H x W >= 1, resized or padded inside the model
- Tested up to (portable, fp16, RTX 5060 Ti 16 GB):
dinov3-convnext-tiny3000x4000 (1.9 GiB peak allocated, 2.6 reserved);dinov3-convnext-small3000x4000 (1.9 GiB peak allocated, 2.6 reserved);dinov3-convnext-base3000x4000 (2.5 GiB peak allocated, 3.5 reserved);dinov3-convnext-large3000x4000 (3.7 GiB peak allocated, 5.1 reserved) dinov3-convnext-tiny224x224, first call: portable + torch.compile 8 s (cold Inductor cache), TensorRT fp16 23 s (ONNX + engine).dinov3-convnext-small224x224, first call: portable + torch.compile 11 s (cold Inductor cache), TensorRT fp16 26 s (ONNX + engine).dinov3-convnext-base224x224, first call: portable + torch.compile 11 s (cold Inductor cache), TensorRT fp16 30 s (ONNX + engine).dinov3-convnext-large224x224, first call: portable + torch.compile 11 s (cold Inductor cache), TensorRT fp16 30 s (ONNX + engine).dinov3-convnext-tinyoriginal 224x224: Transformers FP16 weights and inputs, pooler output; full kNN accuracy checkeddinov3-convnext-smalloriginal 224x224: Transformers FP16 weights and inputs, pooler output; full kNN accuracy checkeddinov3-convnext-baseoriginal 224x224: Transformers FP16 weights and inputs, pooler output; full kNN accuracy checkeddinov3-convnext-largeoriginal 224x224: Transformers FP16 weights and inputs, pooler output; full kNN accuracy checkeddinov3-convnext-tinyload / first call: original 0.43 s / 1.034 s, portable 0.48 s / 0.417 s, kernels 0.08 s / 0.124 sdinov3-convnext-smallload / first call: original 0.27 s / 0.01 s, portable 0.25 s / 0.334 s, kernels 0.11 s / 0.074 sdinov3-convnext-baseload / first call: original 0.42 s / 0.015 s, portable 0.43 s / 0.27 s, kernels 0.19 s / 0.104 sdinov3-convnext-largeload / first call: original 1.64 s / 0.017 s, portable 0.85 s / 0.241 s, kernels 0.38 s / 0.2 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 | original half | portable | portable fp32 | kernels | note |
|---|---|---|---|---|---|---|---|---|
dinov3-convnext-tiny | ImageNet-1k val, kNN top-1 % (k = 20, 10000 labelled / 5000 test images) | 62.50 | 62.50 | 62.48 | 62.50 | 62.52 | 62.44 | |
dinov3-convnext-small | ImageNet-1k val, kNN top-1 % (k = 20, 10000 labelled / 5000 test images) | 67.14 | 67.16 | 67.18 | 67.14 | 67.16 | 67.16 | |
dinov3-convnext-base | ImageNet-1k val, kNN top-1 % (k = 20, 10000 labelled / 5000 test images) | 69.84 | 69.88 | 69.84 | 69.84 | 69.84 | 69.88 | |
dinov3-convnext-large | ImageNet-1k val, kNN top-1 % (k = 20, 10000 labelled / 5000 test images) | 73.30 | 73.32 | 73.32 | 73.30 | 73.30 | 73.28 |
Measured on portable: NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 939adfe8, 2026-11-06; portable32: NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 7c91993, 2026-10-31; kernels: 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 % and p99 <= 4 % 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-convnext-tiny | 0.00491 / 0.01731 | RTX 5060 Ti, torch 2.14.1+cu130 | fvm_conv@f1d064e539e1:sm_120, fvm_seg@739693dff3b4:sm_120 |
dinov3-convnext-small | 0.00412 / 0.01531 | RTX 5060 Ti, torch 2.14.1+cu130 | fvm_conv@f1d064e539e1:sm_120, fvm_seg@739693dff3b4:sm_120 |
dinov3-convnext-base | 0.0054 / 0.0206 | RTX 5060 Ti, torch 2.14.1+cu130 | fvm_conv@f1d064e539e1:sm_120, fvm_seg@739693dff3b4:sm_120 |
dinov3-convnext-large | 0.0057 / 0.02671 | RTX 5060 Ti, torch 2.14.1+cu130 | fvm_conv@f1d064e539e1:sm_120, fvm_seg@739693dff3b4:sm_120 |
Example output
One fixed input through this checkpoint, the same for every model of the task (kernels · float16 · NVIDIA GeForce RTX 5060 Ti).
Input: Chelsea the cat, Stéfan van der Walt (CC0).