Open yondonfu opened 5 months ago
FWIW this was also in the release notes for xformers 0.0.24:
Triton kernels now require a GPU with compute capability 8.0 at least (A100 or newer). This is due to newer versions of triton not supporting older GPUs correctly
I don't think the above is related to the error in the OP because I was using a 3090 with compute capability 8.6:
nvidia-smi --query-gpu=compute_cap --format=csv
compute_cap
8.6
If you want to use xformers with a version that the official pypi source does not provide a prebuilt binary wheels for a specific torch version, you could download the source and build yourself.
And stable-fast
has no binary dependencies on xformers
so the failure of loading the C extension should be caused by other reasons. Anyway, xformers
is just an optional requirement and you can safely ignore it.
@chengzeyi
Ah got it. The error loading the C extension went away after I installed xformers==0.0.23
so I assumed it was related. If it is not related, then not sure what the problem was...
Anyway, I updated the note in https://github.com/chengzeyi/stable-fast/pull/116 about the option to build the latest xformers from source for torch < 2.2.0 as well in case you think it would be helpful to have in the README - otherwise feel free to close issue/PR and I can just follow up separately if I encounter the error with loading the C extension again!
@chengzeyi
Ah got it. The error loading the C extension went away after I installed
xformers==0.0.23
so I assumed it was related. If it is not related, then not sure what the problem was...Anyway, I updated the note in #116 about the option to build the latest xformers from source for torch < 2.2.0 as well in case you think it would be helpful to have in the README - otherwise feel free to close issue/PR and I can just follow up separately if I encounter the error with loading the C extension again!
I've tried using xformers==0.0.23 and install de libs needs but it show me the same error, what should i do? I am in manjaro
***ERROR IMPORTING sfast._C***
Unable to load stable-fast C extension.
Is it compatible with your PyTorch installation?
Or is it compatible with your CUDA version?
ComfyUI_stable_fast: StableFast node import failed.
Traceback (most recent call last):
File "/home/noe/Documentos/ComfyUI/custom_nodes/ComfyUI_stable_fast/__init__.py", line 10, in <module>
from .node import ApplyStableFastUnet
File "/home/noe/Documentos/ComfyUI/custom_nodes/ComfyUI_stable_fast/node.py", line 2, in <module>
from sfast.compilers.diffusion_pipeline_compiler import CompilationConfig
File "/home/noe/Documentos/ComfyUI/venv/lib/python3.11/site-packages/sfast/__init__.py", line 23, in <module>
import sfast._C as _C
ImportError: libcudart.so.11.0: cannot open shared object file: No such file or directory
or also
ComfyUI_stable_fast: StableFast node import failed.
Traceback (most recent call last):
File "/home/noe/Documentos/ComfyUI/custom_nodes/ComfyUI_stable_fast/__init__.py", line 10, in <module>
from .node import ApplyStableFastUnet
File "/home/noe/Documentos/ComfyUI/custom_nodes/ComfyUI_stable_fast/node.py", line 2, in <module>
from sfast.compilers.diffusion_pipeline_compiler import CompilationConfig
File "/home/noe/Documentos/ComfyUI/venv/lib/python3.11/site-packages/sfast/__init__.py", line 23, in <module>
import sfast._C as _C
ImportError: /home/noe/Documentos/ComfyUI/venv/lib/python3.11/site-packages/sfast/_C.cpython-311-x86_64-linux-gnu.so: undefined symbol: _ZN2at6native13scalar_tensorERKN3c106ScalarESt8optionalINS1_10ScalarTypeEES5_INS1_6LayoutEES5_INS1_6DeviceEES5_IbE
And
stable-fast
has no binary dependencies onxformers
so the failure of loading the C extension should be caused by other reasons. Anyway,xformers
is just an optional requirement and you can safely ignore it.
How could I solve this? I am in linux but the @yondonfu solution dont work for me.
@chengzeyi Ah got it. The error loading the C extension went away after I installed
xformers==0.0.23
so I assumed it was related. If it is not related, then not sure what the problem was... Anyway, I updated the note in #116 about the option to build the latest xformers from source for torch < 2.2.0 as well in case you think it would be helpful to have in the README - otherwise feel free to close issue/PR and I can just follow up separately if I encounter the error with loading the C extension again!I've tried using xformers==0.0.23 and install de libs needs but it show me the same error, what should i do? I am in manjaro
***ERROR IMPORTING sfast._C*** Unable to load stable-fast C extension. Is it compatible with your PyTorch installation? Or is it compatible with your CUDA version? ComfyUI_stable_fast: StableFast node import failed. Traceback (most recent call last): File "/home/noe/Documentos/ComfyUI/custom_nodes/ComfyUI_stable_fast/__init__.py", line 10, in <module> from .node import ApplyStableFastUnet File "/home/noe/Documentos/ComfyUI/custom_nodes/ComfyUI_stable_fast/node.py", line 2, in <module> from sfast.compilers.diffusion_pipeline_compiler import CompilationConfig File "/home/noe/Documentos/ComfyUI/venv/lib/python3.11/site-packages/sfast/__init__.py", line 23, in <module> import sfast._C as _C ImportError: libcudart.so.11.0: cannot open shared object file: No such file or directory
or also
ComfyUI_stable_fast: StableFast node import failed. Traceback (most recent call last): File "/home/noe/Documentos/ComfyUI/custom_nodes/ComfyUI_stable_fast/__init__.py", line 10, in <module> from .node import ApplyStableFastUnet File "/home/noe/Documentos/ComfyUI/custom_nodes/ComfyUI_stable_fast/node.py", line 2, in <module> from sfast.compilers.diffusion_pipeline_compiler import CompilationConfig File "/home/noe/Documentos/ComfyUI/venv/lib/python3.11/site-packages/sfast/__init__.py", line 23, in <module> import sfast._C as _C ImportError: /home/noe/Documentos/ComfyUI/venv/lib/python3.11/site-packages/sfast/_C.cpython-311-x86_64-linux-gnu.so: undefined symbol: _ZN2at6native13scalar_tensorERKN3c106ScalarESt8optionalINS1_10ScalarTypeEES5_INS1_6LayoutEES5_INS1_6DeviceEES5_IbE
me too, try so many combination of different versions of pytorch, triton, xformers, encountered this two ImportError
And
stable-fast
has no binary dependencies onxformers
so the failure of loading the C extension should be caused by other reasons. Anyway,xformers
is just an optional requirement and you can safely ignore it.How could I solve this? I am in linux but the @yondonfu solution dont work for me.
I 've solved this issue by installing higher version of xformers, torch, triton
I encountered the following error when using
stable-fast
to dynamically compile a diffusers image-to-image pipeline:The
compile_model()
function:The code that loads the diffusers pipelines and calls
compile_model()
:I am running the above in Docker with:
I ran the following to install
stable-fast
:Solution
I was able to fix this error by running
pip install 'xformers==0.0.23'
instead ofpip install 'xformers>=0.0.22'
.According to the xformers release notes, 0.0.24 pre-built wheels require PyTorch 2.2.0 so perhaps anyone using
stable-fast
with PyTorch < 2.2.0 needs to install xformers==0.0.23 which is the last release with pre-built wheels compatible with PyTorch < 2.2.0? Will open a PR with a small README update.