Models · Feature backbones

CLIP

CLIP image encoders from OpenAI and OpenCLIP (LAION-2B, DataComp-XL, DFN; B, L, H): image features aligned with text.

stable Fork of huggingface/pytorch-image-models@0df212b · backends: portable, kernels

Checkpoint

Paper 2021 Added in 0.2.0 Evaluated with 0.2.0

Kernels, RTX 5060 Ti 16 GB 1.36 ms 224x224, fp16
vs the faster original 4.2× original fp16: 5.65 ms
Peak memory 203 MiB original: 544 MiB
Accuracy vs original fp32 +0.02 kernels top-1 %, ImageNet-1k val (51.98 original)

Use it

pip install fastforks

Lean install with only what this model needs: pip install "fastforks-core[timm]"

from fastforks import features

model = features.load("clip-b16-openai")  # kernels on a supported GPU, else portable PyTorch
result = model(image)
result.last_hidden_state  # also: pooler_output, hidden_states
result.backend  # what ran: mode, device, dtype, kernels
fastforks bench clip-b16-openai

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)

BackenddtypeTime per call (ms)vs original fp16Peak memory
allocated / reserved
Load (s)First call (s)
Original fp32timm 1.0.30 create_model(dynamic_img_size=True), forward_head(pre_logits=True)fp32 6.280.90×371 MiB/418 MiB16.70.12
Original fp16torch.autocast(fp16) around the forward; timm 1.0.30 create_model(dynamic_img_size=True), forward_head(pre_logits=True)fp16 5.65–544 MiB/580 MiB16.70.09
Portable fp32fp32not measured ––––
Portablefp16 3.351.7×204 MiB/226 MiB–0.07
Kernelsfp16 1.364.2×203 MiB/250 MiB2.30.06
Portable + torch.compile 2.392.4×237 MiB/266 MiB6 (build)–
TensorRT fp16fp16 1.115.1×196 MiBenginenot comparable15 (build)–

Measured on RTX 5060 Ti 16 GB, torch 2.14.1+cu130, 2026-11-10 to 2026-11-15. 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

DeviceBackenddtypems / callPeak memoryOutput vs referenceInput
Apple M1 Pro 16 GB MPS, torch 2.14.1, 2026-11-13Originalfp3218.5 1,592 MiB process–224x224
Portablefp1616.1 1,724 MiB processmatches224x224
Portablefp3217.5 1,563 MiB processmatches224x224
Kernelsfp16not implemented–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
Apache-2.0
Weights
MIT source
Training data
WIT: 400M image-text pairs collected from the web by OpenAI (CLIP paper); not released

Our reading of the licences, not legal advice.

Weights

vit_base_patch16_clip_224.openai.safetensors 599 MB· hosted on Hugging Face

fastforks downloads and checks these files on first use (fastforks download clip-b16-openai).

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)

Rundtypetop-1 % ↑Δ top-1 % vs fp32 originalimagesms / image
Original fp32fp3251.98 reference 5000 3.94
Original fp16fp1652.00 +0.02 5000 1.30
Portable fp32not measured
Portablefp1652.00 +0.02 5000 1.14
Kernelsfp1652.00 +0.02 5000 0.622

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-11; portable, kernels: RTX 5060 Ti, torch 2.14.1+cu130, fastforks 8bce3316, 2026-11-11.

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| <= 9.9 % and p99 <= 87 % of the reference's median |value| (absolute error of the output last_hidden_state).

CheckToleranceMeasured
CPU fp32, max |diff|≤ 0.0001 (relative)not recorded
cpu_rtol≤ 0.00002 (relative)not recorded
GPU default dtypes, mean |diff|≤ 0.099 (relative)0.02117 (relative)
GPU default dtypes, p99 |diff|≤ 0.87 (relative)0.12801 (relative)

Recorded for clip-b16-openai on RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-13, with these kernels: cudnn_haccfvm_convfvm_extrafvm_mbfvm_r3

