Performance & Scaling
Bug Report
PyTorch CUDA out of memory in an inference service: autograd, batch size and fragmentation
Our text classification service crashed with CUDA out of memory every few hours, always on a big batch. Logits kept for drift monitoring were holding autograd graphs alive, batches were sized by count not tokens, and the allocator was fragmented. How we measured each one and fixed it.