Depth study PyTorch in lower GPU utilization, CPU utilization is low

Reference link: https: //blog.csdn.net/qq_32998593/article/details/92849585

In summary, the first is to increase the batch size, memory footprint for the GPU, try to run out of memory, rather than left half empty memory to another program with the efficiency of the two tasks will be very low.

Second, the data loading time, the number of threads num_workers set slightly larger, the recommendation is 8, 16, etc., and open pin_memory = True. , Direct mapping of data to the GPU dedicated memory, reduce the data transmission time.

GPU and CPU data bottlenecks are addressed. Overall performance trade-offs. Do not place the entire process inside your main task to do, so consume CPU, and the speed and performance is extremely low.

 

Guess you like

Origin www.cnblogs.com/walktosee/p/11490278.html
Recommended