diffusers icon indicating copy to clipboard operation
diffusers copied to clipboard

attention.py test can force you to uninstall xformer

Open BurguerJohn opened this issue 3 years ago • 3 comments

Describe the bug

https://github.com/huggingface/diffusers/blob/9f8c915a756cf937a428186a2af8cc56f029f689/src/diffusers/models/attention.py#L305 https://github.com/huggingface/diffusers/blob/9f8c915a756cf937a428186a2af8cc56f029f689/src/diffusers/models/attention.py#L468

I have users that have xformer pre-compiled, but it not always work on their local computer. I do my own tests before calling set_use_memory_efficient_attention_xformers, but this will crash the application even if I'm turning the xformer to Off.

It's still a strange test to have hidden inside the model, this should be tested on a outside script, I think. Even so, even if tested in here, it should at least print a warning, not crash the application.

Reproduction

Pre-compile or install a xformers binary that don't work on your computer, it will aways throw a Exception, even if you are setting xformers = Off

This tests should be on another layer of the script or at least just do that tests if xformers = On

Logs

No response

System Info

Windows

BurguerJohn avatar Dec 19 '22 20:12 BurguerJohn

Thanks for noticing this, I've got a fix brewing in #1776

kig avatar Dec 19 '22 22:12 kig

PR is merged, thanks for spotting this @BurguerJohn and thanks a lot for the fix @kig

patrickvonplaten avatar Dec 20 '22 00:12 patrickvonplaten

Think we can close this one no?

patrickvonplaten avatar Dec 20 '22 00:12 patrickvonplaten

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

github-actions[bot] avatar Jan 19 '23 15:01 github-actions[bot]