Guidelines for assigning num_workers to DataLoader

I’m not sure about the increase in GPU memory.
As I understand, pinned memory is used as a staging area on the host side (CPU).
So if pin_memory=True, the data will be directly copied to the pinned memory and from there to the GPU.
If pin_memory=False, the data will be allocated in pageable memory, transferred to the pinned memory, and then to the GPU.
See the NVIDIA devblog on pinned memory.

16 Likes