Skip to content

attention dispatcher assumes wrong attributes for flash attn kernel from hub #14012

@bghira

Description

@bghira

Describe the bug

The breakage was in the active diffusers checkout, not in kernels. kernels-community/flash-attn2 exposes:

  • flash_attn_varlen_func
  • flash_attn_varlen_qkvpacked_func
  • flash_attn_interface._flash_attn_varlen_forward
  • flash_attn_interface._flash_attn_varlen_backward

But diffusers was trying to resolve:

  • flash_attn_interface._wrapped_flash_attn_varlen_forward
  • flash_attn_interface._wrapped_flash_attn_varlen_backward

Those wrapped* attrs do not exist in the current kernels package. I patched src/diffusers/models/attention_dispatch.py to use the actual _flash_attn_varlen_forward/...backward names, which allowed it to proceed.

Reproduction

No separate MRE

Logs

System Info

Not needed

Who can help?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions