Wandering Giants Compute · Learn
Complete guide

What Is GPU Model Training? A Complete Guide

The short answer

GPU model training is adjusting a neural network's weights on graphics processors, which run the matrix maths of forward and backward passes far faster than CPUs. Its requirements follow from two numbers: memory (about 16–20 bytes per parameter for full training, far less with LoRA) and compute (about 6 × parameters × tokens FLOPs).

Training compute
≈ 6 × parameters × training tokens FLOPs
Full training memory (Adam, mixed precision)
≈ 16–20 bytes per parameter + activations
LoRA / QLoRA base memory
≈ 2 / ≈ 0.5–0.6 bytes per parameter + a few GB
Fine-tune Llama 3.1 8B (QLoRA)
≈ 8–13 GB VRAM; fits an RTX 4090
Fine-tune Llama 3.3 70B (QLoRA)
≈ 45–60 GB VRAM; fits one 80 GB GPU
Multi-GPU strategies
DDP (speed), FSDP / DeepSpeed ZeRO (memory)
Common tools
PyTorch, Hugging Face TRL and PEFT, Unsloth, Axolotl, DeepSpeed

Training is where a model's abilities come from, and GPUs are what make it possible in a reasonable time. Whether you are fine-tuning Llama on your own support tickets or pre-training a small model from scratch, the same few numbers decide what hardware you need, how long it takes and what it costs. This guide explains what GPU model training is, how it works, how to size memory and compute, when you need more than one GPU, which tools to use, and how to estimate the bill. Each section links to a deeper article in this series.

What is GPU model training?

GPU model training is the process of adjusting a neural network's parameters (its weights) so that its outputs match training data more closely, using graphics processing units to do the arithmetic. A GPU is used because training consists almost entirely of large matrix multiplications, which split into millions of independent operations that a GPU's thousands of cores and tensor cores run in parallel.

Every training step repeats three phases:

  1. Forward pass. A batch of examples flows through the network, producing predictions.
  2. Backward pass. The loss (how wrong the predictions were) is differentiated with respect to every weight, layer by layer, producing gradients.
  3. Optimiser step. An optimiser such as AdamW uses the gradients to nudge every weight in the direction that reduces the loss.

A language model repeats this millions of times. Pre-training a modern LLM runs over trillions of tokens; a fine-tune might run over a few million. The arithmetic is identical; the scale differs by a factor of a million or more. If GPU cloud computing itself is new to you, start with our explainer on what GPU cloud computing is.

Why do GPUs train models faster than CPUs?

GPUs win on two things training needs most: parallel arithmetic and memory bandwidth. A modern data-centre GPU has thousands of CUDA cores plus tensor cores designed for the low-precision matrix maths (BF16, FP8) that deep learning uses, delivering hundreds of teraFLOPS. NVIDIA publishes about 312 TFLOPS of dense BF16 for the A100 and about 756 for the H100 PCIe. A server CPU manages a small fraction of that.

Bandwidth matters as much. Training streams weights, activations and gradients through memory constantly. An H100 PCIe moves about 2.0 TB/s from its HBM, an H200 4.8 TB/s, a B200 8 TB/s. A dual-socket server's DDR5 manages a few hundred GB/s. Together these make GPUs one to two orders of magnitude faster for training, which turns a job of months into days. The GPU vs CPU guide explains the architecture.

What kinds of training are there?

Training covers three distinct activities that differ in data, scale and hardware by orders of magnitude.

TypeStarts fromDataTypical hardwareWho does it
Pre-trainingRandom weightsBillions to trillions of tokensHundreds to thousands of GPUs for large models; one machine for small onesModel labs; researchers with small models
Fine-tuning (full)A pretrained modelThousands to millions of examples4–8 GPUs for 8B–14B modelsProduct teams with specific needs
Fine-tuning (LoRA / QLoRA)A pretrained model, frozenThousands to millions of examplesOne GPU, even for 70BMost teams

Inference, running a trained model, is a separate stage with different hardware needs. Most teams never pre-train a general LLM; they fine-tune an open one and serve it. The differences are laid out in training vs fine-tuning vs inference.

How much GPU memory does training need?

Memory is usually the first constraint you hit, and it is predictable. Full training with the Adam optimiser in mixed precision stores, per parameter: BF16 weights (2 bytes), BF16 gradients (2), an FP32 master copy of the weights (4) and Adam's two FP32 moments (8). That is 16 bytes per parameter, and 16–20 once you count extra buffers. Activations, the intermediate values saved for the backward pass, come on top and scale with batch size × sequence length.

Parameter-efficient fine-tuning removes most of that. LoRA freezes the base model, so it needs only 2 bytes per parameter for the weights plus a small amount for the trained adapters. QLoRA stores the frozen base in 4-bit, about 0.5–0.6 bytes per parameter.

ModelFull training (16–20 B/param)LoRA (2 B/param + overhead)QLoRA (0.5–0.6 B/param + overhead)
1B16–20 GB≈ 5–8 GB≈ 3–5 GB
8B128–160 GB≈ 20–26 GB≈ 8–13 GB
14B224–280 GB≈ 33–40 GB≈ 12–17 GB
32B512–640 GB≈ 72–80 GB≈ 22–31 GB
70B1,120–1,400 GB≈ 150–165 GB≈ 45–60 GB

Rule-of-thumb estimates at about 2,048 tokens with gradient checkpointing. The full-training column excludes activations. The striking row is 70B: over a terabyte for full training, but about 45–60 GB with QLoRA, which fits one 80 GB A100 or H100. That single fact is why fine-tuning large open models became accessible. The full breakdown, including activations and how to cut memory, is in how much VRAM you need to fine-tune an LLM, and the methods themselves are explained in what LoRA and QLoRA are.

How much compute does training need, and how long will it take?

Training compute for a dense transformer is approximately 6 × parameters × training tokens floating-point operations: about 2 per parameter per token for the forward pass and 4 for the backward pass. Divide by what the GPU actually delivers, its published peak times a utilisation factor (often called MFU), to get time.

Time (seconds) ≈ 6 × N × T ÷ (peak FLOPS × utilisation).

We use NVIDIA's published dense BF16 peaks (RTX 4090 ≈ 165 TFLOPS, L40S ≈ 362, A100 312, H100 PCIe ≈ 756, B200 ≈ 2,250) and assume 35% utilisation for full and LoRA training, 25% for QLoRA, which pays a dequantisation overhead. Real jobs vary; treat these as planning estimates and budget 1.5–2× for data loading, evaluation and restarts.

JobN × TRTX 4090L40SA100 80GBH100 PCIeB200
8B QLoRA, 20M tokens8B × 20M6.5 h3.0 h3.4 h1.4 h0.5 h
8B LoRA, 20M tokens8B × 20M4.6 h*2.1 h2.4 h1.0 h0.3 h
70B QLoRA, 20M tokens70B × 20Mdoesn't fitdoesn't fit29.9 h12.4 h4.2 h
8B full fine-tune, 1B tokens8B × 1B––122 GPU-h50 GPU-h17 GPU-h
1B pre-train, 20B tokens1B × 20B577 h263 h305 h126 h42 h

\*Only at short sequence lengths on 24 GB. Rows in GPU-hours need several GPUs for memory; divide by GPU count and scaling efficiency for wall-clock time.

Showing one calculation in full, 8B QLoRA on an H100 PCIe: 6 × 8×10⁹ × 2×10⁷ = 9.6×10¹⁷ FLOPs. Effective throughput 756×10¹² × 0.25 = 1.89×10¹⁴ FLOP/s. Time = 9.6×10¹⁷ ÷ 1.89×10¹⁴ ≈ 5,080 seconds ≈ 1.4 hours.

Two lessons sit in this table. First, fine-tuning is cheap in compute terms: hours, not weeks. Second, the fastest card often costs least per run, because a 2–3× speed advantage can outweigh a higher hourly price.

Which GPU should you train on?

Pick the smallest card that fits your job's memory with headroom, then check whether a faster card would be cheaper per run. Here is how the GPUs we rent map to training work:

GPUVRAMBandwidthPrice per GPU-hourBest training use
RTX 409024 GB1,008 GB/s$1.59/hrQLoRA up to ≈14B, small experiments, image-model LoRAs
L40S48 GB864 GB/s$1.89/hr16-bit LoRA on 8–14B, QLoRA up to ≈32B
A100 80GB80 GB1,935 GB/s$3.79/hr70B QLoRA, 32B LoRA; no FP8
H100 (PCIe)80 GB2.0 TB/s$4.99/hr70B QLoRA fast; FSDP full fine-tunes across 4–8 cards
RTX PRO 600096 GB1.8 TB/s$4.89/hr70B QLoRA with long context; 32B LoRA
H200141 GB4.8 TB/s$9.09/hrLong-context fine-tunes; 16-bit LoRA up to ≈50B
B200180 GB8 TB/s$15.49/hr70B 16-bit LoRA on one card; fast full fine-tunes
B300288 GB8 TB/s$18.09/hrLargest single-card jobs; 70B full fine-tune across 8

