I was training AlexNet on the ImageNet dataset and decided to vary the num_workers argument of the Dataloader, to see the impact it had. When analyzing the CPU usage, I found that the usage is higher with num_workers=0 than with num_workers set to 2, 4, or 8 (the results are presented in the graph). I know the difference is not much, but is there a reason for this to happen?
I don’t know if it’s important, but the experiments were run with pin_memory=True.
alexnet-pytorch-avg-cpu1500×900 18.4 KB
Note: The results shown in the graph are the average of 5 runs