Change version number for 2.9+ because its bugging xformers

#7
by mediaizy - opened

When installing it for comfyui is bugging the xformers and we need a lower version number because some nodes wont load without xformers.
The whl was working (need to test some more) but it took me a while to notice that its a version check problem.

pytorch version: 2.14.0.dev20260626+cu132
xformers version: 0.0.35
Python version: 3.13.9

ImportError: Requires Flash-Attention version >=2.7.1,<=2.8.4 but got 2.9.1.

site-packages/xformers/ops/fmha/flash.py

if hasattr(flash_attn.flash_attn_interface, "flash_attn_cuda"):
    _flash_attn_cuda = flash_attn.flash_attn_interface.flash_attn_cuda
else:
    _flash_attn_cuda = flash_attn.flash_attn_interface.flash_attn_gpu

FLASH_VERSION = flash_attn.__version__
FLASH_VER_MIN = parse_version("2.7.1")
FLASH_VER_LAST = parse_version("2.9.4")  # last supported, inclusive (was 2.8.4)
flash_ver_parsed = parse_version(FLASH_VERSION)
if (
    flash_ver_parsed < FLASH_VER_MIN or flash_ver_parsed > FLASH_VER_LAST
) and os.environ.get("XFORMERS_IGNORE_FLASH_VERSION_CHECK", "0") != "1":
    raise ImportError(
        f"Requires Flash-Attention version >={FLASH_VER_MIN},"
        f"<={FLASH_VER_LAST} "
        f"but got {FLASH_VERSION}."
    )

Thanks for your important point.

I was also aware of this issue, as same as your problem. The versions I have released, from v2.9.0 onwards, apply my own modifications based on the SA4 logic, to the official v2.8.3, but naturally, xformers does not account for my custom build.

As I use ComfyUI without xformers, I do not encounter this problem, but I did notice it the other day. I should have mentioned this on the model card, but I forgot. I should have noted this issue for the benefit of users who use xformers alongside my version.

I will add this information shortly.

Furthermore, for users who use xformers, it is necessary to build the model based on v2.8.4 using the latest PyTorch. I will implement this fix and release it in the near future.

Thanks for your work.

Edit: It seems that there was a problem with RES4LYF node and its working but i just dont see any speed updates.

But as you said, if you used SA4 logic probably its not compatible with 40 series GPUs.

Sign up or log in to comment