Fine-tuning a 7B model needs about 113 GiB of GPU memory when you update every weight in mixed precision, about 13 GiB with LoRA on a 16-bit base model, and about 4 to 5 GiB with QLoRA. Those are the fixed costs. Activations, which depend on batch size and sequence length, come on top, so a card needs a few GiB more than the figure in each row.
The numbers below are counted from bytes per parameter, using Llama 2 7B’s published layer sizes. They are arithmetic from documented sources, not measurements on a particular card. Sources were read on December 3, 2026.
The three numbers side by side
Llama 2 7B has 6,738,415,616 parameters, which is what its published configuration ↗ adds up to: 32 layers, hidden size 4,096, feed-forward size 11,008 and a 32,000-token vocabulary. Sizes here are in GiB (2^30 bytes), the unit a graphics card’s memory is counted in.
| Method | What sits in GPU memory | Fixed cost, 7B model |
|---|---|---|
| Full fine-tuning, mixed precision | 16-bit weights + fp32 master copy (6 B), fp32 gradients (4 B), Adam state (8 B) = 18 bytes per parameter | 113.0 GiB |
| Full fine-tuning, 16-bit weights and gradients | 2 + 2 + 8 (Adam) = 12 bytes per parameter | 75.3 GiB |
| LoRA, 16-bit base, rank 16 on all linear layers | Frozen base (2 B per parameter) + 40.0 million adapter parameters with gradients and Adam state | 13.2 GiB |
| QLoRA, 4-bit base, same adapter | 4.127-bit base for the linear layers, 16-bit embeddings, same adapter | 4.2 GiB |
The fixed cost is what must fit before the first batch runs. The rest of this page shows where each row comes from, so you can redo it for another model.
Why full fine-tuning costs 18 bytes per parameter
Hugging Face’s GPU memory usage guide ↗ lists what training keeps on the card. In mixed precision there are two copies of the weights, one in 16-bit for the forward and backward pass and one in fp32 as the main copy: 6 bytes per parameter. Adam stores a momentum and a variance tensor in fp32, 8 bytes more. Gradients are kept in fp32, 4 bytes. The guide does not add them up, but 6 + 8 + 4 is 18 bytes, and 6.74 billion parameters times 18 is 113 GiB. The guide’s own example is a 4B model at batch size 16 that “requires roughly 85GB”. Eighteen bytes times 4 billion is 72 GB, which leaves about 13 GB for activations and temporary tensors at that batch size.
A leaner setup exists. The QLoRA paper says its 65B model needs more than 780 GB when finetuned in 16 bits. Divide 780 GB by 65 billion parameters and you get 12 bytes per parameter, which fits 16-bit weights, 16-bit gradients and 8 bytes of Adam state. The paper does not spell out that split, so treat it as our reading of the figure. Applied to 7B it gives the 75.3 GiB row. The same guide notes that a quantized Adam from bitsandbytes can compress the optimizer state from 8 bytes to 2 bytes per parameter, which would take the 18-byte count down to 12.
Either way, full fine-tuning of a 7B model does not fit on one card in the mixed-precision count, and the lean count leaves an 80 GiB card under 5 GiB for activations. Sharding the state across several cards is the usual route, which this page does not size. That cost is the reason adapter methods exist.
LoRA: freeze the base, train 40 million parameters
LoRA freezes the original weights and trains two small matrices beside each chosen layer. The LoRA paper ↗ says that, compared with GPT-3 175B fine-tuned with Adam, it can cut trainable parameters by 10,000 times and the GPU memory requirement by 3 times. The 3 times is the shape of the saving: the frozen base still has to sit on the card.
For a linear layer with in inputs and out outputs, a rank-r adapter adds r × (in + out) parameters. This is our derivation from the matrix shapes in the PEFT LoRA reference ↗, whose all-linear setting targets every linear layer except the output layer. For one Llama 2 7B layer at rank 16:
| Layers in one block | Shape | Adapter parameters |
|---|---|---|
| Query, key, value, output projections (4) | 4,096 → 4,096 | 4 × 16 × 8,192 = 524,288 |
| Gate and up projections (2) | 4,096 → 11,008 | 2 × 16 × 15,104 = 483,328 |
| Down projection (1) | 11,008 → 4,096 | 1 × 16 × 15,104 = 241,664 |
| One block | 1,249,280 |
Thirty-two blocks give 39,976,960 trainable parameters, 0.59% of the model. If the adapter is kept in fp32, with a gradient and two Adam tensors, that is 16 bytes each: 0.6 GiB. Add the frozen 16-bit base at 12.55 GiB and the fixed cost is 13.2 GiB. PEFT’s default rank is 8, which halves the adapter to 20.0 million parameters and 0.3 GiB. The adapter is small enough that its rank hardly matters for memory: even rank 64 is only 2.4 GiB of adapter state.
QLoRA: store the base in 4 bits
QLoRA keeps the base model frozen in 4-bit NormalFloat and trains the same kind of adapter. The paper’s Double Quantization ↗ stores the scaling constants more compactly, so the overhead drops from 0.5 to 0.127 bits per parameter. A quantized linear weight therefore costs 4.127 bits, or 0.516 bytes.
For 7B the linear layers hold 6,476,005,376 of the parameters. At 0.516 bytes that is 3.11 GiB. The embedding and output matrices (262 million parameters) stay in 16 bits and add 0.49 GiB. With the same 0.6 GiB adapter state the total is 4.2 GiB.
The paper reports a larger base. For a 7B LLaMA with a batch size of 1, it says “the 4-bit base model consumes 5,048 MB”. The text does not break that figure down, so we cannot tell what accounts for the extra 1.3 GiB over our count. Plan on the paper’s figure rather than ours: about 4.9 GiB for the base, plus the adapter. The paper also notes that the LoRA parameters take 26 MB at its 0.2% adapter size, and that shrinking the adapter further saves little; what matters for accuracy is putting adapters on all linear layers.
The part the table leaves out: activations
The forward pass caches intermediate values for the backward pass. The Hugging Face guide says these “vary in size with batch size, sequence length, model depth, and hidden size”, which is why a batch or a long sequence can exhaust memory even if the model itself fits. Two data points from the sources:
- The QLoRA paper measures LoRA input gradients for a 7B model at batch size 1 and 512 tokens: 567 MB without gradient checkpointing, an average of 18 MB per sequence with it.
- The Hugging Face example above implies roughly 13 GB of non-static memory for a 4B model at batch size 16.
Gradient checkpointing trades compute for memory: it recomputes activations instead of storing them. For a short-sequence job at batch size 1, the fixed cost is nearly the whole story. For long documents or larger batches, leave several GiB free and cut the batch first when memory runs out. The paper’s paged optimizers use NVIDIA unified memory to move optimizer state to CPU RAM during spikes instead of failing.
Which card fits which method
A card’s usable memory is a little below its label, because the display, driver and framework take some. These rows compare the fixed costs above with common card sizes.
| Card memory | QLoRA, 7B | LoRA, 16-bit base | Full fine-tuning |
|---|---|---|---|
| 8 GiB | Tight: 4.9 GiB base plus adapter leaves little for activations; short sequences, batch 1 | No | No |
| 12 GiB | Comfortable at short and medium sequences | No (13.2 GiB fixed) | No |
| 16 GiB | Room for longer sequences | Barely: about 2.8 GiB left for activations | No |
| 24 GiB | Room for large batches or long sequences | Yes, about 10.8 GiB left | No |
| 80 GiB | Not needed | Yes | No: 113.0 GiB fixed; even the lean 75.3 GiB leaves under 5 GiB for activations |
These are our calculations from the figures above, not benchmark results.
Scaling to other model sizes
Multiply the parameter count by the bytes in the table, then add the adapter and room for activations.
| Method | Bytes per parameter | 13B model | 70B model |
|---|---|---|---|
| Full, mixed precision | 18 | 218 GiB | 1,173 GiB |
| LoRA, 16-bit base | about 2 | about 25 GiB | about 130 GiB |
| QLoRA | about 0.52 to 0.57 | about 7.6 GiB | about 34 to 37 GiB |
The 13B figures assume Llama 2 13B’s published shape (40 layers, hidden size 5,120, feed-forward 13,824). The 70B column is a straight scaling of bytes per parameter and ignores shape details, which move it by a few percent. The QLoRA paper’s own headline for 65B is “<48GB”, which agrees with a 65B base of about 31 to 35 GiB by the same arithmetic, plus adapter and activations. For inference rather than training, use our memory calculator; the weights-only side of this page is the same arithmetic as our model precision formats guide, and the context cache that inference adds is in KV cache memory.





