huggingface / huggingface/diffusers
attention dispatcher assumes wrong attributes for flash attn kernel from hub
- Dominant language
- Python
- Stars
- 34.5k
- Forks
- 7.3k
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 91
Description
### 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
```shell
```
### System Info
Not needed
### Who can help?
_No response_
Contributor guide
Research direction
Start in src/diffusers/models/attention_dispatch.py and inspect how the flash-attention functions are resolved from kernels-community/flash-attn2. Compare the requested _wrapped_* attributes with the exposed function names in the issue, then verify that the dispatcher proceeds through the flash-attention path using the current kernel package.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- machine-learning, performance
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100