I thought GPT-2 was small. Then I measured a training step: 17,054 MiB for 124M parameters.
I went into this thinking: GPT-2 is only 124M parameters. How much memory could training it possibly need? Turns out, quite a lot lol. I traced the second training step of my from-scratch GPT-2 in PyTorch. Setup: one A40, fp32 AdamW, batch 8, 1,024 tokens per sequence. Peak allocated memory: 17,054…
Read the full story at r/learnmachinelearning ↗
Timeline · 2 reports
- 2026-10-28 04:49 · r/deeplearning
124M parameters, 17,054 MiB to train: I traced where GPT-2 training memory actually goes - 2026-10-28 04:47 · r/learnmachinelearning
I thought GPT-2 was small. Then I measured a training step: 17,054 MiB for 124M parameters.