mmpose
mmpose copied to clipboard
Why mmpose utilizes all CPU processors by default when training in GPU mode?
I trained pose estimation model SimpleBaseLine on a single GPU, where I set the num_workers parameter in pytorch Dataloader to be 4, however, all the CPU cores in my computer were ocuppied. For a remote server, it may have more than 32 CPU cores. This results in the phenomenon that my GPU always waiting for a bunch of CPU cores, for there are too many CPU cores simultaniously working. Consequently, my GPU ulitity rate is relatively slow.
How to limit the number of CPU cores used of the whole training procedure? It seemed that the CPU computation was fairly dense, since every core worked to about 50%, which led to 50% usage of the whole CPU system. However, I read the source code, the loading, preprocessing and augmentation of raw data shouldn't have occupied so many CPU computation power. What are they working for?
I applied mixed precision training. Is this the main reason for the high CPU utility rate?
You may use CPUS_PER_TASK=2 to set the number of CPUs.
You may use
CPUS_PER_TASK=2to set the number of CPUs.
Do you mean that adding environment variable CPUS_PER_TASK in the training bash script? It seems that this doesn't help improve GPU utility in my case....