N Neurarch Try it See it Changes Bot Pricing API Open app

Models / clip

CLIP-ViT-B-32-laion2B-s34B-b79K: GPU memory to fine-tune

Fine-tuning CLIP-ViT-B-32-laion2B-s34B-b79K at batch 1 takes about 1.70 GB of GPU memory for a full fine-tune (fits one T4 16 GB), and 0.24 GB with LoRA r=16 on a bf16 base (fits one T4 16 GB). Estimated from the model's structure, for the towers the graph reconstructs, not measured. What fits on which card.

Reconstructed from its own config.json with no weights read. 3.9M downloads on Hugging Face.

Our count against the checkpoint

The left number comes from the graph. The right one is the number of scalars in the published weight files. Nothing on this page was tuned to make them agree.

Derived from structure
87.5M
87,453,696 parameters
In the published checkpoint
151M
151,277,439 scalars · safetensors.total, read 2025-01-22
Delta
-42.2%

multi-tower The config declares 2 sub-models (text_config, vision_config). The published checkpoint carries all of them; the graph below carries the towers the reader reconstructs. A gap here is a statement about what we read, not about the checkpoint.

What it costs to run

Cost is a roofline estimate on the priced GPU for 10 epochs at batch 32 over 50,000 samples (assumed; no dataset attached).

Layers
74
Will it forward-pass
Yes
Priced on
A10G (24GB)
Est. one run
$0.21

Memory: what fits on which card

Largest batch per card. Training is sized at the input shape below per sample.

Full fine-tune, batch 1
1.70 GB
LoRA r=16, batch 1
0.24 GB
CardFull fine-tuneLoRA r=16
T4 16 GBbatch 698batch 781
L4 24 GBbatch 1095batch 1178
A100 40 GBbatch 1889batch 1972
A100 / H100 80 GBbatch 3874batch 3957
H200 141 GBbatch 6902batch 6985

Training: the input shape in the structure table, AdamW with bf16 autocast, SDPA attention (no score matrix stored), 1.15x headroom on every card. Full fine-tune holds weights, gradients and optimizer state (1.2 x 16 bytes per parameter) plus activations. LoRA is r=16 on every linear layer but the head, base frozen in bf16 (2 bytes per parameter), adapters at full AdamW state, same activations. A two-card split is a contiguous layer cut (pipeline parallel), computed only where one card cannot hold batch 1.

These are estimates from the graph, not measurements. Against measured runs, held out by architecture, the estimate flagged 113 of the 131 jobs that did not fit their card and said "fits" on the other 18. Every measured run.

Structure

76 nodes. Output shapes are propagated from the input shape, batch dimension excluded.

LayerTypeOutput shape
1InputInput3 × 224 × 224
2PatchEmbeddingPatch Embed50 × 768
3Patch_Position_EmbeddingLearned Pos Embed50 × 768
4Attention_1Multi-Head Attention50 × 768
5Add_1Add50 × 768
6LayerNorm_1_1LayerNorm50 × 768
7FFN_1Feed Forward50 × 768
8Add_1_2Add50 × 768
9LayerNorm_1_2LayerNorm50 × 768
10Attention_2Multi-Head Attention50 × 768
11Add_2Add50 × 768
12LayerNorm_2_1LayerNorm50 × 768
13FFN_2Feed Forward50 × 768
14Add_2_2Add50 × 768
15LayerNorm_2_2LayerNorm50 × 768
16Attention_3Multi-Head Attention50 × 768
17Add_3Add50 × 768
18LayerNorm_3_1LayerNorm50 × 768
19FFN_3Feed Forward50 × 768
20Add_3_2Add50 × 768
21LayerNorm_3_2LayerNorm50 × 768
22Attention_4Multi-Head Attention50 × 768
23Add_4Add50 × 768
24LayerNorm_4_1LayerNorm50 × 768
25FFN_4Feed Forward50 × 768
26Add_4_2Add50 × 768
27LayerNorm_4_2LayerNorm50 × 768
28Attention_5Multi-Head Attention50 × 768
29Add_5Add50 × 768
30LayerNorm_5_1LayerNorm50 × 768
31FFN_5Feed Forward50 × 768
32Add_5_2Add50 × 768
33LayerNorm_5_2LayerNorm50 × 768
34Attention_6Multi-Head Attention50 × 768
35Add_6Add50 × 768
36LayerNorm_6_1LayerNorm50 × 768
37FFN_6Feed Forward50 × 768
38Add_6_2Add50 × 768
39LayerNorm_6_2LayerNorm50 × 768
40Attention_7Multi-Head Attention50 × 768
41Add_7Add50 × 768
42LayerNorm_7_1LayerNorm50 × 768
43FFN_7Feed Forward50 × 768
44Add_7_2Add50 × 768
45LayerNorm_7_2LayerNorm50 × 768
46Attention_8Multi-Head Attention50 × 768
47Add_8Add50 × 768
48LayerNorm_8_1LayerNorm50 × 768
49FFN_8Feed Forward50 × 768
50Add_8_2Add50 × 768
51LayerNorm_8_2LayerNorm50 × 768
52Attention_9Multi-Head Attention50 × 768
53Add_9Add50 × 768
54LayerNorm_9_1LayerNorm50 × 768
55FFN_9Feed Forward50 × 768
56Add_9_2Add50 × 768
57LayerNorm_9_2LayerNorm50 × 768
58Attention_10Multi-Head Attention50 × 768
59Add_10Add50 × 768
60LayerNorm_10_1LayerNorm50 × 768
61FFN_10Feed Forward50 × 768
62Add_10_2Add50 × 768
63LayerNorm_10_2LayerNorm50 × 768
64Attention_11Multi-Head Attention50 × 768
65Add_11Add50 × 768
66LayerNorm_11_1LayerNorm50 × 768
67FFN_11Feed Forward50 × 768
68Add_11_2Add50 × 768
69LayerNorm_11_2LayerNorm50 × 768
70Attention_12Multi-Head Attention50 × 768
71Add_12Add50 × 768
72LayerNorm_12_1LayerNorm50 × 768
73FFN_12Feed Forward50 × 768
74Add_12_2Add50 × 768
75LayerNorm_12_2LayerNorm50 × 768
76OutputOutput50 × 768

What the verifier says

warn"LayerNorm_12_2" (layerNorm) is the last layer before Output. Normalizing the raw logits constrains the output range and breaks standard loss functions. Fix: Move normalization before the final Linear/Conv layer.
bn-at-output
infoAt 12 stacked attention layers, residual-branch outputs add up; unscaled init lets activation variance grow with depth. GPT-2/LLaMA-family models scale the residual projections by depth (N(0, 0.02 / √(2L))). Fix: Scale residual output projections by depth: nn.init.normal_(w, std=0.02 / math.sqrt(2 * n_layers))
deep-attention-default-init

What changed upstream

The change tracker follows laion/CLIP-ViT-B-32-laion2B-s34B-b79K: every revision it has read, what changed in the config, tokenizer, chat template or weights between them, and an OSV advisory per change.

Do this to your own model

Same numbers, on a model in your repo, in one command. No account.

pip install neurarch-trace
neurarch-trace laion/CLIP-ViT-B-32-laion2B-s34B-b79K --plan --share

Other clip checkpoints

CLIP-ViT-L-14-laion2B-s32B-b82K
303M derived · -29.1% against the checkpoint
clip-vit-large-patch14
303M derived · -29.1% against the checkpoint