Models / vit
vit-base-patch16-224: GPU memory to fine-tune
Fine-tuning vit-base-patch16-224 at batch 1 takes about 1.72 GB of GPU memory for a full fine-tune (fits one T4 16 GB), and 0.29 GB with LoRA r=16 on a bf16 base (fits one T4 16 GB). Estimated from the model's structure, not measured. What fits on which card.
Reconstructed from its own config.json
with no weights read. 5.1M 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.
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).
Memory: what fits on which card
Largest batch per card. Training is sized at the input shape below per sample.
| Card | Full fine-tune | LoRA r=16 |
|---|---|---|
| T4 16 GB | batch 177 | batch 198 |
| L4 24 GB | batch 278 | batch 299 |
| A100 40 GB | batch 480 | batch 500 |
| A100 / H100 80 GB | batch 983 | batch 1004 |
| H200 141 GB | batch 1752 | batch 1772 |
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.
| Layer | Type | Output shape | |
|---|---|---|---|
| 1 | Input | Input | 3 × 224 × 224 |
| 2 | PatchEmbedding | Patch Embed | 197 × 768 |
| 3 | Patch_Position_Embedding | Learned Pos Embed | 197 × 768 |
| 4 | Attention_1 | Multi-Head Attention | 197 × 768 |
| 5 | Add_1 | Add | 197 × 768 |
| 6 | LayerNorm_1_1 | LayerNorm | 197 × 768 |
| 7 | FFN_1 | Feed Forward | 197 × 768 |
| 8 | Add_1_2 | Add | 197 × 768 |
| 9 | LayerNorm_1_2 | LayerNorm | 197 × 768 |
| 10 | Attention_2 | Multi-Head Attention | 197 × 768 |
| 11 | Add_2 | Add | 197 × 768 |
| 12 | LayerNorm_2_1 | LayerNorm | 197 × 768 |
| 13 | FFN_2 | Feed Forward | 197 × 768 |
| 14 | Add_2_2 | Add | 197 × 768 |
| 15 | LayerNorm_2_2 | LayerNorm | 197 × 768 |
| 16 | Attention_3 | Multi-Head Attention | 197 × 768 |
| 17 | Add_3 | Add | 197 × 768 |
| 18 | LayerNorm_3_1 | LayerNorm | 197 × 768 |
| 19 | FFN_3 | Feed Forward | 197 × 768 |
| 20 | Add_3_2 | Add | 197 × 768 |
| 21 | LayerNorm_3_2 | LayerNorm | 197 × 768 |
| 22 | Attention_4 | Multi-Head Attention | 197 × 768 |
| 23 | Add_4 | Add | 197 × 768 |
| 24 | LayerNorm_4_1 | LayerNorm | 197 × 768 |
| 25 | FFN_4 | Feed Forward | 197 × 768 |
| 26 | Add_4_2 | Add | 197 × 768 |
| 27 | LayerNorm_4_2 | LayerNorm | 197 × 768 |
| 28 | Attention_5 | Multi-Head Attention | 197 × 768 |
| 29 | Add_5 | Add | 197 × 768 |
| 30 | LayerNorm_5_1 | LayerNorm | 197 × 768 |
| 31 | FFN_5 | Feed Forward | 197 × 768 |
| 32 | Add_5_2 | Add | 197 × 768 |
| 33 | LayerNorm_5_2 | LayerNorm | 197 × 768 |
| 34 | Attention_6 | Multi-Head Attention | 197 × 768 |
| 35 | Add_6 | Add | 197 × 768 |
| 36 | LayerNorm_6_1 | LayerNorm | 197 × 768 |
| 37 | FFN_6 | Feed Forward | 197 × 768 |
| 38 | Add_6_2 | Add | 197 × 768 |
| 39 | LayerNorm_6_2 | LayerNorm | 197 × 768 |
| 40 | Attention_7 | Multi-Head Attention | 197 × 768 |
| 41 | Add_7 | Add | 197 × 768 |
| 42 | LayerNorm_7_1 | LayerNorm | 197 × 768 |
| 43 | FFN_7 | Feed Forward | 197 × 768 |
| 44 | Add_7_2 | Add | 197 × 768 |
| 45 | LayerNorm_7_2 | LayerNorm | 197 × 768 |
| 46 | Attention_8 | Multi-Head Attention | 197 × 768 |
| 47 | Add_8 | Add | 197 × 768 |
| 48 | LayerNorm_8_1 | LayerNorm | 197 × 768 |
| 49 | FFN_8 | Feed Forward | 197 × 768 |
| 50 | Add_8_2 | Add | 197 × 768 |
| 51 | LayerNorm_8_2 | LayerNorm | 197 × 768 |
| 52 | Attention_9 | Multi-Head Attention | 197 × 768 |
| 53 | Add_9 | Add | 197 × 768 |
| 54 | LayerNorm_9_1 | LayerNorm | 197 × 768 |
| 55 | FFN_9 | Feed Forward | 197 × 768 |
| 56 | Add_9_2 | Add | 197 × 768 |
| 57 | LayerNorm_9_2 | LayerNorm | 197 × 768 |
| 58 | Attention_10 | Multi-Head Attention | 197 × 768 |
| 59 | Add_10 | Add | 197 × 768 |
| 60 | LayerNorm_10_1 | LayerNorm | 197 × 768 |
| 61 | FFN_10 | Feed Forward | 197 × 768 |
| 62 | Add_10_2 | Add | 197 × 768 |
| 63 | LayerNorm_10_2 | LayerNorm | 197 × 768 |
| 64 | Attention_11 | Multi-Head Attention | 197 × 768 |
| 65 | Add_11 | Add | 197 × 768 |
| 66 | LayerNorm_11_1 | LayerNorm | 197 × 768 |
| 67 | FFN_11 | Feed Forward | 197 × 768 |
| 68 | Add_11_2 | Add | 197 × 768 |
| 69 | LayerNorm_11_2 | LayerNorm | 197 × 768 |
| 70 | Attention_12 | Multi-Head Attention | 197 × 768 |
| 71 | Add_12 | Add | 197 × 768 |
| 72 | LayerNorm_12_1 | LayerNorm | 197 × 768 |
| 73 | FFN_12 | Feed Forward | 197 × 768 |
| 74 | Add_12_2 | Add | 197 × 768 |
| 75 | LayerNorm_12_2 | LayerNorm | 197 × 768 |
| 76 | Output | Output | 197 × 768 |
What the verifier says
bn-at-output
deep-attention-default-init
What changed upstream
The change tracker follows google/vit-base-patch16-224: 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 google/vit-base-patch16-224 --plan --share