SKKU-ESLAB / Auto-Compression

Automatic DNN compression tool with various model compression and neural architecture search techniques
MIT License
20 stars 20 forks source link

n_lvs and weight tensors in different devices #23

Closed GH-Jo closed 3 years ago

GH-Jo commented 3 years ago

When I use two GPUs to train the quantized model, the forward function of Q_Conv2 raises a runtime error. RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cuda:1!

We need to solve this for speeding up the model training.

GH-Jo commented 3 years ago

I changed the assignment of bits and n_lvs in Q_<modulename>, thanks to @LeeHayun 's advice. When we make member variables of nn.module s, torch.nn.Parameter works well with DataParallel whereas torch.Tensor tends to not work.

I close this issue.