1adrianb / face-alignment

:fire: 2D and 3D Face alignment library build using pytorch
https://www.adrianbulat.com
BSD 3-Clause "New" or "Revised" License
6.94k stars 1.33k forks source link

CPU Bottleneck caused by python ? 10% cuda usage #199

Open ExtReMLapin opened 3 years ago

ExtReMLapin commented 3 years ago

Hello,

I'm using face-alignement in first-order-model repo, especially the crop-video.py script.

While working on a 1080p video with CUDA, i get this performance :

32it [00:08, 4.43it/s]

CPU is used a 54%, CUDA @ 10%

When using CPU mode it's 4 times slower (no surprise here, it seems that CUDA mode is enabled correctly)

48it [00:44, 1.13it/s]

Is it a bug from the task manager that doesn't report the correct GPU usage ? Or is it related to python's terrible performances ?

ExtReMLapin commented 3 years ago

On another side, CUDA usage goes much higher on other parts of the project code (non related to face-alignement)

1adrianb commented 3 years ago

Sorry for delay. The network itself it relatively light and thin as such a high end GPU will typically be underutilized with it. To make better use of resources one simple solution may be to increased the batch size.

aaawrong commented 2 years ago

emmmm...Could you tell me where to increased the batch size?I tried to change batch size but it did not work.

Sorry for delay. The network itself it relatively light and thin as such a high end GPU will typically be underutilized with it. To make better use of resources one simple solution may be to increased the batch size.