Models / GOT
GOT-OCR2_0: GPU memory to fine-tune
Fine-tuning GOT-OCR2_0 at batch 1 and 2048 tokens takes about 10.8 GB of GPU memory for a full fine-tune (borderline on one T4 16 GB), and 3.00 GB with LoRA r=16 on a bf16 base (fits one T4 16 GB). Estimated from the model's structure, reading the config under transformers semantics, not measured. What fits on which card.
Reconstructed from its own config.json
with no weights read. 680K 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.
stored twice The checkpoint stores the tied embedding twice: +155.5M (`lm_head.weight` and `model.embed_tokens.weight`, 151860 x 1024). The model has one such matrix and the count above has it once; the delta compares that count plus the second copy against the file. Header read 2026-10-18.
custom-code This repository ships its own modeling code (`auto_map`, e.g. `modeling_GOT.py`), so `config.json` names a class in the repo rather than an architecture `transformers` defines. The graph below is what those config keys mean under `transformers` semantics, which is not necessarily what the repo's own file builds. 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, 2048 tokens over 50,000 samples (assumed; no dataset attached).
Memory: what fits on which card
Largest batch per card. Training is sized at 2048 tokens per sample, serving at 4096 tokens per sequence.
| Card | Full fine-tune | LoRA r=16 | Serve bf16, 4096 tokens |
|---|---|---|---|
| T4 16 GB | batch 2, borderline | batch 6 | batch 32 |
| L4 24 GB | batch 6 | batch 10 | batch 49 |
| A100 40 GB | batch 13 | batch 17 | batch 84 |
| A100 / H100 80 GB | batch 31 | batch 35 | batch 170 |
| H200 141 GB | batch 58 | batch 62 | batch 302 |
Training: 2048 tokens per sample (2048, or the model's context when shorter; the structure table is at the config's maximum, 32768), 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. "Borderline" means the card holds batch 1 on the estimate but not on the conservative peak (the estimate x 1.43, at or above the measured peak on 95% of held-out runs): measure one step before reserving it. Serving: bf16 weights plus the KV cache of 4096 tokens per sequence; prefill working set, CUDA context and framework reserve not counted.
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
148 nodes. Output shapes are propagated from the input shape, batch dimension excluded, at 32768 tokens: the config's maximum context, not the 2048 the memory above is sized at.
| Layer | Type | Output shape | |
|---|---|---|---|
| 1 | Input | Input | 1 × 32768 |
| 2 | Embedding | Embedding | 1 × 32768 × 1024 |
| 3 | RoPE | RoPE | 1 × 32768 × 1024 |
| 4 | RMSNorm_1_1 | RMSNorm | 1 × 32768 × 1024 |
| 5 | Attention_1 | Grouped Query Attn | 1 × 32768 × 1024 |
| 6 | Add_1_attn | Add | 1 × 32768 × 1024 |
| 7 | RMSNorm_1_2 | RMSNorm | 1 × 32768 × 1024 |
| 8 | FFN_1 | SwiGLU | 1 × 32768 × 1024 |
| 9 | Add_1_ffn | Add | 1 × 32768 × 1024 |
| 10 | RMSNorm_2_1 | RMSNorm | 1 × 32768 × 1024 |
| 11 | Attention_2 | Grouped Query Attn | 1 × 32768 × 1024 |
| 12 | Add_2_attn | Add | 1 × 32768 × 1024 |
| 13 | RMSNorm_2_2 | RMSNorm | 1 × 32768 × 1024 |
| 14 | FFN_2 | SwiGLU | 1 × 32768 × 1024 |
| 15 | Add_2_ffn | Add | 1 × 32768 × 1024 |
| 16 | RMSNorm_3_1 | RMSNorm | 1 × 32768 × 1024 |
| 17 | Attention_3 | Grouped Query Attn | 1 × 32768 × 1024 |
| 18 | Add_3_attn | Add | 1 × 32768 × 1024 |
| 19 | RMSNorm_3_2 | RMSNorm | 1 × 32768 × 1024 |
| 20 | FFN_3 | SwiGLU | 1 × 32768 × 1024 |
| 21 | Add_3_ffn | Add | 1 × 32768 × 1024 |
| 22 | RMSNorm_4_1 | RMSNorm | 1 × 32768 × 1024 |
| 23 | Attention_4 | Grouped Query Attn | 1 × 32768 × 1024 |
| 24 | Add_4_attn | Add | 1 × 32768 × 1024 |
| 25 | RMSNorm_4_2 | RMSNorm | 1 × 32768 × 1024 |
| 26 | FFN_4 | SwiGLU | 1 × 32768 × 1024 |
| 27 | Add_4_ffn | Add | 1 × 32768 × 1024 |
| 28 | RMSNorm_5_1 | RMSNorm | 1 × 32768 × 1024 |
| 29 | Attention_5 | Grouped Query Attn | 1 × 32768 × 1024 |
| 30 | Add_5_attn | Add | 1 × 32768 × 1024 |
| 31 | RMSNorm_5_2 | RMSNorm | 1 × 32768 × 1024 |
| 32 | FFN_5 | SwiGLU | 1 × 32768 × 1024 |
| 33 | Add_5_ffn | Add | 1 × 32768 × 1024 |
| 34 | RMSNorm_6_1 | RMSNorm | 1 × 32768 × 1024 |
| 35 | Attention_6 | Grouped Query Attn | 1 × 32768 × 1024 |
| 36 | Add_6_attn | Add | 1 × 32768 × 1024 |
| 37 | RMSNorm_6_2 | RMSNorm | 1 × 32768 × 1024 |
| 38 | FFN_6 | SwiGLU | 1 × 32768 × 1024 |
| 39 | Add_6_ffn | Add | 1 × 32768 × 1024 |
| 40 | RMSNorm_7_1 | RMSNorm | 1 × 32768 × 1024 |
| 41 | Attention_7 | Grouped Query Attn | 1 × 32768 × 1024 |
| 42 | Add_7_attn | Add | 1 × 32768 × 1024 |
| 43 | RMSNorm_7_2 | RMSNorm | 1 × 32768 × 1024 |
| 44 | FFN_7 | SwiGLU | 1 × 32768 × 1024 |
| 45 | Add_7_ffn | Add | 1 × 32768 × 1024 |
| 46 | RMSNorm_8_1 | RMSNorm | 1 × 32768 × 1024 |
| 47 | Attention_8 | Grouped Query Attn | 1 × 32768 × 1024 |
| 48 | Add_8_attn | Add | 1 × 32768 × 1024 |
| 49 | RMSNorm_8_2 | RMSNorm | 1 × 32768 × 1024 |
| 50 | FFN_8 | SwiGLU | 1 × 32768 × 1024 |
| 51 | Add_8_ffn | Add | 1 × 32768 × 1024 |
| 52 | RMSNorm_9_1 | RMSNorm | 1 × 32768 × 1024 |
| 53 | Attention_9 | Grouped Query Attn | 1 × 32768 × 1024 |
| 54 | Add_9_attn | Add | 1 × 32768 × 1024 |
| 55 | RMSNorm_9_2 | RMSNorm | 1 × 32768 × 1024 |
| 56 | FFN_9 | SwiGLU | 1 × 32768 × 1024 |
| 57 | Add_9_ffn | Add | 1 × 32768 × 1024 |
| 58 | RMSNorm_10_1 | RMSNorm | 1 × 32768 × 1024 |
| 59 | Attention_10 | Grouped Query Attn | 1 × 32768 × 1024 |
| 60 | Add_10_attn | Add | 1 × 32768 × 1024 |
| 61 | RMSNorm_10_2 | RMSNorm | 1 × 32768 × 1024 |
| 62 | FFN_10 | SwiGLU | 1 × 32768 × 1024 |
| 63 | Add_10_ffn | Add | 1 × 32768 × 1024 |
| 64 | RMSNorm_11_1 | RMSNorm | 1 × 32768 × 1024 |
| 65 | Attention_11 | Grouped Query Attn | 1 × 32768 × 1024 |
| 66 | Add_11_attn | Add | 1 × 32768 × 1024 |
| 67 | RMSNorm_11_2 | RMSNorm | 1 × 32768 × 1024 |
| 68 | FFN_11 | SwiGLU | 1 × 32768 × 1024 |
| 69 | Add_11_ffn | Add | 1 × 32768 × 1024 |
| 70 | RMSNorm_12_1 | RMSNorm | 1 × 32768 × 1024 |
| 71 | Attention_12 | Grouped Query Attn | 1 × 32768 × 1024 |
| 72 | Add_12_attn | Add | 1 × 32768 × 1024 |
| 73 | RMSNorm_12_2 | RMSNorm | 1 × 32768 × 1024 |
| 74 | FFN_12 | SwiGLU | 1 × 32768 × 1024 |
| 75 | Add_12_ffn | Add | 1 × 32768 × 1024 |
| 76 | RMSNorm_13_1 | RMSNorm | 1 × 32768 × 1024 |
| 77 | Attention_13 | Grouped Query Attn | 1 × 32768 × 1024 |
| 78 | Add_13_attn | Add | 1 × 32768 × 1024 |
| 79 | RMSNorm_13_2 | RMSNorm | 1 × 32768 × 1024 |
| 80 | FFN_13 | SwiGLU | 1 × 32768 × 1024 |
| 81 | Add_13_ffn | Add | 1 × 32768 × 1024 |
| 82 | RMSNorm_14_1 | RMSNorm | 1 × 32768 × 1024 |
| 83 | Attention_14 | Grouped Query Attn | 1 × 32768 × 1024 |
| 84 | Add_14_attn | Add | 1 × 32768 × 1024 |
| 85 | RMSNorm_14_2 | RMSNorm | 1 × 32768 × 1024 |
| 86 | FFN_14 | SwiGLU | 1 × 32768 × 1024 |
| 87 | Add_14_ffn | Add | 1 × 32768 × 1024 |
| 88 | RMSNorm_15_1 | RMSNorm | 1 × 32768 × 1024 |
| 89 | Attention_15 | Grouped Query Attn | 1 × 32768 × 1024 |
| 90 | Add_15_attn | Add | 1 × 32768 × 1024 |
| 91 | RMSNorm_15_2 | RMSNorm | 1 × 32768 × 1024 |
| 92 | FFN_15 | SwiGLU | 1 × 32768 × 1024 |
| 93 | Add_15_ffn | Add | 1 × 32768 × 1024 |
| 94 | RMSNorm_16_1 | RMSNorm | 1 × 32768 × 1024 |
| 95 | Attention_16 | Grouped Query Attn | 1 × 32768 × 1024 |
| 96 | Add_16_attn | Add | 1 × 32768 × 1024 |
| 97 | RMSNorm_16_2 | RMSNorm | 1 × 32768 × 1024 |
| 98 | FFN_16 | SwiGLU | 1 × 32768 × 1024 |
| 99 | Add_16_ffn | Add | 1 × 32768 × 1024 |
| 100 | RMSNorm_17_1 | RMSNorm | 1 × 32768 × 1024 |
| 101 | Attention_17 | Grouped Query Attn | 1 × 32768 × 1024 |
| 102 | Add_17_attn | Add | 1 × 32768 × 1024 |
| 103 | RMSNorm_17_2 | RMSNorm | 1 × 32768 × 1024 |
| 104 | FFN_17 | SwiGLU | 1 × 32768 × 1024 |
| 105 | Add_17_ffn | Add | 1 × 32768 × 1024 |
| 106 | RMSNorm_18_1 | RMSNorm | 1 × 32768 × 1024 |
| 107 | Attention_18 | Grouped Query Attn | 1 × 32768 × 1024 |
| 108 | Add_18_attn | Add | 1 × 32768 × 1024 |
| 109 | RMSNorm_18_2 | RMSNorm | 1 × 32768 × 1024 |
| 110 | FFN_18 | SwiGLU | 1 × 32768 × 1024 |
| 111 | Add_18_ffn | Add | 1 × 32768 × 1024 |
| 112 | RMSNorm_19_1 | RMSNorm | 1 × 32768 × 1024 |
| 113 | Attention_19 | Grouped Query Attn | 1 × 32768 × 1024 |
| 114 | Add_19_attn | Add | 1 × 32768 × 1024 |
| 115 | RMSNorm_19_2 | RMSNorm | 1 × 32768 × 1024 |
| 116 | FFN_19 | SwiGLU | 1 × 32768 × 1024 |
| 117 | Add_19_ffn | Add | 1 × 32768 × 1024 |
| 118 | RMSNorm_20_1 | RMSNorm | 1 × 32768 × 1024 |
| 119 | Attention_20 | Grouped Query Attn | 1 × 32768 × 1024 |
| 120 | Add_20_attn | Add | 1 × 32768 × 1024 |
| 121 | RMSNorm_20_2 | RMSNorm | 1 × 32768 × 1024 |
| 122 | FFN_20 | SwiGLU | 1 × 32768 × 1024 |
| 123 | Add_20_ffn | Add | 1 × 32768 × 1024 |
| 124 | RMSNorm_21_1 | RMSNorm | 1 × 32768 × 1024 |
| 125 | Attention_21 | Grouped Query Attn | 1 × 32768 × 1024 |
| 126 | Add_21_attn | Add | 1 × 32768 × 1024 |
| 127 | RMSNorm_21_2 | RMSNorm | 1 × 32768 × 1024 |
| 128 | FFN_21 | SwiGLU | 1 × 32768 × 1024 |
| 129 | Add_21_ffn | Add | 1 × 32768 × 1024 |
| 130 | RMSNorm_22_1 | RMSNorm | 1 × 32768 × 1024 |
| 131 | Attention_22 | Grouped Query Attn | 1 × 32768 × 1024 |
| 132 | Add_22_attn | Add | 1 × 32768 × 1024 |
| 133 | RMSNorm_22_2 | RMSNorm | 1 × 32768 × 1024 |
| 134 | FFN_22 | SwiGLU | 1 × 32768 × 1024 |
| 135 | Add_22_ffn | Add | 1 × 32768 × 1024 |
| 136 | RMSNorm_23_1 | RMSNorm | 1 × 32768 × 1024 |
| 137 | Attention_23 | Grouped Query Attn | 1 × 32768 × 1024 |
| 138 | Add_23_attn | Add | 1 × 32768 × 1024 |
| 139 | RMSNorm_23_2 | RMSNorm | 1 × 32768 × 1024 |
| 140 | FFN_23 | SwiGLU | 1 × 32768 × 1024 |
| 141 | Add_23_ffn | Add | 1 × 32768 × 1024 |
| 142 | RMSNorm_24_1 | RMSNorm | 1 × 32768 × 1024 |
| 143 | Attention_24 | Grouped Query Attn | 1 × 32768 × 1024 |
| 144 | Add_24_attn | Add | 1 × 32768 × 1024 |
| 145 | RMSNorm_24_2 | RMSNorm | 1 × 32768 × 1024 |
| 146 | FFN_24 | SwiGLU | 1 × 32768 × 1024 |
| 147 | Add_24_ffn | Add | 1 × 32768 × 1024 |
| 148 | Output | Output | 1 × 32768 × 1024 |
What the verifier says
deep-attention-default-init
What changed upstream
The change tracker follows stepfun-ai/GOT-OCR2_0: 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 stepfun-ai/GOT-OCR2_0 --plan --share