05 · TRAINING MECHANICS

Verified

Epochs, Steps, and Gradient Accumulation

Separate micro-steps from real weight updates and calculate the correct OOM response.

A micro-step is one forward/loss/backward pass for a micro batch. One optimizer step updates weights after accumulation completes.

Effective batch = micro batch × accumulation × GPU count. For OOM, reduce micro batch or sequence length; increase accumulation if the target effective batch must be preserved.

01

First thought

Accumulation 8 means the weights update eight times.

02

Correction

Eight backward passes accumulate gradients, then one optimizer step updates weights once.

03

Decision rule

Find the largest safe micro batch first; record step counts as optimizer steps.