multigpu
![[PyTorch] Multi-GPU 사용하기 (torch.distributed.launch)](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fs7eYv%2FbtrEuzpx055%2Fc5LcwoueXIgKjP2ju5AtNk%2Fimg.png)
[PyTorch] Multi-GPU 사용하기 (torch.distributed.launch)
PyTorch 환경에서 train 할 때, CUDA OOM(Out Of Memory) 에러 때문에 여러개의 gpu로 동시에 병렬적으로 train 하고싶을 때가 있다. 이때는 torch.distributed.launch 를 사용하면 되는데 이는 다음과 같다. $ python -m torch.distributed.launch --nproc_per_node=2 train.py --launcher pytorch 참고로 위에서 --launcher는 내가 사용하는 code의 argments 중 하나이다!