File size: 20,095 Bytes
e505b3e 7d0fb92 a741d49 e505b3e a741d49 e505b3e a741d49 e505b3e 6133e9b 8980f4d f56a80d 6133e9b f56a80d 7d0fb92 f56a80d 6133e9b e505b3e a741d49 e505b3e a741d49 e505b3e a741d49 e505b3e a741d49 e505b3e a741d49 e505b3e a741d49 77626fc a741d49 77626fc 7d0fb92 a741d49 77626fc 7d0fb92 a741d49 e505b3e a741d49 77626fc 7d0fb92 a741d49 e505b3e a741d49 e505b3e a741d49 e505b3e a741d49 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 | ---
license: mit
tags:
- training-logs
- scaling-laws
- hyperparameter-transfer
- tpu
- jax
pretty_name: rig training logs
---
# rig training logs
Complete training logs for every GPT pretraining run in
[honglu2875/rig](https://github.com/honglu2875/rig) — 237 runs across eight
studies, at full recorded resolution. Loss and learning-rate curves at every
optimizer step; per-layer parameter, gradient, and update statistics at every
diagnostic step. Nothing here is downsampled.
The dashboards in the GitHub repository are thinned summaries of these files.
What follows is that repository's audit of them, unchanged, so the two cannot
drift apart.
## Layout
```
<study>/
<run-name>/
training.riglog loss, learning rate, gradient norm, per step
diagnostics.riglog per-scope statistics, per diagnostic step
result.json configuration, final metrics, provenance
validation.csv held-out loss
records.jsonl one ledger line per run
snapshot.json.gz loss curves only, for the study browser
```
Run names state what varies: `500m-20tpp-bs128-lr2e-8-s1337` is the 500M tier
at 20 tokens per parameter, batch 128, base learning rate 2^-8, seed 1337.
## A seed does not identify a run on its own
The training stream *is* invariant under the process count. The global batch
sequence is fixed by the seed alone, and each rank takes a slice of it:
`_prepare_epoch` mixes only the seed and the epoch, and `next_batch` advances a
global cursor by the whole global batch. Verified directly — 1, 4, and 8
processes produce byte-identical global batches.
Results still differ across topologies. The same configuration and seed on
8 chips versus 16 lands 0.004 to 0.023 nats apart, which is the same size as
the seed effect itself. The data is identical and so is the attention tile
plan; both were checked. What differs is floating point: gradients are reduced
across a different number of devices, so the sum is accumulated in a different
order, and each chip holds a different number of sequences, which changes the
shapes XLA compiles for. Neither is addressable by seeding, and both are the
same non-associativity that makes any reduction order-dependent.
So `--seed N` plus the configuration does not pin a number; the topology is
part of it. Every run records `chip`, `data_processes` and `devices` in its
study's `records.jsonl`, alongside the full `system` block in `result.json`,
and the dashboards show them beside each run.
| study | hardware |
|---|---|
| `batch-sweep-60M` | TPU v4 — 4 processes, 16 chips |
| `lr-batch-sweep-125M` | TPU v4 — 4 processes, 16 chips |
| `batch-sweep-250M` | TPU v4 — 4 processes, 16 chips |
| `batch-sweep-500M` | **mixed**: 6 runs TPU v4 (4 proc, 16 chips), 6 runs TPU v6 lite (1 proc, 8 chips) |
| `lr-transfer-250M` | TPU v4 — 4 processes, 16 chips |
| `lr-sweep-8k-60M` | TPU v4 — 4 processes, 16 chips |
| `moe-lr-sweep-8k` | TPU v4 — 4 processes, 16 chips |
| `batch-size-grid-8k` | TPU v4 — 4 processes, 16 chips |
`batch-sweep-500M` is the only study spanning two chip types, and the split
follows its 5- against 20-tokens-per-parameter arms. Those are separate
experiments whose losses were never comparable, so the topology change does not
cross a comparison that was being made.
## The format
`.riglog` is a packed binary log: an 8-byte magic, a fixed header, a column
table addressing each series by permanent integer ids, then fixed-width
records. About 21x smaller than the long-form CSV it replaced, and it reads
with one memory copy.
```python
from huggingface_hub import hf_hub_download
from rig import logpack
path = hf_hub_download("quintic/rig-logs",
"batch-sweep-60M/60m-5tpp-bs128-lr2e-8-s1337/training.riglog",
repo_type="dataset")
log = logpack.read_log(path)
log.series("train_loss") # every optimizer step
log.series("grad.l2_norm", "block", 7) # per-layer, from diagnostics
```
`logpack.layout_descriptor()` returns every offset and element type, derived
from the definitions the writer uses, so a reader in another language can be
built without reading the Python.
---
Every dashboard here, the runs behind it, and the command that reproduces it.
Commands are **demonstrative**: they use the current CLI and reproduce the
*design*, not the exact invocation from the time. Seeds, tiers, and grids are
exact.
## The logs live on HuggingFace
**[huggingface.co/datasets/quintic/rig-logs](https://huggingface.co/datasets/quintic/rig-logs)**
— 177 runs across six studies, laid out as `<study>/<run-name>/`, at full
recorded resolution. That is the archive of record; its
[dataset card](https://huggingface.co/datasets/quintic/rig-logs/blob/main/README.md)
is a copy of this file.
The dashboards committed here are **summaries** of those logs, thinned so they
stay portable. Nothing in them is a substitute for the logs: they are one
rendering at one fidelity, and a thinned curve is indistinguishable on screen
from a complete one. When a number matters, read it from the `.riglog`.
```python
from huggingface_hub import hf_hub_download
from rig import logpack
path = hf_hub_download(
"quintic/rig-logs",
"batch-sweep-60M/60m-5tpp-bs128-lr2e-8-s1337/training.riglog",
repo_type="dataset",
)
log = logpack.read_log(path)
log.series("train_loss") # every optimizer step
```
## What "summary" means here
Every series is thinned to at most **1,440 points**. Per-layer diagnostic
charts additionally keep a bounded number of step frames — 8 for most studies,
and more for the two where the per-layer behaviour is the subject rather than a
by-product:
| report | curve points | layer frames | size |
|---|--:|--:|--:|
| batch-size-sweep-60M | 1,440 | 400 | 44.3 MB |
| batch-size-sweep-500M | 1,440 | 1,440 | 44.3 MB |
| batch-size-sweep-250M | 1,440 | 8 | 15.4 MB |
| lr-batch-sweep-125M | 1,440 | 8 | 8.2 MB |
| 3-seed-gradient-spike | 1,440 | 8 | 6.6 MB |
| 8k-lr-sweep-60M | 1,440 | 8 | 2.4 MB |
| moe-lr-sweep-8k | 1,440 | 8 | 7.2 MB |
The two large ones carry layer detail because gradient spikes are visible in
it, and studying them is the point. This is deliberate discretion, not a
default: keep it to a couple of files so the repository stays clonable.
Charts resample against the visible span as you zoom, keeping each pixel
bucket's minimum and maximum rather than one representative point — so a spike
inside the embedded data stays visible at every zoom level. It cannot recover a
sample that thinning already dropped.
Charts are per-metric, and a metric no selected run recorded is not drawn at
all — the panel is hidden rather than left as an empty frame. Routed runs
record routing series a dense run never will, so most reports carry charts that
do not apply to part of the selection, and a grid of empty frames would bury
the ones that do.
Which metrics get charted is a declared list in `rig/report.py`, separate from
the metric registry, because how a quantity should be drawn is a judgement the
registry cannot make. Everything so far is a line against the time axis; a
distribution rather than a scalar — a routing histogram, say — wants bars
against expert index and would arrive as a new chart kind rather than being
bent into a timeline.
## The study browser
[`study-browser.html`](study-browser.html) carries no data at all — 53 KB. It
lists the studies, renders each one's card from the dataset, and fetches only
that study's overview (0.05–0.30 MB) when you pick one. The full logs are a
second, separately labelled click that states the size before it starts:
6.4 MB for the 8k sweep, 138 MB for the 500M one. Nothing downloads on load.
Everything it fetches is an ordinary report payload, so the page never needs to
understand the packed log format — the two only have to agree about JSON.
## Hardware is part of a result
The same configuration and seed lands 0.004–0.023 nats apart on a 16-chip
v4 slice versus an 8-chip v6e — the same size as the seed effect. The data is
identical (the stream is invariant under process count, verified) and so is the
attention tile plan; what differs is that gradients reduce across a different
number of devices and each chip holds a different share of the batch.
Every dashboard therefore shows chip kind, chip count, and process count beside
each run, and the run filter matches on chip. Every study is TPU v4, 4
processes, 16 chips, except `batch-size-sweep-500M`, which mixes that with 6
runs on TPU v6 lite at 1 process and 8 chips — its 20-TPP arm.
## Contents
| report | runs | tier(s) | what varies | logs |
|---|--:|---|---|---|
| [batch-size-sweep-60M](batch-size-sweep-60M.html) | 75 | 60M | batch × LR × seed | [`batch-sweep-60M`](https://huggingface.co/datasets/quintic/rig-logs/tree/main/batch-sweep-60M) |
| [lr-batch-sweep-125M](lr-batch-sweep-125M.html) | 27 | 125M | batch × LR × seed | [`lr-batch-sweep-125M`](https://huggingface.co/datasets/quintic/rig-logs/tree/main/lr-batch-sweep-125M) |
| [batch-size-sweep-250M](batch-size-sweep-250M.html) | 36 | 250M | batch × LR × seed | [`batch-sweep-250M`](https://huggingface.co/datasets/quintic/rig-logs/tree/main/batch-sweep-250M) |
| [batch-size-sweep-500M](batch-size-sweep-500M.html) | 12 | 500M | batch × LR × seed, 5 and 20 TPP | [`batch-sweep-500M`](https://huggingface.co/datasets/quintic/rig-logs/tree/main/batch-sweep-500M) |
| [3-seed-gradient-spike](3-seed-gradient-spike.html) | 12 | 250M | LR × seed | [`lr-transfer-250M`](https://huggingface.co/datasets/quintic/rig-logs/tree/main/lr-transfer-250M) |
| [8k-lr-sweep-60M](8k-lr-sweep-60M.html) | 15 | 60M | LR × seed at 8k context | [`lr-sweep-8k-60M`](https://huggingface.co/datasets/quintic/rig-logs/tree/main/lr-sweep-8k-60M) |
| [moe-lr-sweep-8k](moe-lr-sweep-8k.html) | 18 | 60M/125M | LR × seed, top-2 of 8 experts | [`moe-lr-sweep-8k`](https://huggingface.co/datasets/quintic/rig-logs/tree/main/moe-lr-sweep-8k) |
| [batch-size-grid-8k](batch-size-grid-8k.html) | 42 | 60M/125M | batch × LR × seed at 8k, dense and routed | [`batch-size-grid-8k`](https://huggingface.co/datasets/quintic/rig-logs/tree/main/batch-size-grid-8k) |
| [transfer-charts](transfer-charts.html) | — | — | derived figures, not a run dashboard | — |
Each study also carries a `snapshot.json.gz` (loss curves only, 0.05–0.30 MB)
and, for the two above, a `snapshot-diagnostics.json.gz` (1.0–3.5 MB). These
are what the study browser loads before you ask it for anything larger.
---
## batch-size-sweep-60M.html
75 runs: **5 batches × 5 learning rates × 3 seeds** at 60M, 5 tokens per
parameter, 1,024 context. The widest grid here, and what study 2 leans on.
```bash
for bs in 32 64 128 256 512; do
for lr in 0.015625 0.0078125 0.00390625 0.001953125 0.0009765625; do
for seed in 1337 1338 1339; do
rig run reference --cluster v4-32 --profile dev --track open \
--tier 60m --tokens-per-parameter 5 \
--study-batch-size "$bs" --base-learning-rate "$lr" --seed "$seed" \
--name "60m-bs${bs}-lr${lr}-s${seed}"
done
done
done
rig report --runs <batch-sweep-60M> --max-points 1440 --layer-snapshots 400 \
--output docs/reports/batch-size-sweep-60M.html
```
## lr-batch-sweep-125M.html
27 runs: **3 batches (64/128/256) × 3 learning rates (2^-7/2^-8/2^-9) × 3
seeds** at 125M, 5 TPP, 1,024 context.
The grid is a batch × LR product, so either axis can be read as the subject.
This replaces the former `batch-size-sweep-125M.html` and `lr-sweep-125M.html`,
which were two renderings of these same 27 runs.
```bash
for bs in 64 128 256; do
for lr in 0.0078125 0.00390625 0.001953125; do
for seed in 1337 1338 1339; do
rig run reference --cluster v4-32 --profile dev --track open \
--tier 125m --tokens-per-parameter 5 \
--study-batch-size "$bs" --base-learning-rate "$lr" --seed "$seed" \
--name "125m-bs${bs}-lr${lr}-s${seed}"
done
done
done
```
## batch-size-sweep-250M.html
36 runs: **4 batches (64/128/256/512) × 3 learning rates × 3 seeds** at 250M,
5 TPP, 1,024 context.
Three runs — `250m-5tpp-bs512-lr2e-7`, all three seeds — recorded diagnostics
only from step 1920 onward. A report refuses a diagnostics log that does not
start at step 1, because its axes would not line up with the training curve, so
those three carry their partial series as `diagnostics-partial.riglog`: kept
beside the run, not declared, read by nothing automatically. The runs still
plot from their training curves rather than being dropped over it.
```bash
for bs in 64 128 256 512; do
for lr in 0.0078125 0.00390625 0.001953125; do
for seed in 1337 1338 1339; do
rig run reference --cluster v4-32 --profile dev --track open \
--tier 250m --tokens-per-parameter 5 \
--study-batch-size "$bs" --base-learning-rate "$lr" --seed "$seed" \
--name "250m-bs${bs}-lr${lr}-s${seed}"
done
done
done
```
## batch-size-sweep-500M.html
12 runs at two token budgets. Run names carry the budget
(`500m-5tpp-…` against `500m-20tpp-…`) because the two are different
experiments whose losses are not comparable to each other.
This is study 3's dashboard. It replaces both the former `500M-20tpp-v6e.html`
(three of these twelve) and `500M-20tpp-diagnostics.html`, which existed only
because those three were once the only 500M runs whose diagnostics could be
read. All twelve can now.
```bash
# 5 TPP arm, batch bracket at the optimal LR
for bs in 128 256; do
for seed in 1337 1338 1339; do
rig run reference --cluster v4-32 --profile dev --track open \
--tier 500m --tokens-per-parameter 5 \
--study-batch-size "$bs" --base-learning-rate 0.00390625 --seed "$seed" \
--name "500m-5tpp-bs${bs}-s${seed}"
done
done
# 20 TPP arm on the v6e-8: batch bracket, then the LR bracket at batch 128
for bs in 64 128 256; do
rig run reference --cluster v6e-8 --profile dev --track open \
--tier 500m --tokens-per-parameter 20 --checkpoint-policy none \
--study-batch-size "$bs" --base-learning-rate 0.00390625 --seed 1337 \
--name "500m-20tpp-bs${bs}-s1337"
done
for lr in 0.0078125 0.001953125; do
rig run reference --cluster v6e-8 --profile dev --track open \
--tier 500m --tokens-per-parameter 20 --checkpoint-policy none \
--study-batch-size 128 --base-learning-rate "$lr" --seed 1337 \
--name "500m-20tpp-bs128-lr${lr}-s1337"
done
```
## 3-seed-gradient-spike.html
12 runs: **4 learning rates × 3 seeds** at 250M, batch 128, 5 TPP. Built to
settle the 250M reseed in study 1, and the evidence base for
[GRADIENT_SPIKES.md](../GRADIENT_SPIKES.md).
Its diagnostics were unreadable long-form CSV until they were converted, so
for a while the dashboard about gradient spikes contained no gradient
statistics at all.
```bash
for lr in 0.015625 0.0078125 0.00390625 0.001953125; do
for seed in 1337 1338 1339; do
rig run reference --cluster v4-32 --profile dev --track open \
--tier 250m --tokens-per-parameter 5 \
--study-batch-size 128 --base-learning-rate "$lr" --seed "$seed" \
--name "250m-lr${lr}-s${seed}"
done
done
```
## 8k-lr-sweep-60M.html
15 runs: **5 learning rates × 3 seeds** of
[`reference_8k`](../../recipes/reference_8k/) — 60M at 8,192 context with
document masking, batch 16 so tokens per step and step count match the
1,024-context ladder exactly. This is study 4.
```bash
for lr in 0.015625 0.0078125 0.00390625 0.001953125 0.0009765625; do
for seed in 1337 1338 1339; do
rig run reference_8k --cluster v4-32 --profile dev --track open \
--tier 60m --tokens-per-parameter 5 \
--base-learning-rate "$lr" --seed "$seed" --checkpoint-policy none \
--name "60m-bs16-lr${lr}-s${seed}"
done
done
```
## moe-lr-sweep-8k.html
18 runs of [`reference_moe`](../../recipes/reference_moe/) — top-2 of 8
experts at 8,192 context, forked from the dense 8k ladder. 60M at five learning
rates × three seeds, plus 125M spot runs at three learning rates.
The routed ladder peaks at `2^-8`, the same learning rate the dense one does,
and beats it at every learning rate by 0.07–0.12 nats at equal *active*
parameters and matched compute, for about 1.7x the memory. No expert in any of
the 12 layers finished below 1% of assignments in any of the 18 runs.
This report carries six routing series the dense reports do not have: balance
loss, busiest and idlest expert share, routing entropy, mean top-1 gate, and
router logit RMS. They are recorded model-wide and per layer, with per-expert
load for all 8 experts in all 12 layers, at every step.
```bash
for lr in 0.015625 0.0078125 0.00390625 0.001953125 0.0009765625; do
for seed in 1337 1338 1339; do
rig run reference_moe --cluster v4-32 --profile dev --track open \
--tier 60m --tokens-per-parameter 5 \
--base-learning-rate "$lr" --seed "$seed" --checkpoint-policy none \
--name "60m-moe-lr${lr}-s${seed}"
done
done
```
## batch-size-grid-8k.html
42 runs extending the two 8k ladders to batch 32 and 64 — `reference_8k` and
`reference_moe` at 60M with three seeds per cell, `reference_moe` at 125M with
one. Three learning rates at every batch, so no batch is judged at a rate
picked for another. The batch-16 arm is not in this study: it is the ladder
each family already had, in `lr-sweep-8k-60M` and `moe-lr-sweep-8k`.
The token budget is held fixed across batches, so doubling the batch halves the
optimizer steps — 2,286 down to 571 at 60M. **Batch 16 wins everywhere.** The
best batch-32 run costs 0.39 nats at 60M dense, 0.27 routed, 0.05 at 125M; the
best batch-64 run costs 1.30, 1.15, and 0.31. Throughput is flat across the
grid (1,041 → 1,100 → 1,093 TFLOP/s at 60M dense), so nothing is bought back in
wall-clock. This reverses the 1,024-context ladder, where batch 128 was optimal
and larger batches finished sooner on the same budget; at 8k a single sequence
is eight times longer, so batch 16 already saturates the chips.
The apparent best learning rate moves between cells, but the seed spread grows
with batch — median 0.011 at batch 16, 0.046 at 32, 0.068 at 64 — until it is
as large as the gaps between rates. The drift is not resolvable at three seeds,
and every large-batch cell is far worse than batch 16 at every rate tried, so
it was not worth more machine time.
```bash
for recipe in reference_8k reference_moe; do
tag=$([ "$recipe" = reference_8k ] && echo 8k || echo moe)
for batch in 32 64; do
for lr in 0.0078125 0.00390625 0.001953125; do
for seed in 1337 1338 1339; do
rig run "$recipe" --cluster v4-32 --profile dev --track open \
--tier 60m --tokens-per-parameter 5 --study-batch-size "$batch" \
--base-learning-rate "$lr" --seed "$seed" --checkpoint-policy none \
--name "60m-${tag}-bs${batch}-lr${lr}-s${seed}"
done
done
done
done
```
## transfer-charts.html
Not a run dashboard. Derived figures built from recorded results by
[`make_transfer_charts.py`](make_transfer_charts.py), committed beside it.
```bash
uv run --frozen --no-sync python docs/reports/make_transfer_charts.py
```
---
## Rebuilding
Download a study from the dataset and point `rig report` at it:
```bash
huggingface-cli download quintic/rig-logs --repo-type dataset \
--include 'batch-sweep-60M/*' --local-dir /tmp/rig-logs
rig report --runs /tmp/rig-logs/batch-sweep-60M \
--max-points 1440 --layer-snapshots 400 \
--output docs/reports/batch-size-sweep-60M.html
```
`--max-points 0 --layer-snapshots 0` embeds every recorded sample. That is what
the dataset holds; it makes a much larger file than anything committed here.
## Two runs that are not in the dataset
- `20260816T213609.122328Z-…-37299d66` — a 500M run whose `stdout.log` was
deleted while the process still held the descriptor, so no `result.json` was
ever written. Its curves survive in the original archive but nothing records
what it measured, so it cannot be placed on a chart.
- A `studies` directory inside the 60M archive, which is not a run.
|