Skip to content

Add optional early stopping to training loop#95

Open
AkilsuryaS wants to merge 1 commit intokarpathy:masterfrom
AkilsuryaS:feat/optional-early-stopping
Open

Add optional early stopping to training loop#95
AkilsuryaS wants to merge 1 commit intokarpathy:masterfrom
AkilsuryaS:feat/optional-early-stopping

Conversation

@AkilsuryaS
Copy link

Summary

This PR adds optional early stopping support to train.py while keeping the default training behavior unchanged.

What changed

  • Added configurable early-stopping knobs:
    • ENABLE_EARLY_STOP
    • EVAL_EVERY
    • EARLY_STOP_PATIENCE
    • MIN_DELTA
    • TARGET_VAL_BPB
    • SAVE_BEST_CHECKPOINT
    • BEST_CKPT_PATH
  • Added periodic validation during training when early stopping is enabled.
  • Added stop conditions for:
    • target validation BPB reached
    • patience exhausted (no sufficient improvement)
  • Added optional best-checkpoint save/restore path for final evaluation.
  • Added richer end-of-run reporting for early-stop metrics (best_val_bpb, best_step, last_val_bpb, stopped_early, stop_reason) and startup_seconds.

Behavior

  • Default flow is unchanged (ENABLE_EARLY_STOP = False).
  • Existing time-budget stop remains in place.
  • New logic activates only when early stopping is explicitly enabled.

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.

1 participant