Cost to train · prices checked 2026-11-19

How much does it cost to train Llama 3.1 8B?

Fine-tuning Llama 3.1 8B with LoRA on 100 million tokens takes about 2.7 GPU-hours on an MI300X: $7.08 at today's cheapest on-demand price (DigitalOcean), at 35% MFU.

LoRA fine-tune on 100 million tokens · 8K context · 35% MFU

LoRA fine-tune, by GPU

MachineGPU-hoursTime on itOn-demandInterruptible
1 x MI300XBF162.72.7 hours$7.08DigitalOcean 
1 x H100 SXMBF163.63.6 hours$7.18Voltage Parkfrom $2.85
1 x RTX 4090BF162221.6 hours$7.35RunPod 
1 x L40SBF169.99.9 hours$7.79RunPodfrom $7.30
1 x RTX A6000BF162323.1 hours$8.08Thunder Compute$10.56
1 x B200BF161.61.6 hours$8.62Massed Computefrom $1.57

Full fine-tune on 1 billion tokens · 8K context · 35% MFU

Full fine-tune, by GPU

MachineGPU-hoursTime on itOn-demandInterruptible
1 x MI300XBF163737.1 hours$96.01DigitalOcean 
2 x H100 SXMBF164924.5 hours$97.48Voltage Parkfrom $38.70
6 x RTX 4090BF162932.0 days$99.74RunPod 
3 x L40SBF1613444.6 hours$106RunPodfrom $99.06
3 x RTX A6000BF163134.3 days$110Thunder Compute$143
1 x B200BF162221.5 hours$117Massed Computefrom $21.32

Pretraining on 161 billion tokens, 20 per parameter · 8K context · 35% MFU

Pretraining, by GPU

MachineGPU-hoursTime on itOn-demandInterruptible
1 x MI300XBF165,953248.1 days$15,419DigitalOcean 
2 x H100 SXMBF167,867163.9 days$15,655Voltage Parkfrom $6,215
6 x RTX 4090BF1647,115327.2 days$16,019RunPod 
3 x L40SBF1621,498298.6 days$16,983RunPodfrom $15,909
3 x RTX A6000BF1650,280698.3 days$17,598Thunder Compute$23,003
1 x B200BF163,459144.1 days$18,784Massed Computefrom $3,425

Llama 3.1 8B: 8.03 billion parameters, 32 layers, 32 attention heads of size 128, from its published configuration. Peak throughput from each GPU's vendor (gpu-specs.json). Try other settings on the calculator.

Questions

Llama 3.1 8B, answered

How much does it cost to fine-tune Llama 3.1 8B?

Fine-tuning Llama 3.1 8B with LoRA on 100 million tokens takes about 2.7 GPU-hours on an MI300X: $7.08 at today's cheapest on-demand price (DigitalOcean), at 35% MFU. Training every weight of Llama 3.1 8B on 1 billion tokens takes about 37 GPU-hours on an MI300X: $96.01 at today's cheapest on-demand price (DigitalOcean), at 35% MFU.

How much would it cost to pretrain Llama 3.1 8B from scratch?

On the compute-optimal 161 billion tokens (about 20 tokens per parameter, as Chinchilla found), about 5,953 GPU-hours on an MI300X: $15,419 at today's cheapest on-demand price, before any failed runs or experiments.

How is this worked out?

Training FLOPs: for each token, 6 x the parameters a token uses for a full update (2 forward, 4 backward), or 4 x for LoRA, whose frozen weights need no weight gradients; plus attention's 12 x layers x heads x head size x context (PaLM, Appendix B). GPU-hours: those FLOPs over the GPU's peak dense throughput, from its vendor, times the share of it training reaches (model FLOPs utilisation, MFU; 35% unless you change it). Cost: GPU-hours times each GPU's cheapest price per GPU-hour in the index. Machines: enough GPUs to hold the model for that kind of training (see Will it fit?); the time on them assumes the work splits evenly. Every GPU gets the same MFU, a simplification: real utilisation differs by GPU, software and job, so treat rows within about 20% of each other as a tie.