Hi @smth I am trying to use the DataParallel routine, but getting stuck on an error. Right now I am just trying to DataParallelify just one conv module within my net. So previously I had:
self.conv1 = nn.Conv2d(N.inputChannels, N.outputChannels, N.kernelSquareSize, stride = (1,1), padding = (1,1));
and now, as per the DataParallel documentation, I have:
self.conv1 = nn.Conv2d(N.inputChannels, N.outputChannels, N.kernelSquareSize, stride = (1,1), padding = (1,1)); self.conv1 = torch.nn.DataParallel(self.conv1, device_ids = [1, 2])
With this new code however, I am unable to get it to run, and I get the following error:
File “/billly/sillyNet.py”, line 67, in forward_prop
x = F.max_pool2d(F.relu(self.bn1(self.conv1(x))), (2,2))
File “/data/venv/pytorch/local/lib/python2.7/site-packages/torch/nn/modules/module.py”, line 210, in call
result = self.forward(*input, **kwargs)
File “/data/venv/pytorch/local/lib/python2.7/site-packages/torch/nn/parallel/data_parallel.py”, line 45, in forward
return self.gather(outputs, self.output_device)
File “/data/venv/pytorch/local/lib/python2.7/site-packages/torch/nn/parallel/data_parallel.py”, line 57, in gather
return gather(outputs, output_device)
File “/data/venv/pytorch/local/lib/python2.7/site-packages/torch/nn/parallel/scatter_gather.py”, line 25, in gather
return gather_map(outputs)
File “/data/venv/pytorch/local/lib/python2.7/site-packages/torch/nn/parallel/scatter_gather.py”, line 23, in gather_map
return Gather(target_device)(*outputs)
File "/data/venv/pytorch/local/lib/python2.7/site-packages/torch/nn/parallel/functions.py", line 32, in forward
return comm.gather(inputs, self.dim, self.target_device)
File “/data/venv/pytorch/local/lib/python2.7/site-packages/torch/cuda/comm.py”, line 141, in gather
result.narrow(dim, chunk_start, tensor.size(dim)).copy(tensor, True)
RuntimeError: cuda runtime error (77) : an illegal memory access was encountered at /home/soumith/local/builder/wheel/pytorch-src/torch/lib/THC/THCTensorCopy.cu:85
And it is occurring during the (attempted) forward prop in my code…
thanks…