williamyang1991 / Rerender_A_Video

[SIGGRAPH Asia 2023] Rerender A Video: Zero-Shot Text-Guided Video-to-Video Translation
https://www.mmlab-ntu.com/project/rerender/
Other
2.96k stars 202 forks source link

low gpu-util #129

Closed SongYxing closed 6 months ago

SongYxing commented 6 months ago

I run in the A100 80g bur the gpu-util is keeping lower than 20%. It makes the bad inference speed (60~80 second / frame).

williamyang1991 commented 6 months ago

I suppose that's the ebsynth part (not fully GPU-based, mostly CPU-based). Ebsynth is not implemented by us. If you are interested, you can improve the Ebsynth part to make a high gpu-util.

Our diffusion part does not have low gpu-util.

SongYxing commented 6 months ago

I am sorry. But (60~80 second / frame) infers to the ddim phase speed.

williamyang1991 commented 6 months ago

But in my case, on V100 32G, the speed is much faster than your case. (512x512 videos, take about 14.23s per frame) Did you use very large video resolution?

SongYxing commented 6 months ago

I also fixed the 512 x 512 resolution. And varm cost about 10g. In my case, we spend about 200s to load the model and inference per frame cost 60s. I first though it work in the CPU, but i check it work in CUDA:4 (I set it through torch.set.cuda). And it is difficulty to set gpu id in weiui.py. CUDA_VISIA... and os cmd are not working. It only work when i set it in front of the per process_x.

williamyang1991 commented 6 months ago

I remember that I can set the GPU by CUDA_VISIBLE_DEVICES=0 python webUI.py. The slow speed might also caused by WebUI? You can try to use rerender.py instead to test the speed. If rerender.py is also slow, then I think there may be something wrong with your hardware or software.

SongYxing commented 6 months ago

rerender.py also performs bad. I test another rep (fresco)

williamyang1991 commented 6 months ago

https://github.com/williamyang1991/Rerender_A_Video/blob/main/inference_playground.ipynb You can see the recorded speed in my inference_playground.ipynb

image

SongYxing commented 6 months ago

thanks for your patient resp

SongYxing commented 6 months ago

this image shows the speed 491714035079_ pic

williamyang1991 commented 6 months ago

I cannot help you with it. I think it is not the problem of my code. Your hardware or software or setting or environment may have some problem that slow down the code.