The class definitions can be defined in the script directy (or imported from another script).
To use multiple workers in a DataLoader you would have to set num_workers>0 while creating the DataLoader instance.
What is concerning, is this statement:



 chaslie:

increase the GPU memoray requirements by 40% as the multi processing code is being appled to the model as well as the dataloader,


The model should not be touched by the DataLoader in any way (unless you use it somehow inside your Dataset, which I don’t expect).
Are you using any CUDATensors inside the Dataset and how did you check that multiprocessing is also “applied to the model”?