train.galvyn.xyz · lab
read-onlySign in

Phase 2: teach GPT-2 124M to answer questions (supervised fine-tuning)

lesson 2.1 · Teach it to answer

Pretraining taught it facts but not to answer and stop. What changes after ~140k question → answer examples?

Run A

done

fineweb_edu_10b · 12L·768d · 124M params ·

tokens read

37,678,816

step

4,320 / 4,300

train loss
1.920
best val
1.975
tokens/s
30k
MFU
–
peak mem
–
lr
3.0e-6

0:22:35 · ≈ $0.11 to rent

Losslower is better · loss on answer tokens only · starts from the pretrained model
22.501000200030004000stepA checkpoint @ 0A checkpoint @ 1000A checkpoint @ 2000A checkpoint @ 3000A checkpoint @ 4000A checkpoint @ 4320

The machine, live

NVIDIA L4 · gcp-l4-sftoffline · just now

GPU 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

–

starts with training

RAM

–

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

  1. Queued

    done

  2. Download data

    already on disk

  3. Tokenize

    already on disk

  4. Build and compile

    done

  5. Warm up

    skipped

  6. Train

    done

  7. Finished

    done

solid = train (smoothed) · dots = validation · dashed = after a crash-test resume
Learning ratewarmup, then cosine
0e+01e-52e-53e-51000200030004000step
Gradient normbefore clipping to 1.0 · log scale
5101000200030004000step
Throughputtokens per second
10k20k30k1000200030004000step
MFUshare of this precision's peak (bf16 111, fp32 27.8 TFLOPS)
Waiting for data…
GPU memory (measured)peak per log window · dashed = activations + workspace
Waiting for data…
Samplessame prompt and random draw every time, so only the model changes

Run A

 The capital of France is Paris.

What happened

  1. ARe-graded after the run: 11/20, not 12/20. "Boiling point of water in Celsius" was answered "approximately 32.8°C (100.6°F)" and the grader accepted it because the text contains "100". The grader now matches whole words and numbers.
  2. ASFT finished: 7/20 → 12/20 questions correct. Best val loss on answers 1.975.
  3. AStep 4320: 12/20 correct; val loss on answers 1.975.
  4. AStep 4000: 13/20 correct; val loss on answers 1.977.
  5. AStep 3500: 10/20 correct; val loss on answers 1.981.
  6. AStep 3000: 14/20 correct; val loss on answers 1.987.
  7. AStep 2500: 14/20 correct; val loss on answers 1.998.
  8. AStep 2000: 12/20 correct; val loss on answers 2.007.
  9. AStep 1500: 14/20 correct; val loss on answers 2.017.
  10. AStep 1000: 11/20 correct; val loss on answers 2.038.
  11. AStep 500: 10/20 correct; val loss on answers 2.066.
  12. ACheckpoint step 0 copied off the machine to gs://train-galvyn-xyz-checkpoints/runs/18b4f4d5-949c-4699-9246-8667a73dd218/step-0000000.pt in 1.7s (in the background; training didn't wait).
  13. ABefore fine-tuning: 7/20 questions answered correctly (greedy). Val loss on answers 2.453.
  14. ASFT of the base model (step 19,073, 10.0B tokens) on 138,268 Q&A examples for 4,320 steps.
  15. ASFT crashed: OutOfMemoryError: CUDA out of memory. Tried to allocate 2.96 GiB. GPU 0 has a total capacity of 22.03 GiB of which 1.46 GiB is free. Including non-PyTorch memory, this process has 20.56 GiB memory in use. Of the allocated memory 14.47 GiB is allocated by PyTorch, and 5.85 GiB is reserved by PyTorch but unallocated. If reserved but unallocated memory is large try setting PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True to avoid fragmentation. See documentation for Memory Management
  16. ASFT crashed: OutOfMemoryError: CUDA out of memory. Tried to allocate 608.00 MiB. GPU 0 has a total capacity of 22.03 GiB of which 52.00 MiB is free. Process 1805 has 20.61 GiB memory in use. Including non-PyTorch memory, this process has 1.36 GiB memory in use. Of the allocated memory 1.01 GiB is allocated by PyTorch, and 124.38 MiB is reserved by PyTorch but unallocated. If reserved but unallocated memory is large try setting PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True to avoid fragmentati
  17. ACheckpoint step 0 copied off the machine to gs://train-galvyn-xyz-checkpoints/runs/18b4f4d5-949c-4699-9246-8667a73dd218/step-0000000.pt in 1.7s (in the background; training didn't wait).
  18. ABefore fine-tuning: 7/20 questions answered correctly (greedy). Val loss on answers 2.453.
  19. ASFT of the base model (step 19,073, 10.0B tokens) on 138,268 Q&A examples for 4,320 steps.