Hello everyone,
I'm hoping to get some guidance from this knowledgeable community. In our recent discussions, we touched on how to calculate the optimal batch size for training large language models using the formula:
Batch Size = Memory Available * Memory per Sample
I've tried applying this, but I'm not getting accurate estimations for my model's requirements. I suspect there may be additional factors I'm missing, such as:
- Overhead for model parameters and activations
- Memory fragmentation
- Framework-specific efficiencies
Would anyone be able to shed light on what else to consider when estimating batch sizes? Any tips, best practices, or common pitfalls to avoid would be greatly appreciated. I'm eager to learn from your expertise!
Thank you in advance for your help.