Cost to train · prices checked 2026-11-19

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

Fine-tuning Llama 3.1 405B with LoRA on 100 million tokens takes about 111 GPU-hours on an MI300X: $287 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
5 x MI300XBF1611122.2 hours$287DigitalOcean 
12 x H100 SXMBF1614712.2 hours$292Voltage Parkfrom $116
40 x RTX 4090BF1687821.9 hours$298RunPod 
20 x L40SBF1640020.0 hours$316RunPodfrom $296
20 x RTX A6000BF1693646.8 hours$328Thunder Compute$428
6 x B200BF166410.7 hours$350Massed Computefrom $63.78

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

Full fine-tune, by GPU

MachineGPU-hoursTime on itOn-demandInterruptible
38 x MI300XBF161,60242.1 hours$4,148DigitalOcean 
91 x H100 SXMBF162,11623.3 hours$4,212Voltage Parkfrom $1,672
301 x RTX 4090BF1612,67542.1 hours$4,310RunPod 
151 x L40SBF165,78438.3 hours$4,569RunPodfrom $4,280
151 x RTX A6000BF1613,5273.7 days$4,734Thunder Compute$6,188
41 x B200BF1693122.7 hours$5,053Massed Computefrom $921

Pretraining on 8.1 trillion tokens, 20 per parameter · 8K context · 35% MFU

Pretraining, by GPU

MachineGPU-hoursTime on itOn-demandInterruptible
38 x MI300XBF1613,001,70514,256.3 days$33,674,417DigitalOcean 
91 x H100 SXMBF1617,180,5437,866.5 days$34,189,281Voltage Parkfrom $13,572,629
301 x RTX 4090BF16102,896,06414,243.6 days$34,984,662RunPod 
151 x L40SBF1646,950,50312,955.4 days$37,090,898RunPodfrom $34,743,372
151 x RTX A6000BF16109,808,97730,300.5 days$38,433,142Thunder Compute$50,237,607
41 x B200BF167,554,8587,677.7 days$41,022,877Massed Computefrom $7,479,309

Llama 3.1 405B: 405.9 billion parameters, 126 layers, 128 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 405B, answered

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

Fine-tuning Llama 3.1 405B with LoRA on 100 million tokens takes about 111 GPU-hours on an MI300X: $287 at today's cheapest on-demand price (DigitalOcean), at 35% MFU. Training every weight of Llama 3.1 405B on 1 billion tokens takes about 1,602 GPU-hours on an MI300X: $4,148 at today's cheapest on-demand price (DigitalOcean), at 35% MFU.

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

On the compute-optimal 8.1 trillion tokens (about 20 tokens per parameter, as Chinchilla found), about 13,001,705 GPU-hours on an MI300X: $33,674,417 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.