DeepCache
DeepCache copied to clipboard
Question about Macs of DeepCache
Hi, I tested the MACs of DeepCache with an interval of 5 following your guidance and obtained an average of 156.0782 G MACs, which is not consistent with Table 3 in your paper, where it's stated as 130.45 G.
To elaborate further, in each denoising step, if deep cache is not utilized, the parameters and MACs are as follows: #Params: 859.5210 M #MACs: 484.3895 G
if DeepCache is used, #Params: 859.5210 M #MACs: 76.0022 G
Could you please provide more details on how to reproduce the results?
Another concern has been raised: count_ops_and_params function does not work when deepcache helper is applied to UNet. The counted flops is 0 in this situation.
Hi, I'm currently trying to calculate the MACs, and Params as well using the flops.py in the source code. I keep getting errors, can you please share how you implemented the code to do this?
I simply follow the provided guidance and do not encounter complex errors. You can share your log here to discuss the problem.
Update: As reported in the official paper: "In our experiment, we choose the skip branch 3/1/2 for DDPMs, LDM-4-G and Stable Diffusion respectively." "We choose N=5 to achieve a throughput" I set hyperparameters as:
helper.set_params( cache_interval=5, cache_branch_id=2, skip_mode="uniform" )
Then, I got an average DeepCache (SDv1.5) MACs: 151.0G
@haoweiz23 It works Thank you for the response!
Can you please tell me how to use the flops.py file to calculate the MACs value after applying deepache in stable diffusion and why I am reporting this error AttributeError: 'StableDiffusionPipeline' object has no attribute 'apply', thanks!
Update:As reported in the official paper:"In our experiment, we choose the skip branch 3/1/2 for DDPMs, LDM-4-G and Stable Diffusion respectively.""We choose N=5 to achieve a throughput"I set hyperparameters as:
helper.set_params(cache_interval=5,cache_branch_id=2,skip_mode="uniform")
Then, I got an average DeepCache (SDv1.5) MACs: 151.0G Hello, I would like to ask you why running the count_ops_and_params function reports an error after I add the deepcache helper to the unet network, also I would like to trouble you with the fact that when running calculate MACs your count_ops_and_params function calculates that the input network added is pipe. If it is unet then I would like to ask you how do you get the average value of MACs for five consecutive runs of the unet network, thank you for your answer!