Checkpoint often vs rarely
lesson 1.7 · CheckpointingHow much work does a crash cost, and does a resume really continue where it left off?
Run A
donefineweb_edu · 6L·384d · 30M params · bf16
tokens read
24,576,000
step
3,000 / 3,000
- train loss
- 4.869
- best val
- 5.094
- tokens/s
- 33k
- MFU
- 5.5%
- peak mem
- 6.4 GB
- lr
- 1.0e-4
0:08:07 · 0.020 kWh ≈ <$0.01 power · ≈ $0.04 to rent
Run B
donefineweb_edu · 6L·384d · 30M params · bf16
tokens read
24,576,000
step
3,000 / 3,000
- train loss
- 4.869
- best val
- 5.094
- tokens/s
- 74k
- MFU
- 12.4%
- peak mem
- 6.4 GB
- lr
- 1.0e-4
0:08:17 · 0.018 kWh ≈ <$0.01 power · ≈ $0.04 to rent
The machine, live
NVIDIA L4 · gcp-l4-laboffline · just nowGPU busy
– %
VRAM
– / 22 GB
Power
– / 230 W
Temperature
– °C
SM clock
– MHz
Memory bus
– %
Fan
– %
CPU
– %
PCIe
to GPU –from GPU –
Batches of token ids cross the PCIe bus into the GPU each step; weights never leave it.
Disk
read –write –
Reads: token windows from the tokenized dataset (mostly from page cache). Writes: checkpoints, about 1.5 GB each for GPT-2 124M.
Network
in –out –
In: dataset downloads from Hugging Face. Out: metrics to Supabase and checkpoint uploads to Cloud Storage.
drawing now
–
last 5 minutes
–
from the card's energy counter
this experiment
0.037 kWh
≈ <$0.01 of electricity
RAM
–
of 31.3 GB in WSL
Sampled every 2 s on the box (NVML + psutil) and pushed here over Supabase Realtime. GPU energy is the whole card. Electricity at an assumed $0.15/kWh.
What's happening
What to watch · Press Crash test on both runs after step 1000. A loses at most 100 steps, B up to 1000. The dashed curve after each resume should sit on the original; the Resume check measures how closely.
Run A
Queued
done
Download data
done
Tokenize
done
Build and compile
done
Warm up
done
Train
done
Finished
done
Run B
Queued
done
Download data
done
Tokenize
done
Build and compile
done
Warm up
done
Train
done
Finished
done
The questions
| arithmetic | A 0.39 | B 0.39 |
| ice | A 0.57 | B 0.57 |
| ocean | A 0.66 | B 0.66 |
| orbit | A 0.59 | B 0.59 |
| paris | A 0.38 | B 0.38 |
| planet | A 0.33 | B 0.33 |
| sky | A 0.72 | B 0.72 |
| water | A 0.54 | B 0.54 |
| whale | A 0.16 | B 0.16 |
Prompts include "Q: Is water a liquid at room temperature? A:" (Yes vs No), "The capital of France is" (Paris vs London) and "The largest planet in our solar system is" (Jupiter vs Mars). Full list: trainer/src/galtrain/train.py.
Run A
Water is the most important part of the following: The area of the body is the main source of water, the body is the main form of water and is a few of the body. The body has the largest side of the body. The body is the first part of the body, and the body is the most frequent form of water. The body is the result of the body, the body is the main function of the body. The first phase is called the heart. The body uses the liver to develop a body of the muscles. It is called a muscles that are very soft and is the blood. The body becomes an abnormal body, with the blood. This cell has a blood vessels, body, and the heart muscles. There is a three types of blood, usually called a blood vessels, where the body is more intense and less slowly. The body is a hormone called the stomach and is the primary form of blood vessels, the body’s body. It
Run B
Water is the most important part of the following: The area of the body is the main source of water, the body is the main form of water and is a few of the body. The body has the largest side of the body. The body is the first part of the body, and the body is the most frequent form of water. The body is the result of the body, the body is the main function of the body. The first phase is called the heart. The body uses the liver to develop a body of the muscles. It is called a muscles that are very soft and is the blood. The body becomes an abnormal body, with the blood. This cell has a blood vessels, body, and the heart muscles. There is a three types of blood, usually called a blood vessels, where the body is more intense and less slowly. The body is a hormone called the stomach and is the primary form of blood vessels, the body’s body. It
Resume check
After a crash, the steps since the last checkpoint are lost and recomputed. If the checkpoint restored everything (weights, AdamW state, schedule, the RNG that picks batches), the recomputed losses match the originals.
- A · resume 1 steps 1310–1380 (8 points): max |Δloss| 0.0e+0, mean 0.0e+0Bit-identical: the resume reproduced the lost steps exactly.
- B · resume 1 steps 1010–1490 (49 points): max |Δloss| 0.0e+0, mean 0.0e+0Bit-identical: the resume reproduced the lost steps exactly.
What happened
- BFinished 3000 steps. Best val loss 5.094.
- BCheckpoint at step 3000: 360.9 MB (weights, AdamW state, schedule position, RNG states) in 1.54s.
- BStep 3000: val 5.094, train 5.086 (gap +0.008).
- AFinished 3000 steps. Best val loss 5.094.
- ACheckpoint at step 3000: 360.9 MB (weights, AdamW state, schedule position, RNG states) in 1.53s.
- AStep 3000: val 5.094, train 5.086 (gap +0.008).
- ACheckpoint at step 2900: 360.9 MB (weights, AdamW state, schedule position, RNG states) in 1.53s.
- BStep 2800: val 5.094, train 5.082 (gap +0.012).
- ACheckpoint at step 2800: 360.9 MB (weights, AdamW state, schedule position, RNG states) in 1.54s.
- AStep 2800: val 5.094, train 5.082 (gap +0.012).
- BStep 2600: val 5.114, train 5.116 (gap -0.002).
- ACheckpoint at step 2700: 360.9 MB (weights, AdamW state, schedule position, RNG states) in 1.53s.
- ACheckpoint at step 2600: 360.9 MB (weights, AdamW state, schedule position, RNG states) in 1.54s.
- AStep 2600: val 5.114, train 5.116 (gap -0.002).
- BStep 2400: val 5.163, train 5.143 (gap +0.020).
- ACheckpoint at step 2500: 360.9 MB (weights, AdamW state, schedule position, RNG states) in 1.53s.
- ACheckpoint at step 2400: 360.9 MB (weights, AdamW state, schedule position, RNG states) in 1.53s.
- AStep 2400: val 5.163, train 5.143 (gap +0.020).
- BStep 2200: val 5.192, train 5.167 (gap +0.025).
- ACheckpoint at step 2300: 360.9 MB (weights, AdamW state, schedule position, RNG states) in 1.53s.
- ACheckpoint at step 2200: 360.9 MB (weights, AdamW state, schedule position, RNG states) in 1.71s.
- BCheckpoint step 2000 copied off the machine to gs://train-galvyn-xyz-checkpoints/runs/daba75b6-dca7-488f-b099-f04cf024b841/step-0002000.pt in 1.3s (in the background; training didn't wait).
- AStep 2200: val 5.192, train 5.167 (gap +0.025).
- BCheckpoint at step 2000: 360.9 MB (weights, AdamW state, schedule position, RNG states) in 1.54s.
- BStep 2000: val 5.234, train 5.252 (gap -0.018).
- ACheckpoint at step 2100: 360.9 MB (weights, AdamW state, schedule position, RNG states) in 1.54s.
- ACheckpoint at step 2000: 360.9 MB (weights, AdamW state, schedule position, RNG states) in 1.54s.
- BStep 1800: val 5.328, train 5.269 (gap +0.059).
- AStep 2000: val 5.234, train 5.252 (gap -0.018).
- ACheckpoint at step 1900: 360.9 MB (weights, AdamW state, schedule position, RNG states) in 1.54s.
- BStep 1600: val 5.429, train 5.361 (gap +0.068).
- ACheckpoint at step 1800: 360.9 MB (weights, AdamW state, schedule position, RNG states) in 1.53s.
- AStep 1800: val 5.328, train 5.269 (gap +0.059).
- ACheckpoint at step 1700: 360.9 MB (weights, AdamW state, schedule position, RNG states) in 1.53s.
- BStep 1400: val 5.475, train 5.424 (gap +0.051).
- ACheckpoint at step 1600: 360.9 MB (weights, AdamW state, schedule position, RNG states) in 1.53s.
- AStep 1600: val 5.429, train 5.361 (gap +0.068).
- ACheckpoint at step 1500: 360.9 MB (weights, AdamW state, schedule position, RNG states) in 1.52s.
- BStep 1200: val 5.612, train 5.570 (gap +0.042).
- ACheckpoint step 1400 copied off the machine to gs://train-galvyn-xyz-checkpoints/runs/61898328-5722-4fc9-8849-750c0da90d85/step-0001400.pt in 1.4s (in the background; training didn't wait).
- ACheckpoint at step 1400: 360.9 MB (weights, AdamW state, schedule position, RNG states) in 1.53s.
- AStep 1400: val 5.475, train 5.424 (gap +0.051).
- BResumed at step 1000 from a checkpoint.
- AResumed at step 1300 from a checkpoint.
- BCrash test: killed the process with SIGKILL (no chance to save). Resuming from the checkpoint at step 1000.
- ACrash test: killed the process with SIGKILL (no chance to save). Resuming from the checkpoint at step 1300.
- ACheckpoint at step 1300: 360.9 MB (weights, AdamW state, schedule position, RNG states) in 1.60s.
- BStep 1400: val 5.475, train 5.424 (gap +0.051).
- ACheckpoint at step 1200: 360.9 MB (weights, AdamW state, schedule position, RNG states) in 1.53s.
- AStep 1200: val 5.612, train 5.570 (gap +0.042).
- BStep 1200: val 5.612, train 5.570 (gap +0.042).
- ACheckpoint at step 1100: 360.9 MB (weights, AdamW state, schedule position, RNG states) in 1.57s.
- ACheckpoint at step 1000: 360.9 MB (weights, AdamW state, schedule position, RNG states) in 1.94s.
- AStep 1000: val 5.685, train 5.638 (gap +0.047).
- BCheckpoint at step 1000: 360.9 MB (weights, AdamW state, schedule position, RNG states) in 1.61s.
- BStep 1000: val 5.685, train 5.638 (gap +0.047).
- ACheckpoint at step 900: 360.9 MB (weights, AdamW state, schedule position, RNG states) in 1.57s.
- ACheckpoint at step 800: 360.9 MB (weights, AdamW state, schedule position, RNG states) in 1.54s.
- AStep 800: val 5.786, train 5.790 (gap -0.004).
- BStep 800: val 5.786, train 5.790 (gap -0.004).
- ACheckpoint at step 700: 360.9 MB (weights, AdamW state, schedule position, RNG states) in 1.62s.
- ACheckpoint at step 600: 360.9 MB (weights, AdamW state, schedule position, RNG states) in 1.54s.
- AStep 600: val 5.981, train 5.996 (gap -0.015).
- BStep 600: val 5.981, train 5.996 (gap -0.015).
- ACheckpoint at step 500: 360.9 MB (weights, AdamW state, schedule position, RNG states) in 1.54s.
- ACheckpoint at step 400: 360.9 MB (weights, AdamW state, schedule position, RNG states) in 1.54s.
- AStep 400: val 6.270, train 6.198 (gap +0.072).
- BStep 400: val 6.270, train 6.198 (gap +0.072).
- ACheckpoint at step 300: 360.9 MB (weights, AdamW state, schedule position, RNG states) in 1.57s.
- ACheckpoint at step 250: 360.9 MB (weights, AdamW state, schedule position, RNG states) in 1.76s.
- BCheckpoint at step 250: 360.9 MB (weights, AdamW state, schedule position, RNG states) in 1.56s.
- ACheckpoint at step 200: 360.9 MB (weights, AdamW state, schedule position, RNG states) in 1.59s.
- BStep 200: val 6.571, train 6.549 (gap +0.022).
- AStep 200: val 6.571, train 6.549 (gap +0.022).
- BCheckpoint at step 100: 360.9 MB (weights, AdamW state, schedule position, RNG states) in 2.43s.
- ACheckpoint at step 100: 360.9 MB (weights, AdamW state, schedule position, RNG states) in 2.57s.
- ACheckpoint at step 50: 360.9 MB (weights, AdamW state, schedule position, RNG states) in 2.58s.
- BCheckpoint at step 50: 360.9 MB (weights, AdamW state, schedule position, RNG states) in 2.47s.
- BCheckpoint step 0 copied off the machine to gs://train-galvyn-xyz-checkpoints/runs/daba75b6-dca7-488f-b099-f04cf024b841/step-0000000.pt in 0.8s (in the background; training didn't wait).
- ACheckpoint step 0 copied off the machine to gs://train-galvyn-xyz-checkpoints/runs/61898328-5722-4fc9-8849-750c0da90d85/step-0000000.pt in 0.8s (in the background; training didn't wait).
- BCheckpoint at step 0: 120.3 MB (weights, AdamW state, schedule position, RNG states) in 0.83s.
- ACheckpoint at step 0: 120.3 MB (weights, AdamW state, schedule position, RNG states) in 0.83s.
- BExpected loss before training ≈ ln(vocab) = 10.83.
- AExpected loss before training ≈ ln(vocab) = 10.83.
- BTraining 30.06M params on fineweb_edu for 3000 steps (bf16, batch 32×1, ctx 256).
- ATraining 30.06M params on fineweb_edu for 3000 steps (bf16, batch 32×1, ctx 256).