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

Strange low cpu usage when sampling on cpu #17

Closed
4eJIoBek1 opened this issue May 6, 2023 · 3 comments
Closed

Strange low cpu usage when sampling on cpu #17

4eJIoBek1 opened this issue May 6, 2023 · 3 comments

Comments

@4eJIoBek1
Copy link

Sampling on CPU is possible but takes about ~5% of overall computations, while 90% is free and not using and idk why.

@bavritzer
Copy link

Having a similar issue, it takes hours to sample from the 300M model using CPU as a result. Is there a smaller model we can access or some other fix?

@ibrahimsoliman97
Copy link

change use_fp16=False in for sample_latents function, the speed i better on CPU for fp32, **this is not a root cause fix for low usage CPU.

@4eJIoBek1
Copy link
Author

4eJIoBek1 commented Jun 21, 2023

OMG use_fp16=False improves sampling speed dramatically! THX

  • 2 times faster sampling on gpu
  • 64 times faster sampling on cpu, with 20 steps you can make shapes for 10 minutes

anybody can explain why this setting is true by default? and why it works like this (imo sampling should be faster when fp16 precision is used, nor fp32 :/)

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