-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Accelerate Model Training with PyTorch 2.X
By :

Accelerating data loading is crucial to get an efficient data pipeline. In general, the following two changes are enough to get the work done:
Putting it that way, these changes may sound tougher to implement than they are. Making these changes is quite simple – we just need to add a couple of parameters when creating the DataLoader
instance for the data pipeline. We will cover this in the following subsections.
To transfer data from main memory to the GPU, and vice versa, the device driver must ask the operating system to pin or lock a portion of memory. After receiving access to that pinned memory, the device driver starts to copy data from the original memory location to the GPU, but using the pinned memory as a staging area:
Figure 5.6 – Data transfer...