Details

CLIP image towers (Radford et al. 2021): OpenAI, OpenCLIP (LAION-2B, DataComp-1B) and Apple DFN weights in timm's format; cls + patch tokens at any size, pooler_output = the post-LayerNorm cls token before the projection (QuickGELU for the OpenAI and DFN weights).

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,988 MiB allocated)
Options
  • fp16_accumulate=false
  • fp32_accumulate=false
Outputs
last_hidden_state, pooler_output, hidden_states
Checkpoint
arch="vit_base_patch16_clip_quickgelu_224.openai"
CUDA kernels
  • cudnn_haccconvolutions with fp16 accumulation (cuDNN)
  • fvm_convfused convolutions for image classifiers
  • fvm_extrafused transformer row operations (rotary split, SwiGLU with LayerNorm)
  • fvm_mbfused MBConv blocks (MobileNet and EfficientNet families)
  • fvm_r3further fused classifier blocks
Apple (MPS)
fp32, fp16

Limitations

  • kernels replays a CUDA graph per small input shape without hidden states (up to about 1M activations: ViT-B ~460 px, ViT-L ~300 px), captured on the shape's second call, at most 4 per model; `model.release_graphs()` frees them.
  • Small kernels calls (graph-sized, with or without `layers`) run GEMMs of at most 600 tokens on cuBLAS: faster in a graph replay (ViT-B/16 224 px: 1.26 against 1.52 ms), about 10 % slower eagerly on ViT-T / B; a replay equals the eager call bit for bit.
  • `fp32_accumulate = true` puts every GEMM on cuBLAS with fp32 accumulation (the portable precision; slower on GeForce).
  • fp16 error against the fp32 original is higher than for the other ViTs on L/14 DataComp (mean 2.8 % portable, 4.8 % kernels): one residual channel sits near 120, where fp16 steps are 0.06, about 10 % of the median activation. No overflow; float32 portable gives 0.3 %.
  • DFN weights: the relative error (mean 1.3-3.9 % portable, 3.9-6.5 % kernels) is measured against a median |output| of only 0.015-0.021 (other weights: 0.5-0.6) with values up to 0.7; `fp32_accumulate = true` lowers kernels to about 1.5 %.
  • Kernels at 224 x 224 peak above portable (B/16 257 vs 204 MB, L/14 814 vs 623 MB; original 544 / 1779 MB): the QuickGELU fold keeps a folded copy of each fc2 weight next to the original parameter, and the second call's CUDA-graph capture adds ~30 MB.
Full reference, generated from the repository

CLIP image encoders from OpenAI and OpenCLIP (LAION-2B, DataComp-XL, DFN; B, L, H): image features aligned with text.

Commercial use: clip-b16-openai, clip-l14-openai, clip-l14-336-openai, clip-b16-laion2b, clip-l14-laion2b, clip-h14-laion2b, clip-l14-datacompxl: yes; clip-l14-dfn2b, clip-h14-dfn5b, clip-h14-378-dfn5b: no (weights: LicenseRef-Apple-AMLR).