Prices as of November 2026, per GPU per hour. A head-to-head on the two most common training cards is in H100 vs A100, and the general method for picking a card is in how to choose a GPU.

When do you need more than one GPU?

You need more GPUs when a job will not fit in one card's memory, or will not finish in time on one card. They solve these two problems in different ways.

  • Data parallelism (DDP) puts a full copy of the model on every GPU and splits each batch between them, averaging gradients after every step. It makes training faster, close to linearly inside one machine, but saves no memory.
  • Sharded data parallelism (FSDP, DeepSpeed ZeRO) splits weights, gradients and optimiser state across GPUs, so model-state memory per GPU falls to about 16 × parameters ÷ GPU count. It makes big models fit, at the cost of more communication.
  • Tensor and pipeline parallelism split the model's layers themselves across GPUs and machines. They are used for pre-training very large models, usually on multi-node clusters.

Worked example: a full fine-tune of an 8B model needs about 128 GB of model state. On 4 GPUs with FSDP full sharding that is 32 GB each plus activations, so 4 × 80 GB cards work comfortably. A 70B full fine-tune needs about 1,120 GB: 140 GB per GPU across 8, which fits 8 × B200 or B300 but not 8 × H100.

Inside one machine, a large-batch DDP job often reaches 85–95% scaling efficiency as a rule of thumb, so 8 GPUs give about 7× the speed. The details, with launch commands and configs, are in single vs multi-GPU training. The theory, including all-reduce and why networks matter across machines, is in what distributed training is. And the hands-on setup, from nvidia-smi topo -m to an NCCL bandwidth test, is in how to set up a multi-GPU ML environment.

What software do you use to train on GPUs?

The stack is layered, and most of it is open source.

LayerToolsRole
Driver and runtimeNVIDIA driver, CUDA, cuDNN, NCCLTalk to the GPU; GPU-to-GPU communication
FrameworkPyTorch (dominant), JAXTensors, autograd, optimisers, DDP and FSDP
Model libraryHugging Face TransformersPretrained architectures and weights
Fine-tuningTRL, PEFT, bitsandbytesSFTTrainer, LoRA, 4-bit loading
WrappersUnsloth, Axolotl, torchtune, LLaMA-FactoryFaster kernels, YAML configs, recipes
DistributionAccelerate, DeepSpeed, torchrunLaunching and sharding across GPUs
Large-scale pre-trainingMegatron-LM, NVIDIA NeMo, TorchTitan3D parallelism on clusters

A minimal QLoRA fine-tune with TRL shows how little code the common case needs (versions assumed: transformers 4.51+, TRL 0.20+, PEFT 0.15+, bitsandbytes 0.45+):

python
import torch
from datasets import load_dataset
from transformers import AutoModelForCausalLM, BitsAndBytesConfig
from peft import LoraConfig
from trl import SFTConfig, SFTTrainer

model = AutoModelForCausalLM.from_pretrained(
    "meta-llama/Llama-3.1-8B-Instruct",
    quantization_config=BitsAndBytesConfig(
        load_in_4bit=True, bnb_4bit_quant_type="nf4",
        bnb_4bit_compute_dtype=torch.bfloat16, bnb_4bit_use_double_quant=True),
    torch_dtype=torch.bfloat16, device_map={"": 0},
)
trainer = SFTTrainer(
    model=model,
    train_dataset=load_dataset("trl-lib/Capybara", split="train"),
    peft_config=LoraConfig(r=16, lora_alpha=32, target_modules="all-linear", task_type="CAUSAL_LM"),
    args=SFTConfig(output_dir="out", per_device_train_batch_size=4, gradient_accumulation_steps=4,
                   gradient_checkpointing=True, learning_rate=2e-4, bf16=True, max_length=2048),
)
trainer.train()

The same script runs on several GPUs with torchrun --standalone --nproc_per_node=4 train.py once device_map points at each process's local rank. The complete, step-by-step version, with data preparation, Unsloth and Axolotl alternatives, merging and serving, is our tutorial on how to fine-tune Llama on a cloud GPU.

What does a training workflow look like end to end?

