Closed wangjiawen2013 closed 1 week ago
This is because of the multithreaded dataloader implementation.
The number of workers is actually prioritized to split the data loading workload, so unless you set the number of workers to 1 then there will always at least be num_workers
batches (and therefore, num_workers
iterations) with the current implementation.
I don't think this is explicitly detailed anywhere, so this might cause confusion and unexpected behavior (as it has for you) 🤔
Thanks, perfectly clear ! Unless setting the number of workers to 1 then there will always at least be num_workers batches
Hi, This is the configuration of the simple regress example:
and this is the experiment.log:
In my opinion, the
iteration
is independent fromnum_workers
. Because the dataset size of this example is small, we do full batch gradient descent and set batch size equivalent to size of dataset, so the iteration should be 1. However, as you can see here, the iteration equals tonum_workers
, both of them are 2. I set different num_workers (2, 10, 15, 20) and theiteration
always equals tonum_workers
. What's the relationship betweeniteration
andnum_workers
?