error on colab: WARNING[XFORMERS]: xFormers can't load C++/CUDA extensions. xFormers was…
- User
error on colab: WARNING[XFORMERS]: xFormers can't load C++/CUDA extensions. xFormers was built for: PyTorch 2.7.0+cu126 with CUDA 1206 (you have 2.6.0+cu124) Python 3.11.12 (you have 3.11.12) Please reinstall xformers (see https://github.com/facebookresearch/xformers#installing-xformers) Memory-efficient attention, SwiGLU, sparse and more won't be available. Set XFORMERS_MORE_DETAILS=1 for more details Traceback (most recent call last): File "/usr/local/lib/python3.11/dist-packages/diffusers/utils/import_utils.py", line 843, in _get_module return importlib.import_module("." + module_name, self.name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 1204, in _gcd_import File "", line 1176, in _find_and_load File "", line 1126, in _find_and_load_unlocked File "", line 241, in _call_with_frames_removed File "", line 1204, in _gcd_import File "", line 1176, in _find_and_load File "", line 1147, in _find_and_load_unlocked File "", line 690, in _load_unlocked File "", line 940, in exec_module File "", line 241, in _call_with_frames_removed File "/usr/local/lib/python3.11/dist-packages/diffusers/models/autoencoders/init.py", line 1, in from .autoencoder_asym_kl import AsymmetricAutoencoderKL File "/usr/local/lib/python3.11/dist-packages/diffusers/models/autoencoders/autoencoder_asym_kl.py", line 23, in from .vae import DecoderOutput, DiagonalGaussianDistribution, Encoder, MaskConditionDecoder File "/usr/local/lib/python3.11/dist-packages/diffusers/models/autoencoders/vae.py", line 24, in from ..attention_processor import SpatialNorm File "/usr/local/lib/python3.11/dist-packages/diffusers/models/attention_processor.py", line 35, in import xformers.ops File "/usr/local/lib/python3.11/dist-packages/xformers/ops/init.py", line 9, in from .fmha import ( File "/usr/local/lib/python3.11/dist-packages/xformers/ops/fmha/init.py", line 10, in from . import ( File "/usr/local/lib/python3.11/dist-packages/xformers/ops/fmha/flash3.py", line 58, in from ... import _C_flashattention3 # type: ignore[attr-defined] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ImportError: /usr/local/lib/python3.11/dist-packages/xformers/_C_flashattention3.so: undefined symbol: _ZN3c105ErrorC2ENS_14SourceLocationENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "/usr/local/lib/python3.11/dist-packages/diffusers/utils/import_utils.py", line 843, in _get_module return importlib.import_module("." + module_name, self.name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/importlib/.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 1204, in _gcd_import File "", line 1176, in _find_and_load File "", line 1147, in _find_and_load_unlocked File "", line 690, in _load_unlocked File "", line 940, in exec_module File "", line 241, in _call_with_frames_removed File "/usr/local/lib/python3.11/dist-packages/diffusers/pipelines/pipeline_utils.py", line 47, in from ..models import AutoencoderKL File "", line 1229, in _handle_fromlist File "/usr/local/lib/python3.11/dist-packages/diffusers/utils/import_utils.py", line 833, in module = self._get_module(self._class_to_module[name]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/diffusers/utils/import_utils.py", line 845, in _get_module raise RuntimeError( RuntimeError: Failed to import diffusers.models.autoencoders.autoencoder_kl because of the following error (look up to see its traceback): /usr/local/lib/python3.11/dist-packages/xformers/_C_flashattention3.so: undefined symbol: _ZN3c105ErrorC2ENS_14SourceLocationENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
- Assistant
The error message is caused by an incompatibility between your current PyTorch + CUDA versions and the installed package binary (pre-built extension). Specifically:
- User
- Assistant
This error:
codeRuntimeError: operator torchvision::nms does not existmeans that your installed version is incompatible with your installed PyTorch version. Specifically, the operator (non-maximum suppression) is missing in the binary loaded by torchvision, usually because:
- User
- Assistant
You are running into:
codeImportError: cannot import name 'EncoderDecoderCache' from 'transformers'This means your installed
diffusersandpeftpackages expect a newer version of thetransformerslibrary that exports , but your current version in your Colab environment is too old or incompatible. - User
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. torchaudio 2.6.0+cu124 requires torch==2.6.0, but you have torch 2.7.0 which is incompatible. torchvision 0.21.0+cu124 requires torch==2.6.0, but you have torch 2.7.0 which is incompatible. fastai 2.7.19 requires torch<2.7,>=1.10, but you have torch 2.7.0 which is incompatible.
- Assistant