A healthy training workflow spends most of its time off the GPU. In order:

  1. Define success. A held-out test set and 20–50 prompts you will judge by hand. Without them you cannot tell whether training helped.
  2. Prepare data. Clean, deduplicate, format into chat or instruction pairs. Count tokens; they set your run time and cost.
  3. Choose method and hardware. QLoRA, LoRA or full; one GPU or several. Use the memory and compute sums above.
  4. Pilot run. 50 steps to catch memory, tokenisation and path errors, and to measure real throughput.
  5. Full run. In tmux or as a job, checkpointing to storage off the machine.
  6. Evaluate. Compare against the base model and the previous version on your test set. Check eval loss for overfitting.
  7. Ship. Merge the adapter or serve it alongside the base with vLLM, under a versioned name.
  8. Stop the machine. Idle GPUs are the biggest avoidable cost in training.

How do you know training worked?

Training worked when the model does better on the task you care about, measured on data it never saw. A falling training loss is not proof: a model can memorise your examples and get worse at everything else. Check three things.

  • Held-out loss. Keep 5–10% of your data back and evaluate on it every few hundred steps. If training loss keeps falling while held-out loss rises, the model is overfitting. Stop, and use an earlier checkpoint.
  • Task metrics. Exact-match accuracy for extraction, pass rate for code, a rubric score from a stronger model or a human for open-ended answers. Compare against the untouched base model and against your best prompt-only baseline.
  • Regressions. Run a small set of general prompts (arithmetic, refusals, instruction following) before and after. Fine-tuning on narrow data can erode general abilities; LoRA tends to do less damage than full fine-tuning, but check.

The common failure signatures are easy to spot once you know them:

SymptomLikely causeFix
Loss is NaN or explodes earlyLearning rate too high; FP16 overflowLower the learning rate; use BF16; add warm-up
Loss barely movesLearning rate too low; labels masked wronglyRaise the learning rate; check the chat template and label masking
Great training loss, poor real answersOverfitting; too many epochs on small dataFewer epochs, more varied data, earlier checkpoint
Model ignores the new behaviourToo little data or too low LoRA rankMore examples; raise r to 32–64
GPU utilisation stuck at 30–50%Data loading or tiny batchesMore data-loader workers; sequence packing; bigger micro-batch

A short pilot run catches most of these in minutes rather than after a full day of paid GPU time.

How much does GPU training cost?

Cost = GPU-hours × price per GPU-hour, where GPU-hours = estimated compute hours ÷ scaling efficiency, plus time for setup, evaluation and mistakes. Using the compute estimates above and our per-GPU-hour prices:

ProjectHardwareEstimated GPU-hours (with 1.5× budget)Price per GPU-hourEstimated cost
Support-bot fine-tune, Llama 3.1 8B QLoRA, 20M tokens1 × L40S3.0 × 1.5 ≈ 4.5$1.89/hr$8.50
Same job, faster1 × H1001.4 × 1.5 ≈ 2.1$4.99/hr$10.48
Domain assistant, Llama 3.3 70B QLoRA, 20M tokens1 × H10012.4 × 1.5 ≈ 18.6$4.99/hr$92.81
Full fine-tune 8B, 1B tokens, FSDP8 × H100 (85% efficiency)50 ÷ 0.85 × 1.5 ≈ 88$4.99/hr$439.12
Pre-train a 1B model, 20B tokens8 × B200 (90% efficiency)42 ÷ 0.9 × 1.5 ≈ 70$15.49/hr$1,084

Estimates, not measurements; prices as of November 2026. For comparison with other providers, RunPod lists an H100 PCIe (Secure Cloud) at $2.89 per hour and Lambda an H100 PCIe at $3.79 (each provider's own page, 25 Nov 2026), so the 70B QLoRA job's 18.6 GPU-hours would be about $54 and $70 there respectively. Our own figure is the same 18.6 hours at our H100 PCIe price, 18.6 × $4.99/hr ≈ $92.81, so both are cheaper for this job; you would pick us for per-minute billing that stops when credit runs out and prices in your own currency. Per-job maths for many more scenarios is in the cost to fine-tune an LLM, and the wider pricing picture is in GPU rental cost.

Should you rent or own training GPUs?

Training is bursty: intense for hours or days, then idle while you collect data and evaluate. That pattern favours renting. An owned GPU costs the same whether it trains for 10 hours a month or 600. Renting by the minute charges only for the 10.

Owning starts to win when you can keep cards busy most hours for a long time, you have power, cooling and space, and you can absorb the risk that next year's cards make yours slower per pound. Most startups and research groups are not there for training. The break-even maths is worked through in renting vs buying GPUs.

How do you build training into production infrastructure?

Once you train more than once, treat training as a repeatable pipeline: data snapshots, pinned environments, configs in git, checkpoints in object storage, an evaluation gate before deployment, and named model versions. The serving side, capacity planning and cost control belong to the same design. Our blueprint for production GPU infrastructure for AI startups covers that, and the complete guide to choosing GPU infrastructure for machine learning brings training, inference, cost and providers into one decision framework.

Where should you rent GPUs for training?

The right provider depends on scale. For single-machine work (fine-tuning up to 70B with LoRA or QLoRA, full fine-tunes on up to eight GPUs, small-model pre-training) look for root access, the GPU sizes you need, per-minute or per-second billing, and stopping without losing your disk. RunPod, Lambda, Vast.ai, Hyperstack and others all serve this market with different trade-offs; Vast.ai's marketplace is often cheapest, with reliability that varies by host. For multi-node pre-training you need InfiniBand clusters, which CoreWeave, Lambda, Nebius and the hyperscalers sell. Our comparison of the best GPU clouds for fine-tuning goes provider by provider.

When renting from Wandering Giants fits

Wandering Giants Compute is built for the single-machine training work most teams do. Choose Root for the whole machine (SSH, Jupyter, Ubuntu, CUDA and PyTorch installed) with 1, 2, 4 or 8 of the same GPU, from a 24 GB RTX 4090 to a 288 GB B300. GPU time is billed by the minute from prepaid credit; if credit runs out, the machine stops by itself and its disk is kept free for 7 days, so a forgotten training box cannot run up an open-ended bill. A paused machine keeps your checkpoints for about 3¢ an hour per 50 GB. Prices show in your currency, with VAT included for UK customers.

When the fine-tune is done, you can serve it on the same service through the API option, an OpenAI-compatible vLLM endpoint on your own GPU. What we do not offer is multi-node clusters with InfiniBand, so pre-training large general-purpose models belongs with a cluster provider. For everything up to that line, see GPUs and prices.

Frequently asked questions

Why are GPUs used for training AI models?

Training is dominated by large matrix multiplications, which split into millions of independent multiply-adds. GPUs have thousands of cores and tensor cores built for exactly that, plus very high memory bandwidth, so they train neural networks orders of magnitude faster than CPUs.

How much GPU memory do I need to train a model?

For full training with Adam in mixed precision, about 16–20 bytes per parameter plus activations: roughly 128–160 GB for an 8B model. For fine-tuning with LoRA it is about 2 bytes per parameter plus a few GB, and with QLoRA about 0.5–0.6 bytes per parameter plus a few GB.

How long does it take to train a model on a GPU?

Estimate it as 6 × parameters × tokens FLOPs divided by the GPU's throughput times a utilisation factor of 25–40%. A QLoRA fine-tune of an 8B model on 20 million tokens is about 1.4 hours on one H100 PCIe by that estimate; pre-training an 8B model on 15 trillion tokens is hundreds of thousands of GPU-hours.

Can I train a model on a single GPU?

Yes, for most fine-tuning. LoRA and QLoRA fit models up to 70B on one 80 GB GPU, and small models can be fully trained or pre-trained on one card. Full fine-tuning of larger models and pre-training of general LLMs need several GPUs or a cluster.

What is the best GPU for model training?

The one that fits your job's memory at the lowest cost per run. An RTX 4090 or L40S suits small fine-tunes, an A100 80GB or H100 suits 70B QLoRA, and B200 or B300 class cards suit large full fine-tunes. Faster cards often cost less per run because they finish sooner.

Is it cheaper to rent or buy GPUs for training?

For occasional fine-tuning, renting is almost always cheaper, because training is bursty and an owned GPU sits idle between runs. Buying makes sense when you keep cards busy most hours for years. Run the break-even maths for your own utilisation.

What software do I need to train models on a GPU?

An NVIDIA driver and CUDA, PyTorch, and a training library: Hugging Face Transformers with TRL and PEFT for LLM fine-tuning, or tools such as Unsloth and Axolotl that wrap them. For multiple GPUs add Accelerate, FSDP or DeepSpeed.

Wandering Giants Compute

Rent the GPU for this, by the minute.

Rent the GPU your training job needs, from a 24 GB RTX 4090 to eight B300s in one machine, with root access and per-minute billing.

Prepaid credit, billed by the minute, stops itself when credit runs out. Prices in £, $, €, ¥, CA$, A$, CHF and S$; UK prices include VAT.

Keep reading

About this article. Written by the Wandering Giants Compute team, the people who run Wandering Giants Compute. Hardware figures are the manufacturers’ published specifications. Speeds and costs marked as estimates are worked out from those specifications and our current prices, with the method shown; they are not measured benchmarks. Wandering Giants prices are taken live from our price list each time this page is built.

Last reviewed 25 November 2026.