Skip to content

Pythia configs: effective batch 320 + clean one-epoch stop#73

Merged
ksd3 merged 1 commit into
mainfrom
fix/pythia-batch320-graceful-stop
Jun 14, 2026
Merged

Pythia configs: effective batch 320 + clean one-epoch stop#73
ksd3 merged 1 commit into
mainfrom
fix/pythia-batch320-graceful-stop

Conversation

@Smith42

@Smith42 Smith42 commented Jun 14, 2026

Copy link
Copy Markdown
Owner

The config/pythia-like scaling-study runs target world size 1 and one pass over the Smith42/galaxies train split (N=8,474,566).

Configs (all 12):

  • gradient_accumulation_steps 58 -> 54, so the effective batch is 16*20 = 320. One epoch is then floor(N/320) = 26483 steps.
  • lr_decay_iters 27000*1.1 -> 26500, so the cosine schedule reaches min_lr right as the single epoch ends (max_iters=30000 stays as an unreached upper cap).

scripts/train.py:

  • Graceful end-of-stream handling: the streamed epoch is exhausted near step ~26.2-26.5k, before max_iters. The bare next(tdl) calls in the training loop, estimate_loss and validate now catch StopIteration and stop cleanly (saving a final checkpoint) instead of crashing.
  • Data shuffle uses a fixed, rank-independent seed (1337 rather than 1337 + seed_offset). At world size 1 this is a no-op, but it keeps the data order reproducible if these configs are ever run under DDP.

Supersedes #70 (data order is already deterministic at world size 1), #71 (one epoch via batch size + graceful stop rather than max_iters) and #72 (no local sampler needed).

The config/pythia-like scaling-study runs target world size 1 and one
pass over the Smith42/galaxies train split (N=8,474,566).

Configs (all 12):
- gradient_accumulation_steps 5*8 -> 5*4, so the effective batch is
  16*20 = 320. One epoch is then floor(N/320) = 26483 steps.
- lr_decay_iters 27000*1.1 -> 26500, so the cosine schedule reaches
  min_lr right as the single epoch ends (max_iters=30000 stays as an
  unreached upper cap).

scripts/train.py:
- Graceful end-of-stream handling: the streamed epoch is exhausted near
  step ~26.2-26.5k, before max_iters. The bare next(tdl) calls in the
  training loop, estimate_loss and validate now catch StopIteration and
  stop cleanly (saving a final checkpoint) instead of crashing.
- Data shuffle uses a fixed, rank-independent seed (1337 rather than
  1337 + seed_offset). At world size 1 this is a no-op, but it keeps the
  data order reproducible if these configs are ever run under DDP.

Supersedes #70 (data order is already deterministic at world size 1),
#71 (one epoch via batch size + graceful stop rather than max_iters) and
#72 (no local sampler needed).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Smith42 Smith42 requested a review from ksd3 June 14, 2026 03:04
@Smith42

Smith42 commented Jun 14, 2026

Copy link
Copy Markdown
Owner Author

Solves data ordinance problem by pinning world size to 1

@ksd3 ksd3 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is throttling to single-GPU which is fine for the moment

@ksd3 ksd3 merged commit 520410e into main Jun 14, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants