I have a laptop with 4 cores (4 CPUs I assume?). If I don’t set the number of threads (with torch.set_num_threads), the performance is really bad. I have two questions:
which number should I give to torch.set_num_threads? I don’t really understand what “number of threads” means. I have 4 cores, should I set it to 4 or to 1?
when should I set the number of threads? At the beginning of all my Pytorch programs?
I think if you use GPU, you can set it 1, but if you use CPUs for training, you can set it with 4 since there are 4 cores. It depends. But you can test the speedup.