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
- Paper Learning Transferable Visual Models From Natural Language Supervision ICML 2021 · first released 26 Feb 2021
- Authors’ code openai/CLIP (PyTorch), not the code forked here: timm re-implements the CLIP image towers and hosts the OpenAI, OpenCLIP and DFN weights in one format; the authors' packages carry the text towers and their own APIs.
Paper 2021 Added in 0.2.0 Evaluated with 0.2.0
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)
| Backend | dtype | Time per call (ms) | vs original fp16 | Peak 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.28 | 0.90× | 371 MiB/418 MiB | 16.7 | 0.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 MiB | 16.7 | 0.09 |
| Portable fp32 | fp32 | not measured | – | – | – | – |
| Portable | fp16 | 3.35 | 1.7× | 204 MiB/226 MiB | – | 0.07 |
| Kernels | fp16 | 1.36 | 4.2× | 203 MiB/250 MiB | 2.3 | 0.06 |
| Portable + torch.compile | 2.39 | 2.4× | 237 MiB/266 MiB | 6 (build) | – | |
| TensorRT fp16 | fp16 | 1.11 | 5.1× | 196 MiBenginenot comparable | 15 (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
| 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 | 18.5 | 1,592 MiB process | – | 224x224 |
| Portable | fp16 | 16.1 | 1,724 MiB process | matches | 224x224 | |
| Portable | fp32 | 17.5 | 1,563 MiB process | matches | 224x224 | |
| Kernels | fp16 | not 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 Facefastforks 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)
| Run | dtype | top-1 % ↑ | Δ top-1 % vs fp32 original | images | ms / image |
|---|---|---|---|---|---|
| Original fp32 | fp32 | 51.98 | reference | 5000 | 3.94 |
| Original fp16 | fp16 | 52.00 | +0.02 | 5000 | 1.30 |
| Portable fp32 | not measured | ||||
| Portable | fp16 | 52.00 | +0.02 | 5000 | 1.14 |
| Kernels | fp16 | 52.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).
| Check | Tolerance | Measured |
|---|---|---|
| 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=falsefp32_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 classifiersfvm_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).
| variant | input | backend | time (ms) | peak memory (MiB, allocated / reserved) |
|---|---|---|---|---|
clip-b16-openai | synthetic (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-openai | synthetic (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-openai | synthetic (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-laion2b | synthetic (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-laion2b | synthetic (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-laion2b | synthetic (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-datacompxl | synthetic (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-dfn2b | synthetic (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-dfn5b | synthetic (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-dfn5b | synthetic (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-AMLRclip-h14-dfn5b: LicenseRef-Apple-AMLRclip-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 releasedclip-l14-openai: WIT: 400M image-text pairs collected from the web by OpenAI (CLIP paper); not releasedclip-l14-336-openai: WIT: 400M image-text pairs collected from the web by OpenAI (CLIP paper); not releasedclip-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 releasedclip-h14-dfn5b: DFN-2B / DFN-5B: CommonPool-12.8B (and further web pairs for 5B) filtered by Apple's data-filtering network; not releasedclip-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-openai3000x4000 (1.9 GiB peak allocated, 2.2 reserved);clip-l14-openai3000x4000 (3.4 GiB peak allocated, 3.7 reserved);clip-l14-336-openai3000x4000 (3.4 GiB peak allocated, 3.6 reserved);clip-b16-laion2b3000x4000 (1.7 GiB peak allocated, 1.9 reserved);clip-l14-laion2b3000x4000 (2.9 GiB peak allocated, 3.2 reserved);clip-h14-laion2b3000x4000 (3.9 GiB peak allocated, 4.4 reserved);clip-l14-datacompxl3000x4000 (2.9 GiB peak allocated, 3.2 reserved);clip-l14-dfn2b3000x4000 (3.4 GiB peak allocated, 3.7 reserved);clip-h14-dfn5b3000x4000 (4.5 GiB peak allocated, 5.0 reserved);clip-h14-378-dfn5b3000x4000 (4.5 GiB peak allocated, 5.0 reserved) clip-b16-openai224x224, first call: portable + torch.compile 6 s (cold Inductor cache), TensorRT fp16 15 s (ONNX + engine).clip-l14-openai224x224, first call: portable + torch.compile 10 s (cold Inductor cache), TensorRT fp16 23 s (ONNX + engine).clip-l14-336-openai224x224, first call: portable + torch.compile 11 s (cold Inductor cache), TensorRT fp16 33 s (ONNX + engine).clip-b16-laion2b224x224, first call: portable + torch.compile 6 s (cold Inductor cache), TensorRT fp16 24 s (ONNX + engine).clip-l14-laion2b224x224, first call: portable + torch.compile 10 s (cold Inductor cache), TensorRT fp16 32 s (ONNX + engine).clip-h14-laion2b224x224, first call: portable + torch.compile 14 s (cold Inductor cache), TensorRT fp16 41 s (ONNX + engine).clip-l14-datacompxl224x224, first call: portable + torch.compile 10 s (cold Inductor cache), TensorRT fp16 32 s (ONNX + engine).clip-l14-dfn2b224x224, first call: portable + torch.compile 11 s (cold Inductor cache), TensorRT fp16 27 s (ONNX + engine).clip-h14-dfn5b224x224, first call: portable + torch.compile 13 s (cold Inductor cache), TensorRT fp16 36 s (ONNX + engine).clip-h14-378-dfn5b224x224, first call: portable + torch.compile 14 s (cold Inductor cache), TensorRT fp16 59 s (ONNX + engine).clip-b16-openaioriginal (fp32) 224x224: timm 1.0.30 create_model(dynamic_img_size=True), forward_head(pre_logits=True)clip-b16-openaioriginal 224x224: torch.autocast(fp16) around the forward; timm 1.0.30 create_model(dynamic_img_size=True), forward_head(pre_logits=True)clip-l14-openaioriginal (fp32) 224x224: timm 1.0.30 create_model(dynamic_img_size=True), forward_head(pre_logits=True)clip-l14-openaioriginal 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-openaioriginal (fp32) 224x224: timm 1.0.30 create_model(dynamic_img_size=True), forward_head(pre_logits=True)clip-l14-336-openaioriginal 224x224: torch.autocast(fp16) around the forward; timm 1.0.30 create_model(dynamic_img_size=True), forward_head(pre_logits=True)clip-b16-laion2boriginal (fp32) 224x224: timm 1.0.30 create_model(dynamic_img_size=True), forward_head(pre_logits=True)clip-b16-laion2boriginal 224x224: torch.autocast(fp16) around the forward; timm 1.0.30 create_model(dynamic_img_size=True), forward_head(pre_logits=True)clip-l14-laion2boriginal (fp32) 224x224: timm 1.0.30 create_model(dynamic_img_size=True), forward_head(pre_logits=True)clip-l14-laion2boriginal 224x224: torch.autocast(fp16) around the forward; timm 1.0.30 create_model(dynamic_img_size=True), forward_head(pre_logits=True)clip-h14-laion2boriginal (fp32) 224x224: timm 1.0.30 create_model(dynamic_img_size=True), forward_head(pre_logits=True)clip-h14-laion2boriginal 224x224: torch.autocast(fp16) around the forward; timm 1.0.30 create_model(dynamic_img_size=True), forward_head(pre_logits=True)clip-l14-datacompxloriginal (fp32) 224x224: timm 1.0.30 create_model(dynamic_img_size=True), forward_head(pre_logits=True)clip-l14-datacompxloriginal 224x224: torch.autocast(fp16) around the forward; timm 1.0.30 create_model(dynamic_img_size=True), forward_head(pre_logits=True)clip-l14-dfn2boriginal (fp32) 224x224: timm 1.0.30 create_model(dynamic_img_size=True), forward_head(pre_logits=True)clip-l14-dfn2boriginal 224x224: torch.autocast(fp16) around the forward; timm 1.0.30 create_model(dynamic_img_size=True), forward_head(pre_logits=True)clip-h14-dfn5boriginal (fp32) 224x224: timm 1.0.30 create_model(dynamic_img_size=True), forward_head(pre_logits=True)clip-h14-dfn5boriginal 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-dfn5boriginal (fp32) 224x224: timm 1.0.30 create_model(dynamic_img_size=True), forward_head(pre_logits=True)clip-h14-378-dfn5boriginal 224x224: torch.autocast(fp16) around the forward; timm 1.0.30 create_model(dynamic_img_size=True), forward_head(pre_logits=True)clip-b16-openaiload / first call: original 16.66 s / 0.088 s, portable – s / 0.075 s, kernels – s / 0.055 sclip-l14-openaiload / first call: original 41.72 s / 0.07 s, portable – s / 0.057 s, kernels – s / 0.034 sclip-l14-336-openaiload / first call: original 30.98 s / 0.165 s, portable – s / 0.056 s, kernels – s / 0.034 sclip-b16-laion2bload / first call: original 13.69 s / 0.158 s, portable – s / 0.06 s, kernels – s / 0.053 sclip-l14-laion2bload / first call: original 39.4 s / 0.168 s, portable – s / 0.04 s, kernels – s / 0.031 sclip-h14-laion2bload / first call: original 78.69 s / 0.183 s, portable – s / 0.065 s, kernels – s / 0.065 sclip-l14-datacompxlload / first call: original 39.6 s / 0.166 s, portable – s / 0.04 s, kernels – s / 0.031 sclip-l14-dfn2bload / first call: original 39.79 s / 0.166 s, portable – s / 0.058 s, kernels – s / 0.035 sclip-h14-dfn5bload / first call: original 79.37 s / 0.177 s, portable – s / 0.088 s, kernels – s / 0.062 sclip-h14-378-dfn5bload / 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.
| variant | dataset | original fp32 | original fp16 | portable | kernels | note |
|---|---|---|---|---|---|---|
clip-b16-openai | ImageNet-1k val, kNN top-1 % (k = 20, 10000 labelled / 5000 test images) | 51.98 | 52.00 | 52.00 | 52.00 | |
clip-l14-openai | ImageNet-1k val, kNN top-1 % (k = 20, 10000 labelled / 5000 test images) | 58.70 | 58.64 | 58.56 | 58.58 | |
clip-l14-336-openai | ImageNet-1k val, kNN top-1 % (k = 20, 10000 labelled / 5000 test images) | 58.82 | 58.72 | 58.80 | 58.86 | |
clip-b16-laion2b | ImageNet-1k val, kNN top-1 % (k = 20, 10000 labelled / 5000 test images) | 54.14 | 54.24 | 54.22 | 54.16 | |
clip-l14-laion2b | ImageNet-1k val, kNN top-1 % (k = 20, 10000 labelled / 5000 test images) | 59.30 | 59.30 | 59.36 | 59.32 | |
clip-h14-laion2b | ImageNet-1k val, kNN top-1 % (k = 20, 10000 labelled / 5000 test images) | 62.56 | 62.46 | 62.46 | 62.56 | |
clip-l14-datacompxl | ImageNet-1k val, kNN top-1 % (k = 20, 10000 labelled / 5000 test images) | 62.50 | 62.44 | 62.44 | 62.38 | |
clip-l14-dfn2b | ImageNet-1k val, kNN top-1 % (k = 20, 10000 labelled / 5000 test images) | 66.86 | 66.74 | 66.76 | 66.78 | |
clip-h14-dfn5b | ImageNet-1k val, kNN top-1 % (k = 20, 10000 labelled / 5000 test images) | 68.72 | 68.70 | 68.80 | 68.86 | |
clip-h14-378-dfn5b | ImageNet-1k val, kNN top-1 % (k = 20, 10000 labelled / 5000 test images) | 64.84 | 65.10 | 65.10 | 65.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).
| variant | kernels error vs original, mean / p99 | GPU, torch | kernels used |
|---|---|---|---|
clip-b16-openai | 0.02117 / 0.12801 | RTX 5060 Ti, torch 2.14.1+cu130 | cudnn_hacc@cudnn92400, fvm_conv@f1d064e539e1:sm_120, fvm_extra@3208ce525a91:sm_120, fvm_mb@720dd3f29bf7:sm_120, fvm_r3@f54eb890e23c:sm_120 |
clip-l14-openai | 0.03472 / 0.17675 | RTX 5060 Ti, torch 2.14.1+cu130 | cudnn_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-openai | 0.02813 / 0.13835 | RTX 5060 Ti, torch 2.14.1+cu130 | cudnn_hacc@cudnn92400, fvm_conv@f1d064e539e1:sm_120, fvm_extra@3208ce525a91:sm_120, fvm_mb@720dd3f29bf7:sm_120, fvm_r3@f54eb890e23c:sm_120 |
clip-b16-laion2b | 0.01804 / 0.07382 | RTX 5060 Ti, torch 2.14.1+cu130 | cudnn_hacc@cudnn92400, fvm_conv@f1d064e539e1:sm_120, fvm_extra@3208ce525a91:sm_120, fvm_mb@720dd3f29bf7:sm_120, fvm_r3@f54eb890e23c:sm_120 |
clip-l14-laion2b | 0.02455 / 0.13201 | RTX 5060 Ti, torch 2.14.1+cu130 | cudnn_hacc@cudnn92400, fvm_conv@f1d064e539e1:sm_120, fvm_extra@3208ce525a91:sm_120, fvm_mb@720dd3f29bf7:sm_120, fvm_r3@f54eb890e23c:sm_120 |
clip-h14-laion2b | 0.01887 / 0.15276 | RTX 5060 Ti, torch 2.14.1+cu130 | cudnn_hacc@cudnn92400, fvm_conv@f1d064e539e1:sm_120, fvm_extra@3208ce525a91:sm_120, fvm_mb@720dd3f29bf7:sm_120, fvm_r3@f54eb890e23c:sm_120 |
clip-l14-datacompxl | 0.04765 / 0.57657 | RTX 5060 Ti, torch 2.14.1+cu130 | cudnn_hacc@cudnn92400, fvm_conv@f1d064e539e1:sm_120, fvm_extra@3208ce525a91:sm_120, fvm_mb@720dd3f29bf7:sm_120, fvm_r3@f54eb890e23c:sm_120 |
clip-l14-dfn2b | 0.04034 / 0.42562 | RTX 5060 Ti, torch 2.14.1+cu130 | cudnn_hacc@cudnn92400, fvm_conv@f1d064e539e1:sm_120, fvm_extra@3208ce525a91:sm_120, fvm_mb@720dd3f29bf7:sm_120, fvm_r3@f54eb890e23c:sm_120 |
clip-h14-dfn5b | 0.03854 / 0.25848 | RTX 5060 Ti, torch 2.14.1+cu130 | cudnn_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-dfn5b | 0.0654 / 0.34509 | RTX 5060 Ti, torch 2.14.1+cu130 | cudnn_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 = trueputs 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 = truelowers 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: Chelsea the cat, Stéfan van der Walt (CC0).