modelscope / modelscope/DiffSynth-Studio
[Bug] Fix flash_attn_func Return Value Handling for flash-attn3 Compatibility in wan_video_dit Model
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 13.1k
- Forks
- 1.3k
- Avg merge
- 13h 12m
- Merged PRs (30d)
- 45
Description
🐛 问题描述
在wan_video_dit模型的注意力模块中,当前flash_attn_func调用方式与flash-attn>=3.0.0b版本存在接口不兼容问题:
原代码:
python
x = flash_attn_interface.flash_attn_func(q, k, v)
报错信息:
ValueError: too many values to unpack (expected 1)
🔍 根本原因
flash-attn3 beta版本接口变更:
https://github.com/Dao-AILab/flash-attention/blob/main/hopper/flash_attn_interface.py#L518 显示函数现在返回Tuple[Tensor, ...],至少需要两个返回值接收位
🛠 建议修改
diff
- x = flash_attn_interface.flash_attn_func(q, k, v)
+ x, _ = flash_attn_interface.flash_attn_func(q, k, v) # 显式解包返回值
📌 附加备注
Beta版本标记:当前flash-attn3仍处于测试阶段,官方接口可能继续调整
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate the wan_video_dit attention module and search for the flash_attn_interface.flash_attn_func(q, k, v) call. Compare its return handling with the flash-attn3 interface described in the issue, then verify that the call works with the affected version and preserves compatibility with the model's attention path.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 52/100