simclr-pytorch icon indicating copy to clipboard operation
simclr-pytorch copied to clipboard

Use more than 4 GPU in linear evaluation

Open utjune opened this issue 2 years ago • 5 comments

Thanks for good code implementation. I using 8 gpus in 1 node. There was not a problem when I used 8 gpus in pretrain. But when I use 8 gpu in linear evaluation, there is a problem.

TypeError: forward() missing 1 required positional argument: 'x'

How can I solve it?

utjune avatar Dec 09 '22 02:12 utjune

Hi @utjune , sorry for the very late reply. Do you use dp or ddp?

AndrewAtanov avatar Jun 04 '23 13:06 AndrewAtanov

I used dp, because ddp is not implemented in linear evaluation XD. So when I tried to use 8 GPUs than error has occurred.

utjune avatar Jun 05 '23 01:06 utjune

does it only happen with 8 gpus, what if you use less gpus? what is your batch size?

AndrewAtanov avatar Jun 05 '23 09:06 AndrewAtanov

Yes, I did not try to use more than 8 gpus, but 4 gpus are ok. And my batch size is 1024. I tried to use 2048 batch size but the resource is not enough. 8 gpus, 2048 batch size -> error 4 gpus, 1024 batch size -> no problem 4 gpus, 2048 batch size -> resource problem

utjune avatar Jun 07 '23 00:06 utjune

Thanks for letting me know; this is weird; I'll try to test it on my end when I can access an 8-GPU node.

AndrewAtanov avatar Jun 11 '23 18:06 AndrewAtanov