Lightning-AI / Lightning-AI/pytorch-lightning
sync_batchnorm with gradient accumulation
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 31.4k
- Forks
- 3.8k
- Avg merge
- 6d 7h
- Merged PRs (30d)
- 6
Description
Description & Motivation
There is an easy way to do gradient accumulatation on lighting, but as I understand the batch norm is problematic since it's calculated every forward pass.
We should fix this by enabling batch norm sync on gradient accumulatation (mainly with one gpu).
Pitch
No response
Alternatives
No response
Additional context
No response
cc @borda
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files, tests, or entry points are named. Start by tracing how gradient accumulation and synchronized batch normalization are handled in PyTorch Lightning, then reproduce the behavior with one GPU. Done means synchronized batch normalization works correctly across accumulated batches without requiring multiple GPUs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- machine-learning
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100