Engineer-of-Stuff / stable-diffusion-paperspace

Jupyter notebooks for Paperspace.
The Unlicense
289 stars 110 forks source link

Unable to use xformers | No such operator xformers_flash::flash_fwd #68

Closed squaredice closed 1 year ago

squaredice commented 1 year ago

The error message is RuntimeError: No such operator xformers_flash::flash_fwd - did you forget to build xformers with `python setup.py develop`? facing it when trying to generate an image. I also tried to build and install xformers using the cells in the Build and Install Xformers part, but I had no luck as well.

Hardware: Paperspace Free A4000 stable-diffusion-paperspace repo commit = ae57c5b137c71f8e179f1ed55bf3643e21ea1b58 stable-diffusion-webui repo commit = 2c1bb46c7ad5b4536f6587d327a03f0ff7811c5d

Cyberes commented 1 year ago

I compiled the xformers wheels without a few features to make the binary smaller and compile time shorter. I have an update to the notebook with instructions on how to build full xformers. Basically, remove this from the compile cell:

XFORMERS_DISABLE_FLASH_ATTN=1 NVCC_FLAGS="--use_fast_math -DXFORMERS_MEM_EFF_ATTENTION_DISABLE_BACKWARD"

I also built xformers full last night:

pip install https://raw.githubusercontent.com/Cyberes/xformers-compiled/main/a4000/full/xformers-0.0.16%2B6f3c20f.d20230130-cp39-cp39-linux_x86_64.whl

What are you trying to do exactly? The minimal xformers has been working for me for just generating images but I got the same error when I tried training.

squaredice commented 1 year ago

@Cyberes just tried to generate an image using text2image and got this error

squaredice commented 1 year ago

by the way installing xformers full via pip install https://raw.githubusercontent.com/Cyberes/xformers-compiled/main/a4000/full/xformers-0.0.16%2B6f3c20f.d20230130-cp39-cp39-linux_x86_64.whl fixed the issue

Cyberes commented 1 year ago

Cool, glad that worked. I guess I should stick with xformers full.