variantinputbackendtime (ms)peak memory (MiB, allocated / reserved)
clip-b16-openaisynthetic (224x224)original (fp32)
original
portable
kernels
portable + torch.compile
TensorRT fp16
6.28
5.65
3.35
1.36
2.39
1.11
371 / 418
544 / 580
204 / 226
203 / 250
237 / 266
394 / 422
clip-l14-openaisynthetic (224x224)original (fp32)
original
portable
kernels
portable + torch.compile
TensorRT fp16
22.0
10.8
6.16
4.76
6.17
4.14
1210 / 1214
1779 / 1812
623 / 666
622 / 690
658 / 686
1230 / 1280
clip-l14-336-openaisynthetic (224x224)original (fp32)
original
portable
kernels
portable + torch.compile
TensorRT fp16
22.1
10.8
6.16
4.76
6.36
4.25
1211 / 1236
1779 / 1814
625 / 646
622 / 668
658 / 686
1235 / 1264
clip-b16-laion2bsynthetic (224x224)original (fp32)
original
portable
kernels
portable + torch.compile
TensorRT fp16
6.22
5.29
3.09
1.36
2.41
1.12
369 / 418
544 / 580
202 / 226
203 / 230
237 / 266
394 / 422
clip-l14-laion2bsynthetic (224x224)original (fp32)
original
portable
kernels
portable + torch.compile
TensorRT fp16
21.6
10.1
5.98
4.76
6.19
4.19
1205 / 1214
1779 / 1812
621 / 666
622 / 670
658 / 686
1232 / 1282
clip-h14-laion2bsynthetic (224x224)original (fp32)
original
portable
kernels
portable + torch.compile
TensorRT fp16
47.2
19.3
11.2
8.27
11.6
7.84
2524 / 2580
3720 / 4032
1249 / 1268
1250 / 1272
1289 / 1310
2467 / 2492
clip-l14-datacompxlsynthetic (224x224)original (fp32)
original
portable
kernels
portable + torch.compile
TensorRT fp16
21.6
10.1
5.99
4.76
6.24
4.19
1205 / 1214
1779 / 1812
621 / 666
622 / 670
658 / 686
1232 / 1282
clip-l14-dfn2bsynthetic (224x224)original (fp32)
original
portable
kernels
portable + torch.compile
TensorRT fp16
22.0
10.6
6.16
4.76
6.16
4.14
1210 / 1214
1779 / 1812
623 / 666
622 / 690
658 / 686
1230 / 1280
clip-h14-dfn5bsynthetic (224x224)original (fp32)
original
portable
kernels
portable + torch.compile
TensorRT fp16
47.5
19.4
11.4
8.54
11.5
7.76
2529 / 2600
3720 / 4038
1252 / 1268
1250 / 1292
1289 / 1310
2465 / 2490
clip-h14-378-dfn5bsynthetic (224x224)original (fp32)
original
portable
kernels
portable + torch.compile
TensorRT fp16
47.9
19.5
11.4
8.24
11.8
7.85
2530 / 2600
3722 / 4038
1254 / 1288
1251 / 1312
1290 / 1328
2468 / 2510
Details
  • Original code: https://github.com/huggingface/pytorch-image-models at 0df212b369a5
  • Code licence: Apache-2.0 (permissive); files:
  • Weights licence: MIT
    • clip-l14-dfn2b: LicenseRef-Apple-AMLR
    • clip-h14-dfn5b: LicenseRef-Apple-AMLR
    • clip-h14-378-dfn5b: LicenseRef-Apple-AMLR
  • Licence evidence: https://huggingface.co/timm/vit_large_patch14_clip_336.openai/blob/81e38efc4637de5023b10e75a7f9bd1c6fa6b010/README.md
  • Training data: not stated by the authors
    • clip-b16-openai: WIT: 400M image-text pairs collected from the web by OpenAI (CLIP paper); not released
    • clip-l14-openai: WIT: 400M image-text pairs collected from the web by OpenAI (CLIP paper); not released
    • clip-l14-336-openai: WIT: 400M image-text pairs collected from the web by OpenAI (CLIP paper); not released
    • clip-b16-laion2b: LAION-2B-en (web image-text pairs filtered by CLIP similarity)
    • clip-l14-laion2b: LAION-2B-en (web image-text pairs filtered by CLIP similarity)
    • clip-h14-laion2b: LAION-2B-en (web image-text pairs filtered by CLIP similarity)
    • clip-l14-datacompxl: DataComp-1B (filtered from the CommonPool-12.8B web image-text pool)
    • clip-l14-dfn2b: DFN-2B / DFN-5B: CommonPool-12.8B (and further web pairs for 5B) filtered by Apple's data-filtering network; not released
    • clip-h14-dfn5b: DFN-2B / DFN-5B: CommonPool-12.8B (and further web pairs for 5B) filtered by Apple's data-filtering network; not released
    • clip-h14-378-dfn5b: DFN-2B / DFN-5B: CommonPool-12.8B (and further web pairs for 5B) filtered by Apple's data-filtering network; not released
  • Options: fp16_accumulate = False (precision only), fp32_accumulate = False (precision only)
  • Kernel libraries: cudnn_hacc, fvm_conv, fvm_extra, fvm_mb, fvm_r3
  • Variants: clip-b16-openai, clip-l14-openai, clip-l14-336-openai, clip-b16-laion2b, clip-l14-laion2b, clip-h14-laion2b, clip-l14-datacompxl, clip-l14-dfn2b, clip-h14-dfn5b, clip-h14-378-dfn5b
  • 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): clip-b16-openai 3000x4000 (1.9 GiB peak allocated, 2.2 reserved); clip-l14-openai 3000x4000 (3.4 GiB peak allocated, 3.7 reserved); clip-l14-336-openai 3000x4000 (3.4 GiB peak allocated, 3.6 reserved); clip-b16-laion2b 3000x4000 (1.7 GiB peak allocated, 1.9 reserved); clip-l14-laion2b 3000x4000 (2.9 GiB peak allocated, 3.2 reserved); clip-h14-laion2b 3000x4000 (3.9 GiB peak allocated, 4.4 reserved); clip-l14-datacompxl 3000x4000 (2.9 GiB peak allocated, 3.2 reserved); clip-l14-dfn2b 3000x4000 (3.4 GiB peak allocated, 3.7 reserved); clip-h14-dfn5b 3000x4000 (4.5 GiB peak allocated, 5.0 reserved); clip-h14-378-dfn5b 3000x4000 (4.5 GiB peak allocated, 5.0 reserved)
  • clip-b16-openai 224x224, first call: portable + torch.compile 6 s (cold Inductor cache), TensorRT fp16 15 s (ONNX + engine).
  • clip-l14-openai 224x224, first call: portable + torch.compile 10 s (cold Inductor cache), TensorRT fp16 23 s (ONNX + engine).
  • clip-l14-336-openai 224x224, first call: portable + torch.compile 11 s (cold Inductor cache), TensorRT fp16 33 s (ONNX + engine).
  • clip-b16-laion2b 224x224, first call: portable + torch.compile 6 s (cold Inductor cache), TensorRT fp16 24 s (ONNX + engine).
  • clip-l14-laion2b 224x224, first call: portable + torch.compile 10 s (cold Inductor cache), TensorRT fp16 32 s (ONNX + engine).
  • clip-h14-laion2b 224x224, first call: portable + torch.compile 14 s (cold Inductor cache), TensorRT fp16 41 s (ONNX + engine).
  • clip-l14-datacompxl 224x224, first call: portable + torch.compile 10 s (cold Inductor cache), TensorRT fp16 32 s (ONNX + engine).
  • clip-l14-dfn2b 224x224, first call: portable + torch.compile 11 s (cold Inductor cache), TensorRT fp16 27 s (ONNX + engine).
  • clip-h14-dfn5b 224x224, first call: portable + torch.compile 13 s (cold Inductor cache), TensorRT fp16 36 s (ONNX + engine).
  • clip-h14-378-dfn5b 224x224, first call: portable + torch.compile 14 s (cold Inductor cache), TensorRT fp16 59 s (ONNX + engine).
  • clip-b16-openai original (fp32) 224x224: timm 1.0.30 create_model(dynamic_img_size=True), forward_head(pre_logits=True)
  • clip-b16-openai original 224x224: torch.autocast(fp16) around the forward; timm 1.0.30 create_model(dynamic_img_size=True), forward_head(pre_logits=True)
  • clip-l14-openai original (fp32) 224x224: timm 1.0.30 create_model(dynamic_img_size=True), forward_head(pre_logits=True)
  • clip-l14-openai original 224x224: torch.autocast(fp16) around the forward; timm 1.0.30 create_model(dynamic_img_size=True), forward_head(pre_logits=True)
  • clip-l14-336-openai original (fp32) 224x224: timm 1.0.30 create_model(dynamic_img_size=True), forward_head(pre_logits=True)
  • clip-l14-336-openai original 224x224: torch.autocast(fp16) around the forward; timm 1.0.30 create_model(dynamic_img_size=True), forward_head(pre_logits=True)
  • clip-b16-laion2b original (fp32) 224x224: timm 1.0.30 create_model(dynamic_img_size=True), forward_head(pre_logits=True)
  • clip-b16-laion2b original 224x224: torch.autocast(fp16) around the forward; timm 1.0.30 create_model(dynamic_img_size=True), forward_head(pre_logits=True)
  • clip-l14-laion2b original (fp32) 224x224: timm 1.0.30 create_model(dynamic_img_size=True), forward_head(pre_logits=True)
  • clip-l14-laion2b original 224x224: torch.autocast(fp16) around the forward; timm 1.0.30 create_model(dynamic_img_size=True), forward_head(pre_logits=True)
  • clip-h14-laion2b original (fp32) 224x224: timm 1.0.30 create_model(dynamic_img_size=True), forward_head(pre_logits=True)
  • clip-h14-laion2b original 224x224: torch.autocast(fp16) around the forward; timm 1.0.30 create_model(dynamic_img_size=True), forward_head(pre_logits=True)
  • clip-l14-datacompxl original (fp32) 224x224: timm 1.0.30 create_model(dynamic_img_size=True), forward_head(pre_logits=True)
  • clip-l14-datacompxl original 224x224: torch.autocast(fp16) around the forward; timm 1.0.30 create_model(dynamic_img_size=True), forward_head(pre_logits=True)
  • clip-l14-dfn2b original (fp32) 224x224: timm 1.0.30 create_model(dynamic_img_size=True), forward_head(pre_logits=True)
  • clip-l14-dfn2b original 224x224: torch.autocast(fp16) around the forward; timm 1.0.30 create_model(dynamic_img_size=True), forward_head(pre_logits=True)
  • clip-h14-dfn5b original (fp32) 224x224: timm 1.0.30 create_model(dynamic_img_size=True), forward_head(pre_logits=True)
  • clip-h14-dfn5b original 224x224: torch.autocast(fp16) around the forward; timm 1.0.30 create_model(dynamic_img_size=True), forward_head(pre_logits=True)
  • clip-h14-378-dfn5b original (fp32) 224x224: timm 1.0.30 create_model(dynamic_img_size=True), forward_head(pre_logits=True)
  • clip-h14-378-dfn5b original 224x224: torch.autocast(fp16) around the forward; timm 1.0.30 create_model(dynamic_img_size=True), forward_head(pre_logits=True)
  • clip-b16-openai load / first call: original 16.66 s / 0.088 s, portable – s / 0.075 s, kernels – s / 0.055 s
  • clip-l14-openai load / first call: original 41.72 s / 0.07 s, portable – s / 0.057 s, kernels – s / 0.034 s
  • clip-l14-336-openai load / first call: original 30.98 s / 0.165 s, portable – s / 0.056 s, kernels – s / 0.034 s
  • clip-b16-laion2b load / first call: original 13.69 s / 0.158 s, portable – s / 0.06 s, kernels – s / 0.053 s
  • clip-l14-laion2b load / first call: original 39.4 s / 0.168 s, portable – s / 0.04 s, kernels – s / 0.031 s
  • clip-h14-laion2b load / first call: original 78.69 s / 0.183 s, portable – s / 0.065 s, kernels – s / 0.065 s
  • clip-l14-datacompxl load / first call: original 39.6 s / 0.166 s, portable – s / 0.04 s, kernels – s / 0.031 s
  • clip-l14-dfn2b load / first call: original 39.79 s / 0.166 s, portable – s / 0.058 s, kernels – s / 0.035 s
  • clip-h14-dfn5b load / first call: original 79.37 s / 0.177 s, portable – s / 0.088 s, kernels – s / 0.062 s
  • clip-h14-378-dfn5b load / first call: original 78.39 s / 0.178 s, portable – s / 0.081 s, kernels – s / 0.06 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.

variantdatasetoriginal fp32original fp16portablekernelsnote
clip-b16-openaiImageNet-1k val, kNN top-1 % (k = 20, 10000 labelled / 5000 test images)51.9852.0052.0052.00
clip-l14-openaiImageNet-1k val, kNN top-1 % (k = 20, 10000 labelled / 5000 test images)58.7058.6458.5658.58
clip-l14-336-openaiImageNet-1k val, kNN top-1 % (k = 20, 10000 labelled / 5000 test images)58.8258.7258.8058.86
clip-b16-laion2bImageNet-1k val, kNN top-1 % (k = 20, 10000 labelled / 5000 test images)54.1454.2454.2254.16
clip-l14-laion2bImageNet-1k val, kNN top-1 % (k = 20, 10000 labelled / 5000 test images)59.3059.3059.3659.32
clip-h14-laion2bImageNet-1k val, kNN top-1 % (k = 20, 10000 labelled / 5000 test images)62.5662.4662.4662.56
clip-l14-datacompxlImageNet-1k val, kNN top-1 % (k = 20, 10000 labelled / 5000 test images)62.5062.4462.4462.38
clip-l14-dfn2bImageNet-1k val, kNN top-1 % (k = 20, 10000 labelled / 5000 test images)66.8666.7466.7666.78
clip-h14-dfn5bImageNet-1k val, kNN top-1 % (k = 20, 10000 labelled / 5000 test images)68.7268.7068.8068.86
clip-h14-378-dfn5bImageNet-1k val, kNN top-1 % (k = 20, 10000 labelled / 5000 test images)64.8465.1065.1065.00

