-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
inference is slow #1
Comments
the problem may be from "compose-and-conquer/models/ddim_hacked.py" " p_sample_ddim" function.
the code above takes more time ( 6~7 seconds) than usual |
@Redtides0 hi, thanks for taking interest in our work! it looks like you've made a custom script to load your own triplets of fg, bg images and prompts without the need for gradio, judging from
Since I don't have your custom data, I tried to recreate the slowness by switching the main function from your script to
basically creating random fg, bg images. However, I wasn't able to recreate the bottleneck. I'm not sure what the problem might be just based off of your code since nothing seems out of the ordinary, but you could try setting the two Where having If it's still slow, you could try and replace your script with
and post the results here, maybe that might give some information about what might be causing the bottleneck. 平安, |
@tomtom1103 Thanks for ur advice :) Follwing the second advice, i get output like this (sorry for my narrow screen) |
@Redtides0 those times for a single image is indeed VERY slow, and isn't normal. When running If so, you could try adding the profiling script to
from your profiler table and mine, it can be seen that if cuDNN doesn't work for both the gradio demo and your custom script, there might be a problem with how torch was compiled in your environment. |
Thanks for your detailed explanation :) When running test_cnc.py (the gradio demo), it takes 20 seconds to generate a single image when For And |
@Redtides0 it seems that the problem can be narrowed down to the fact that cuDNN is being utilized for |
@tomtom1103 my card is NVIDIA-A800-SXM4-80GB, and the environment is from DEPRECATION: pytorch-lightning 1.6.0 has a non-standard dependency specifier torch>=1.8.*. pip 24.1 will enforce this behaviour change. A possible replacement is to upgrade to a newer version of pytorch-lightning or contact the author to suggest that they release a version with a conforming dependency specifiers. Discussion can be found at pypa/pip#12063 when i upgrade File "./models/cnc.py", line 7, in |
@Redtides0 I see, the problem seems to be with how |
Unfortunately, it didn't work :( |
@tomtom1103 Good news ! |
@Redtides0 awesome! that's a very novel way to hack around the gradio dependency. hope you have fun with CnC! Cheers :) |
Nice work!
when i run the script "test_cnc.py" provided in src/test, the inference speed is fast.
but when i make a new pipeline according to "test_cnc.py", the inference speed become super slow, when i check the CPU, GPU utilization, i found that the CPU utilization is very high and GPU utilization is low.
after debugging, all models and tensors are on "cuda", but the GPU utilization is not right
here is my new pipeline code, could you give me some advice?
The text was updated successfully, but these errors were encountered: