Skip to content
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

Question about Macs of DeepCache #37

Open
haoweiz23 opened this issue Apr 14, 2024 · 8 comments
Open

Question about Macs of DeepCache #37

haoweiz23 opened this issue Apr 14, 2024 · 8 comments

Comments

@haoweiz23
Copy link

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?

@haoweiz23
Copy link
Author

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.

@Kyuseok-nam
Copy link

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?

@haoweiz23
Copy link
Author

I simply follow the provided guidance and do not encounter complex errors. You can share your log here to discuss the problem.

@haoweiz23
Copy link
Author

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

@Kyuseok-nam
Copy link

@haoweiz23 It works Thank you for the response!

@ZTzxj
Copy link

ZTzxj commented May 15, 2024

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!

@ZTzxj
Copy link

ZTzxj commented Jun 5, 2024

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!

@ZTzxj
Copy link

ZTzxj commented Oct 31, 2024

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.

Hello, I would like to ask when the use of deepcache MACs become 0, how do you solve this problem ah!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants