Can dataloader run fully on gpu

Is there any possibility to run the DataLoader fully in gpu. For instance something like DataLoader().cuda()? Is that possible. If not that would be a great addition. For instance in multigpu systems that is very handy you can have one gpu for training and another for processing the data.

1 Like

It’s not “not supported”. You can write a custom Dataset class to achieve that. Just be careful with cuda device management and interprocess communication.


@SimonW thanks can you point me to a couple of examples on how to achieve that?

Not that I can think of. I believe that you need to use the spawn multiprocessing spawn method for it, and be careful about the things mentioned in