Hello:) I’m qurious about how Pytorch handles GPU allocation with reserved, free, allocated memory.
As trying to train Seq2Seq image generation model with single rtx 3070(8gb), there is OOM issue when the mini batch is over 2.

image781×261 45.3 KB

The picture shows allocated, free, reserved memory are not linearly associated with the batch size, and even(not in pic) the size of model(num of hidden layer) and the size of input image(225x225 or 160x160).
Is there any clear interpretation between (reserved,free,allocated) GPU memory and the model(size of the model, batch size…)?
I think just reducing mini batch size is not the most smart answer for OOM issue.