Why it matters
Grad accum enables larger effective batch without more memory. Standard technique.
Advertisement
The architecture
Micro-batch forward + backward.
Do not zero grads.
After K: step + zero.
Advertisement
How it works end to end
K micro-batches per step.
Divide loss by K for scaling.
DDP: sync only on step.
Effective batch K * micro-batch.