LLM Full Fine-Tuning vs. LoRA / QLoRA Training VRAM Calculator

Estimate optimizer states, gradients, base weights, and activation VRAM for LoRA/QLoRA.

LoRA / QLoRA Training VRAM Required 20.09 GB
Frozen Base Model Weights 7 GB
Adapter Gradients + AdamW States 3.36 GB
Full FP16 Fine-Tuning Comparison 252 GB
Inputs
Try:
B params
Base LLM parameter count in billions.
bits
Frozen base model precision in bits (4 for QLoRA, 16 for LoRA).
%
Percentage of trainable LoRA adapter parameters (%).
tokens
Training sequence token length.
Results & Graph
LoRA / QLoRA Training VRAM Required
20.09 GB
Frozen Base Model Weights
7 GB
Adapter Gradients + AdamW States
3.36 GB
Full FP16 Fine-Tuning Comparison
252 GB

LoRA / QLoRA Training VRAM Required

Graph 1 • How the inputs feed LoRA & QLoRA VRAM
LLM Full Fine-Tuning vs. LoRA / QLoRA Training VRAM Calculator • Custom Domain Schematic (AI & LLM Infrastructure) baseModebaseWeigOut Base Model Billions: 14 B params • Base Weight Bits: 4 bits LORA / QLORA TRAINING VRAM 20.09 GB • Frozen Base Model Weig: 7 GB • Adapter Gradients + Ad: 3.36 GB Eq: LoRA_VRAM_GB ≈ BaseParams_B × (B
Graph 2 • LoRA / QLoRA Training VRAM Required as Base Model Billions changes (40% to 160% of current)
0 GB 15.88 GB 31.77 GB 10.30 5.60 13.75 8.40 16.99 11.20 20.09 14 23.09 16.80 26.01 19.60 28.88 22.40
Graph 3 • Base Model Billions and Base Weight Bits together Compares LoRA / QLoRA Training VRAM Required when Base Weight Bits is shifted +25% (solid) vs. −25% (dashed).
0 GB 14.36 GB 28.73 GB --- Base Weight Bits @ 75% 14.06 -30% 17.08 -15% 20.09 +0% 23.10 +15% 26.12 +30%
Summary: Training a 1.5% adapter on a 14B (4-bit) base model requires ~20.09 GB VRAM vs. ~252 GB for full FP16 AdamW fine-tuning.
Summary: Training a 1.5% adapter on a 14B (4-bit) base model requires ~20.09 GB VRAM vs. ~252 GB for full FP16 AdamW fine-tuning.
Interactive chart & math engine powered by CalculatorGraph

Formula: LoRA & QLoRA VRAM Systems Engineering Formula

LoRAVRAMGB ≈ BaseParamsB × (BaseBits ÷ 8) + TrainableAdapterRatio × BaseParamsB × 16 + ActivationBuffer (4-bit: 0.5 GB per billion params)
LoRA_VRAM_GB ≈ BaseParams_B × (BaseBits ÷ 8) + TrainableAdapterRatio × BaseParams_B × 16 + ActivationBuffer (4-bit: 0.5 GB per billion params)
  • baseModelBillions: Base Model Billions (B params)
  • baseWeightBits: Base Weight Bits (bits)
  • trainableAdapterPct: Trainable Adapter Pct (%)
  • sequenceLengthTokens: Sequence Length Tokens (tokens)

Frequently Asked Questions

Why don't the supporting lines add up to the total?

Because activation memory is part of the total but has no line of its own. At the default, 7 GB of weights plus 3.36 GB of adapter and optimizer memory is 10.36 GB, and the remaining 9.73 GB of the 20.09 GB total is the activation estimate. Subtract the two printed lines from the headline to see it.

What adapter percentage should I enter?

Use the trainable parameter percentage your training library prints after it attaches the LoRA layers. It depends on the rank you choose and which modules you target, so a fixed rule of thumb can be well off. The default of 1.5% is only a starting value; entering your real figure makes the optimizer line accurate.

Does the calculator account for batch size?

No. There is no batch size field, and the activation formula uses only sequence length and model size. If you train several sequences per step, activation memory will be higher than the estimate. Gradient accumulation lets you keep a small per-step batch while reaching a larger effective batch, which keeps memory close to the single-sequence figure.

How much does switching from 4-bit to 16-bit base weights add?

For the default 14 billion parameter model, the frozen weights grow from 7 GB to 28 GB and the total from 20.09 GB to 41.09 GB. Only the weight line changes; the adapter and activation estimates stay the same. At 8 bits the weights are 14 GB and the total is 27.09 GB.

Why is the full fine-tuning figure not affected by the bits setting?

Full fine-tuning updates every weight, so the engine always prices it at 18 bytes per parameter for half-precision weights, gradients and AdamW states. The bits field describes how a frozen base is stored in LoRA or QLoRA, which does not apply when nothing is frozen. That is why 252 GB stays fixed for 14 billion parameters.

Is the activation estimate reliable?

It is a rough rule, not a measurement. It scales with sequence length and the square root of the parameter count, and ignores batch size, gradient checkpointing and architecture details. Use it to compare options against each other, then confirm with a short real training run and the peak memory your framework reports.

Will a 20.09 GB estimate fit on a card with that much memory?

Probably not comfortably. The engine leaves out framework overhead, the driver context, memory fragmentation and the working space needed when 4-bit weights are expanded during computation. Leave headroom above the estimate, or reduce the sequence length or model size until the total sits clearly below your card's capacity.

Can I use this for inference memory?

Not directly. Inference needs no gradients or optimizer states, so the adapter line does not apply, and activation and cache memory follow different rules from training. The frozen weights line is still a fair estimate of the space the model's weights take at a given precision, which is a useful part of an inference budget.

Can I enter 32 bits for the base weights?

Yes. The bits field accepts 4, 8, 16 or 32 and rejects anything else with a message. At 32 bits the default 14 billion parameter model needs 56 GB for its frozen weights and 69.09 GB in total, against 7 GB and 20.09 GB at 4 bits. The adapter and activation estimates do not change with the bits setting.

Why does a 100% adapter cost more than full fine-tuning?

The full fine-tuning line excludes activation memory, while the LoRA total includes it, and the LoRA total also counts the frozen base separately. Pushing the adapter to 100% double counts the weights and makes the comparison unfair. Real LoRA adapters train a small fraction of the parameters, which is the range where the comparison is meaningful.

Why does going from 14 to 21 billion parameters not raise the total by half?

Only the weights and adapter lines scale in direct proportion to parameter count. The activation estimate grows with the square root of the parameter count, so it rises by only about 22% for a model one and a half times larger. That is why the 21 billion preset reaches 27.45 GB rather than about 30 GB.

Splitting the default 20.09 GB into its three parts

The default setup is a 14 billion parameter model with its frozen weights stored at 4 bits, a trainable adapter equal to 1.5% of the base parameters, and a training sequence of 4096 tokens. That is a typical QLoRA configuration. The calculator estimates 20.09 GB of GPU memory, and sets that against 252 GB for a full FP16 fine-tune with AdamW.

The 20.09 GB is the sum of three pieces. Two of them are printed as supporting lines: 7 GB for the frozen base weights and 3.36 GB for the adapter's gradients and optimizer states. The third piece, the activation memory, is not shown on its own. You can recover it by subtraction: 20.09 minus 7 minus 3.36 leaves 9.73 GB.

That hidden third is the largest single component in the default. It is also the least certain, because it comes from a rough rule rather than from the model's architecture. Anyone planning a real run should read the 20.09 figure with that in mind: the weight and optimizer lines are close to exact arithmetic, while nearly half the total is an approximation.

Frozen weights: parameters times bits divided by eight

The frozen base model line is the simplest. Each parameter takes bits divided by 8 bytes, and one billion parameters at one byte each is one gigabyte. So 14 billion parameters at 4 bits is 14 times 0.5, which is 7 GB.

Change the bits field and only this line moves. At 8 bits the weights take 14 GB and the total rises to 27.09 GB. At 16 bits, which is ordinary LoRA on a half-precision base, the weights take 28 GB and the total becomes 41.09 GB. The adapter and activation parts stay the same.

The engine's figure is the raw storage of the weights and nothing more. Real 4-bit formats store extra scaling constants for each block of weights, which adds a little. Both the page formula and the engine use exactly 0.5 GB per billion parameters at 4 bits, so that overhead is not included. Expect the real weight footprint to be slightly higher than the 7 GB shown.

The field accepts only 4, 8, 16 or 32 bits, the precisions training libraries actually offer for a frozen base. Anything else, such as 2 or 6, returns a message asking for one of those values. A full-precision 32-bit base is rarely worth it for adapter training: it doubles the weights to 56 GB and lifts the default total to 69.09 GB.

Adapter optimizer memory at 16 bytes per trainable parameter

The second line covers everything the optimizer needs for the parameters you actually train. The engine charges 16 bytes for each one. A common way to account for that is two bytes for the half-precision adapter weight, two for its gradient, four for a full-precision master copy, and eight for the two AdamW moment estimates.

At the default, 1.5% of 14 billion is 0.21 billion trainable parameters. Multiply by 16 bytes and you get 3.36 GB. The presets scale it exactly: 2.02 GB for an 8.4 billion parameter base and 5.04 GB for a 21 billion parameter base.

The adapter percentage is the input most people guess. It depends on the LoRA rank and on which layers you attach adapters to, so two runs on the same model can differ a lot. Most training libraries print the trainable parameter count and percentage when they wrap the model. Use that printed value here rather than a rule of thumb.

Dropping the adapter to 0.5% cuts this line to 1.12 GB and brings the total down to 17.85 GB. That is a saving of only about 2.2 GB, which shows that on a QLoRA setup the adapter is rarely what decides whether a model fits.

Activation memory: a rule of thumb that ignores batch size

The engine estimates activations as sequence length in thousands of tokens, times the square root of the parameter count in billions, times 0.65 GB. For the default, 4096 tokens counts as 4, the square root of 14 is about 3.74, and 4 times 3.74 times 0.65 is the 9.73 GB found by subtraction above.

Sequence length is the only setting you control that moves this part. Halving the sequence to about two thousand tokens brings the total down to 15.22 GB. Doubling it to about eight thousand tokens raises the total to 29.82 GB. The relationship is linear in this engine.

Several things that matter in real training are not in the formula at all. There is no batch size input, so you cannot see what happens when you process several sequences at once. There is no setting for gradient checkpointing, which trades extra compute for much lower activation memory. The model's hidden size and layer count are folded into the square root of the parameter count, which is only a loose proxy for architecture.

Treat the activation estimate as a starting guess for a single sequence per step with ordinary settings. If your run uses a larger batch, expect more. If it uses gradient checkpointing, expect less.

The 252 GB full fine-tuning line is weights and optimizer only

The comparison line multiplies the parameter count by 18 bytes. For 14 billion parameters that gives 252 GB. The presets give 151.2 GB for 8.4 billion and 378 GB for 21 billion. This figure does not depend on the bits field, because full fine-tuning trains every weight in half precision regardless of how you would store a frozen base.

Notice what is missing from it: activations. The LoRA total includes the 9.73 GB activation estimate, but the full fine-tuning number does not include any. So the gap between the two is a little smaller than the raw figures suggest, and in a real full fine-tune you would need activation memory on top of the 252 GB.

The omission shows up if you push the adapter to 100% on a 16-bit base. The engine then reports more memory for the LoRA run than for full fine-tuning, which cannot be right, because training every weight through an adapter is not cheaper than training them directly. Keep the adapter percentage in a realistic range and the comparison stays meaningful.

How the three presets scale with model size

The presets hold everything at the default except the parameter count, which moves from 8.4 to 14 to 21 billion. The totals are 13.75 GB, 20.09 GB and 27.45 GB. Those steps are not proportional to model size, and the reason is in how each part scales.

The weights and the adapter line both grow in direct proportion to the parameter count. The 21 billion model has 10.5 GB of weights and 5.04 GB of adapter memory, exactly one and a half times the default figures. The activation estimate, though, grows only with the square root of the parameter count, so a model one and a half times larger gets only about 22% more activation memory.

The practical effect is that small models are dominated by activations and large models by weights. For the 8.4 billion preset, the weights are 4.2 GB and the adapter 2.02 GB, so the activation estimate is more than half of the 13.75 GB total. For very large bases, the 4-bit weights become the main cost.

That pattern tells you where to look first when a run does not fit. On a small model, shorten the sequence. On a large one, check the base precision.

What the estimate does not reserve for

Every training run uses memory that none of the three lines covers. The framework itself, the GPU driver context and the memory allocator take a share before your model loads. Memory fragmentation during training means the peak usage can be higher than the sum of the tensors. In 4-bit training, weights are temporarily expanded to higher precision during each forward and backward pass, which needs working space.

The engine has no allowance for any of this. In practice that means a run estimated at 20.09 GB is unlikely to fit comfortably on a card with exactly that much memory. Plan for headroom.

Units are decimal gigabytes: one billion bytes. Many tools report memory in binary gibibytes, which are about 7% larger, so the same number of bytes reads as a slightly smaller figure in GiB. The difference is small next to the uncertainty in the activation estimate, but it can confuse a comparison with a monitoring tool.

Sizing a GPU from the result

A sensible workflow is to start with the model you want, set the bits to match your plan, and enter the adapter percentage your library reports. Then run the calculator at your target sequence length and note the total. That is the lower end of what you need.

If the total is close to your card's capacity, the levers are clear from the earlier sections. Lowering the base precision from 16 bits to 4 removes three quarters of the weight memory. Shortening the sequence cuts the activation share in proportion. Shrinking the adapter helps least. Moving to a smaller base model reduces all three, as the 8.4 billion preset shows with 13.75 GB in total.

Before buying or renting hardware on the strength of this estimate, do a short test run with your real batch size and settings, and watch the peak memory your framework reports. The calculator is good for ruling options in or out quickly. It is not a substitute for a measured number from the actual training script.