Measured on NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 8bce3316 / b2ffd65d, 2026-11-11 to 2026-11-12.

Parity

CPU, float32: max |diff| <= 0.0001 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 9.9 % and p99 <= 87 % of the reference's median |value| (absolute error of the output last_hidden_state).

variantkernels error vs original, mean / p99GPU, torchkernels used
clip-b16-openai0.02117 / 0.12801RTX 5060 Ti, torch 2.14.1+cu130cudnn_hacc@cudnn92400, fvm_conv@f1d064e539e1:sm_120, fvm_extra@3208ce525a91:sm_120, fvm_mb@720dd3f29bf7:sm_120, fvm_r3@f54eb890e23c:sm_120
clip-l14-openai0.03472 / 0.17675RTX 5060 Ti, torch 2.14.1+cu130cudnn_hacc@cudnn92400, fvm_conv@f1d064e539e1:sm_120, fvm_extra@3208ce525a91:sm_120, fvm_mb@720dd3f29bf7:sm_120, fvm_r3@f54eb890e23c:sm_120
clip-l14-336-openai0.02813 / 0.13835RTX 5060 Ti, torch 2.14.1+cu130cudnn_hacc@cudnn92400, fvm_conv@f1d064e539e1:sm_120, fvm_extra@3208ce525a91:sm_120, fvm_mb@720dd3f29bf7:sm_120, fvm_r3@f54eb890e23c:sm_120
clip-b16-laion2b0.01804 / 0.07382RTX 5060 Ti, torch 2.14.1+cu130cudnn_hacc@cudnn92400, fvm_conv@f1d064e539e1:sm_120, fvm_extra@3208ce525a91:sm_120, fvm_mb@720dd3f29bf7:sm_120, fvm_r3@f54eb890e23c:sm_120
clip-l14-laion2b0.02455 / 0.13201RTX 5060 Ti, torch 2.14.1+cu130cudnn_hacc@cudnn92400, fvm_conv@f1d064e539e1:sm_120, fvm_extra@3208ce525a91:sm_120, fvm_mb@720dd3f29bf7:sm_120, fvm_r3@f54eb890e23c:sm_120
clip-h14-laion2b0.01887 / 0.15276RTX 5060 Ti, torch 2.14.1+cu130cudnn_hacc@cudnn92400, fvm_conv@f1d064e539e1:sm_120, fvm_extra@3208ce525a91:sm_120, fvm_mb@720dd3f29bf7:sm_120, fvm_r3@f54eb890e23c:sm_120
clip-l14-datacompxl0.04765 / 0.57657RTX 5060 Ti, torch 2.14.1+cu130cudnn_hacc@cudnn92400, fvm_conv@f1d064e539e1:sm_120, fvm_extra@3208ce525a91:sm_120, fvm_mb@720dd3f29bf7:sm_120, fvm_r3@f54eb890e23c:sm_120
clip-l14-dfn2b0.04034 / 0.42562RTX 5060 Ti, torch 2.14.1+cu130cudnn_hacc@cudnn92400, fvm_conv@f1d064e539e1:sm_120, fvm_extra@3208ce525a91:sm_120, fvm_mb@720dd3f29bf7:sm_120, fvm_r3@f54eb890e23c:sm_120
clip-h14-dfn5b0.03854 / 0.25848RTX 5060 Ti, torch 2.14.1+cu130cudnn_hacc@cudnn92400, fvm_conv@f1d064e539e1:sm_120, fvm_extra@3208ce525a91:sm_120, fvm_mb@720dd3f29bf7:sm_120, fvm_r3@f54eb890e23c:sm_120
clip-h14-378-dfn5b0.0654 / 0.34509RTX 5060 Ti, torch 2.14.1+cu130cudnn_hacc@cudnn92400, fvm_conv@f1d064e539e1:sm_120, fvm_extra@3208ce525a91:sm_120, fvm_mb@720dd3f29bf7:sm_120, fvm_r3@f54eb890e23c:sm_120

