@Icemole Reports a case where he uses a PostprocessingDataset inside a MultiProcDataset. He finds that each MultiProcWorker uses more than one thread for its computation, resulting in a CPU overcommit (because the number of assigned CPUs matches the number of data processes), adversely affecting performance.
I wonder: is this a setup/config issue or a systematic issue of our current data loading pipeline? I cannot really believe that this hasn't happened anywhere before. E.g. speed perturbation seems like one use case where this would happen normally (due to using convolutions)? We use librosa for that, does it not use more than one core? In his setup there is torchaudio.add_noise.
ReturnnTrainingJob sets OMP_NUM_THREADS=self.rqmt["cpu"], so I see where the overcommit can come from when the child processes inherit that variable and think they have this many threads available. So, should we perhaps set OMP_NUM_THREADS=1 for the dataset worker processes (unless specified otherwise)? I don't think it's wise to set OMP_NUM_THREADS=1 for the main proc. I can have this wired up quickly, if you think this is sensible @albertz.
htop screenshot:

@Icemole Reports a case where he uses a PostprocessingDataset inside a MultiProcDataset. He finds that each MultiProcWorker uses more than one thread for its computation, resulting in a CPU overcommit (because the number of assigned CPUs matches the number of data processes), adversely affecting performance.
I wonder: is this a setup/config issue or a systematic issue of our current data loading pipeline? I cannot really believe that this hasn't happened anywhere before. E.g. speed perturbation seems like one use case where this would happen normally (due to using convolutions)? We use librosa for that, does it not use more than one core? In his setup there is
torchaudio.add_noise.ReturnnTrainingJob sets
OMP_NUM_THREADS=self.rqmt["cpu"], so I see where the overcommit can come from when the child processes inherit that variable and think they have this many threads available. So, should we perhaps setOMP_NUM_THREADS=1for the dataset worker processes (unless specified otherwise)? I don't think it's wise to setOMP_NUM_THREADS=1for the main proc. I can have this wired up quickly, if you think this is sensible @albertz.htop screenshot:
