Page 1 of 1

Do I need to adjust batch size when distributed training

Posted: Fri Feb 18, 2022 6:32 pm
by misaka17009

If I have 4 GPUs, do I need to divide batch_size by 4 for getting the same result that came with 1 GPU?

I saw the memory allocated to each GPU in distribute mode is the same as when training in single GPU mode. So, I thought the actual batch size with 4 GPU distribution mode is four times in 1 GPU. That means, if I set the batch size to 16 and train the model with 4 GPU, my actual batch size is 16 x 4 which is 64.

Just want to confirm if the script auto divides the batch size.


Re: Do I need to adjust batch size when distributed training

Posted: Fri Feb 18, 2022 6:34 pm
by bryanlyon

Faceswap does not multiply your batch size. That's up to you. If you set the Batch Size to 16 and have 4 GPUs, it'll split that so that each GPU has a batch size of 4.