Limitations

  • kernels replays a CUDA graph per small input shape without hidden states (up to about 1M activations: ViT-B ~460 px, ViT-L ~300 px), captured on the shape's second call, at most 4 per model; model.release_graphs() frees them.
  • Small kernels calls (graph-sized, with or without layers) run GEMMs of at most 600 tokens on cuBLAS: faster in a graph replay (ViT-B/16 224 px: 1.26 against 1.52 ms), about 10 % slower eagerly on ViT-T / B; a replay equals the eager call bit for bit.
  • fp32_accumulate = true puts every GEMM on cuBLAS with fp32 accumulation (the portable precision; slower on GeForce).
  • fp16 error against the fp32 original is higher than for the other ViTs on L/14 DataComp (mean 2.8 % portable, 4.8 % kernels): one residual channel sits near 120, where fp16 steps are 0.06, about 10 % of the median activation. No overflow; float32 portable gives 0.3 %.
  • DFN weights: the relative error (mean 1.3-3.9 % portable, 3.9-6.5 % kernels) is measured against a median |output| of only 0.015-0.021 (other weights: 0.5-0.6) with values up to 0.7; fp32_accumulate = true lowers kernels to about 1.5 %.
  • Kernels at 224 x 224 peak above portable (B/16 257 vs 204 MB, L/14 814 vs 623 MB; original 544 / 1779 MB): the QuickGELU fold keeps a folded copy of each fc2 weight next to the original parameter, and the second call's CUDA-graph capture adds ~30 MB.

Example output

One fixed input through this checkpoint, the same for every model of the task (kernels · float16 · NVIDIA GeForce RTX 5060 Ti).

Input
Output
Chelsea the cat, input
Input · 100%

Input: Chelsea the cat, Stéfan van der Walt (CC0).