Models / xlm-roberta
multilingual-e5-large: GPU memory to fine-tune
Fine-tuning multilingual-e5-large at batch 1 and 514 tokens takes about 11.2 GB of GPU memory for a full fine-tune (borderline on one T4 16 GB), and 1.69 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. 7.0M 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, 514 tokens over 50,000 samples (assumed; no dataset attached).
Memory: what fits on which card
Largest batch per card. Training is sized at 514 tokens per sample, serving at 514 tokens per sequence.
| Card | Full fine-tune | LoRA r=16 | Serve bf16, 514 tokens |
|---|---|---|---|
| T4 16 GB | batch 7, borderline | batch 29 | batch 253 |
| L4 24 GB | batch 23 | batch 45 | batch 390 |
| A100 40 GB | batch 55 | batch 77 | batch 666 |
| A100 / H100 80 GB | batch 136 | batch 158 | batch 1354 |
| H200 141 GB | batch 259 | batch 281 | batch 2404 |
Training: 514 tokens per sample (2048, or the model's context when shorter), 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 514 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
100 nodes. Output shapes are propagated from the input shape, batch dimension excluded, at 514 tokens: the config's maximum context.
| Layer | Type | Output shape | |
|---|---|---|---|
| 1 | Input | Input | 1 × 514 |
| 2 | Embedding | Embedding | 1 × 514 × 1024 |
| 3 | Positional_Embedding | Learned Pos Embed | 1 × 514 × 1024 |
| 4 | Attention_1 | Multi-Head Attention | 1 × 514 × 1024 |
| 5 | Add_1 | Add | 1 × 514 × 1024 |
| 6 | LayerNorm_1_1 | LayerNorm | 1 × 514 × 1024 |
| 7 | FFN_1 | Feed Forward | 1 × 514 × 1024 |
| 8 | Attention_2 | Multi-Head Attention | 1 × 514 × 1024 |
| 9 | Add_2 | Add | 1 × 514 × 1024 |
| 10 | LayerNorm_2_1 | LayerNorm | 1 × 514 × 1024 |
| 11 | FFN_2 | Feed Forward | 1 × 514 × 1024 |
| 12 | Attention_3 | Multi-Head Attention | 1 × 514 × 1024 |
| 13 | Add_3 | Add | 1 × 514 × 1024 |
| 14 | LayerNorm_3_1 | LayerNorm | 1 × 514 × 1024 |
| 15 | FFN_3 | Feed Forward | 1 × 514 × 1024 |
| 16 | Attention_4 | Multi-Head Attention | 1 × 514 × 1024 |
| 17 | Add_4 | Add | 1 × 514 × 1024 |
| 18 | LayerNorm_4_1 | LayerNorm | 1 × 514 × 1024 |
| 19 | FFN_4 | Feed Forward | 1 × 514 × 1024 |
| 20 | Attention_5 | Multi-Head Attention | 1 × 514 × 1024 |
| 21 | Add_5 | Add | 1 × 514 × 1024 |
| 22 | LayerNorm_5_1 | LayerNorm | 1 × 514 × 1024 |
| 23 | FFN_5 | Feed Forward | 1 × 514 × 1024 |
| 24 | Attention_6 | Multi-Head Attention | 1 × 514 × 1024 |
| 25 | Add_6 | Add | 1 × 514 × 1024 |
| 26 | LayerNorm_6_1 | LayerNorm | 1 × 514 × 1024 |
| 27 | FFN_6 | Feed Forward | 1 × 514 × 1024 |
| 28 | Attention_7 | Multi-Head Attention | 1 × 514 × 1024 |
| 29 | Add_7 | Add | 1 × 514 × 1024 |
| 30 | LayerNorm_7_1 | LayerNorm | 1 × 514 × 1024 |
| 31 | FFN_7 | Feed Forward | 1 × 514 × 1024 |
| 32 | Attention_8 | Multi-Head Attention | 1 × 514 × 1024 |
| 33 | Add_8 | Add | 1 × 514 × 1024 |
| 34 | LayerNorm_8_1 | LayerNorm | 1 × 514 × 1024 |
| 35 | FFN_8 | Feed Forward | 1 × 514 × 1024 |
| 36 | Attention_9 | Multi-Head Attention | 1 × 514 × 1024 |
| 37 | Add_9 | Add | 1 × 514 × 1024 |
| 38 | LayerNorm_9_1 | LayerNorm | 1 × 514 × 1024 |
| 39 | FFN_9 | Feed Forward | 1 × 514 × 1024 |
| 40 | Attention_10 | Multi-Head Attention | 1 × 514 × 1024 |
| 41 | Add_10 | Add | 1 × 514 × 1024 |
| 42 | LayerNorm_10_1 | LayerNorm | 1 × 514 × 1024 |
| 43 | FFN_10 | Feed Forward | 1 × 514 × 1024 |
| 44 | Attention_11 | Multi-Head Attention | 1 × 514 × 1024 |
| 45 | Add_11 | Add | 1 × 514 × 1024 |
| 46 | LayerNorm_11_1 | LayerNorm | 1 × 514 × 1024 |
| 47 | FFN_11 | Feed Forward | 1 × 514 × 1024 |
| 48 | Attention_12 | Multi-Head Attention | 1 × 514 × 1024 |
| 49 | Add_12 | Add | 1 × 514 × 1024 |
| 50 | LayerNorm_12_1 | LayerNorm | 1 × 514 × 1024 |
| 51 | FFN_12 | Feed Forward | 1 × 514 × 1024 |
| 52 | Attention_13 | Multi-Head Attention | 1 × 514 × 1024 |
| 53 | Add_13 | Add | 1 × 514 × 1024 |
| 54 | LayerNorm_13_1 | LayerNorm | 1 × 514 × 1024 |
| 55 | FFN_13 | Feed Forward | 1 × 514 × 1024 |
| 56 | Attention_14 | Multi-Head Attention | 1 × 514 × 1024 |
| 57 | Add_14 | Add | 1 × 514 × 1024 |
| 58 | LayerNorm_14_1 | LayerNorm | 1 × 514 × 1024 |
| 59 | FFN_14 | Feed Forward | 1 × 514 × 1024 |
| 60 | Attention_15 | Multi-Head Attention | 1 × 514 × 1024 |
| 61 | Add_15 | Add | 1 × 514 × 1024 |
| 62 | LayerNorm_15_1 | LayerNorm | 1 × 514 × 1024 |
| 63 | FFN_15 | Feed Forward | 1 × 514 × 1024 |
| 64 | Attention_16 | Multi-Head Attention | 1 × 514 × 1024 |
| 65 | Add_16 | Add | 1 × 514 × 1024 |
| 66 | LayerNorm_16_1 | LayerNorm | 1 × 514 × 1024 |
| 67 | FFN_16 | Feed Forward | 1 × 514 × 1024 |
| 68 | Attention_17 | Multi-Head Attention | 1 × 514 × 1024 |
| 69 | Add_17 | Add | 1 × 514 × 1024 |
| 70 | LayerNorm_17_1 | LayerNorm | 1 × 514 × 1024 |
| 71 | FFN_17 | Feed Forward | 1 × 514 × 1024 |
| 72 | Attention_18 | Multi-Head Attention | 1 × 514 × 1024 |
| 73 | Add_18 | Add | 1 × 514 × 1024 |
| 74 | LayerNorm_18_1 | LayerNorm | 1 × 514 × 1024 |
| 75 | FFN_18 | Feed Forward | 1 × 514 × 1024 |
| 76 | Attention_19 | Multi-Head Attention | 1 × 514 × 1024 |
| 77 | Add_19 | Add | 1 × 514 × 1024 |
| 78 | LayerNorm_19_1 | LayerNorm | 1 × 514 × 1024 |
| 79 | FFN_19 | Feed Forward | 1 × 514 × 1024 |
| 80 | Attention_20 | Multi-Head Attention | 1 × 514 × 1024 |
| 81 | Add_20 | Add | 1 × 514 × 1024 |
| 82 | LayerNorm_20_1 | LayerNorm | 1 × 514 × 1024 |
| 83 | FFN_20 | Feed Forward | 1 × 514 × 1024 |
| 84 | Attention_21 | Multi-Head Attention | 1 × 514 × 1024 |
| 85 | Add_21 | Add | 1 × 514 × 1024 |
| 86 | LayerNorm_21_1 | LayerNorm | 1 × 514 × 1024 |
| 87 | FFN_21 | Feed Forward | 1 × 514 × 1024 |
| 88 | Attention_22 | Multi-Head Attention | 1 × 514 × 1024 |
| 89 | Add_22 | Add | 1 × 514 × 1024 |
| 90 | LayerNorm_22_1 | LayerNorm | 1 × 514 × 1024 |
| 91 | FFN_22 | Feed Forward | 1 × 514 × 1024 |
| 92 | Attention_23 | Multi-Head Attention | 1 × 514 × 1024 |
| 93 | Add_23 | Add | 1 × 514 × 1024 |
| 94 | LayerNorm_23_1 | LayerNorm | 1 × 514 × 1024 |
| 95 | FFN_23 | Feed Forward | 1 × 514 × 1024 |
| 96 | Attention_24 | Multi-Head Attention | 1 × 514 × 1024 |
| 97 | Add_24 | Add | 1 × 514 × 1024 |
| 98 | LayerNorm_24_1 | LayerNorm | 1 × 514 × 1024 |
| 99 | FFN_24 | Feed Forward | 1 × 514 × 1024 |
| 100 | Output | Output | 1 × 514 × 1024 |
What the verifier says
deep-attention-default-init
What changed upstream
The change tracker follows intfloat/multilingual-e5-large: 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 intfloat/multilingual-e5-large --plan --share