RobustBench / robustbench

RobustBench: a standardized adversarial robustness benchmark [NeurIPS 2021 Benchmarks and Datasets Track]
https://robustbench.github.io
Other
672 stars 99 forks source link

Multi GPU error on DMPreActResNet #58

Closed arppy closed 2 years ago

arppy commented 2 years ago

self.mean_cuda = self.mean.cuda()robustbench/model_zoo/architectures/dm_wide_resnet.py#L279 self.std_cuda = self.std.cuda()robustbench/model_zoo/architectures/dm_wide_resnet.py#L280 This referenced code lines force to put the two tensor on cuda:0. So in case of multiple GPU, I have got an error like this: RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:3 and cuda:0!

max-andr commented 2 years ago

thanks for raising it. indeed, we never seriously tried multi-GPU evaluation ourselves. we'll look into it!

dedeswim commented 2 years ago

Hi @arppy, thanks also for suggesting a solution to this issue. I will work on it ASAP. Meanwhile, I think that a temporary hack to have it work could be to set the CUDA_VISIBLE_DEVICES environment variable to the index of the GPU you want to use

dedeswim commented 2 years ago

@arppy it should have been solved by #61. Feel free to re-open this issue if the fix doesn't work or if you meant something else to be fixed 😊

arppy commented 2 years ago

@dedeswim, you are amazing! Thanks.