问题描述:
- 多GPU运行torchrun --nnodes 1 --nproc_per_node=4,运行环境正常且无变化;
- 仅修改了代码中Tensor变量的channel大小,增大了model的大小;
- 提交服务器,代码报错信息如下:
File "/home/---/anaconda3/lib/python3.7/site-packages/torch/autograd/__init__.py", line 156, in backward
allow_unreachable=True, accumulate_grad=True) # allow_unreachable flag
RuntimeError: CUDA error: CUBLAS_STATUS_ALLOC_FAILED when calling `cublasCreate(handle)`
WARNING:torch.distributed.elastic.multiprocessing.api:Sending process 165592 closing signal SIGTERM
WARNING:torch.distributed.elastic.multiprocessing.api:Sending process 165593 closing signal SIGTERM
WARNING:torch.distributed.elastic.multiprocessing.api:Sending process 165594 closing signal SIGTERM
ERROR:torch.distributed.elastic.multiprocessing.api
在使用多GPU运行PyTorch时遇到RuntimeError,CUDA分配失败。问题可能由于增大了模型大小导致内存不足。通过减小batch_size,如从300调整为256,可以解决此问题。
订阅专栏 解锁全文
9862

被折叠的 条评论
为什么被折叠?



