Of course I can reduce batch size, but the problem is that given the size of batch and model it should easily fit into memory. This is not the only case, when something like this happens to me. Sometimes the problem is even with a model with 17M parameters, batch size of 1 and 4GB GPU memory.