PyTorch supports multi-process data loading. 26
The general idea is to create a dataset class and implement the pre-processing within the get functionality. If you create a data loader instance with that dataset and set num_workers, worker processes will handle fetching and preprocessing data.