Hello,
While developing a mnist classifier I ran into a problem with performance. I thought, I’d try out the DataLoader since I’ve seen it in a online course being used. This resulted in and unbearably large performance difference, as seen in my benchmarks.
Screenshot from 2019-05-16 21-50-47.png713×149 17.8 KB

I benchmarked Gradient Descent and Mini-batch Gradient Descent, each with the loop 1 and the train_loader 3(my dataloader instance) variant.
While I have managed to figure out, that I can increase the performance and thereby decrease the time by setting the num_workers of the dataloader to 8, it still performs poorly. Minibatch with TL on GPU takes about 1min20sec, which is somewhat equal to Minibatch with Loop on CPU, which can’t possibly be the best result achievable with the dataloader. Is there anything else i forgot to set on the dataloader? Or this is simple the reality of using the dataloader?
P.S. CPU=i7 8700k GPU=Aorus 1080 Ti