1
框架组件
有个小问题,关于软件兼容性的。
2025-07-02 11:41:27
86

在PyTorch的2.6.1+das.opt2.dtk24043中的版本说明写已知问题有一项是“暂不支持FlashAttention”,但是

FlashAttention的2.6.1+das.opt2.dtk24043里,却写着支持torch2.3.0软件栈。这应该如何理解。在安装完

triton 版本2.1.0+das.opt1.dtk24042和直接pip install pytest后,运行验证命令  python -c "import flash_attn; print(flash_attn .__version__)" 

显示:

A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.2.5 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.

If you are a user of the module, the easiest solution will be to
downgrade to 'numpy<2' or try to upgrade the affected module.
We expect that some modules will need time to support NumPy 2.

Traceback (most recent call last): File "<string> ", line 1, in <module> 
File "/home/user/anaconda3/envs/py31110/lib/python3.11/site-packages/flash_attn/init.py", line 13, in <module> 
from flash_attn.flash_attn_triton_interface import flash_attn_func as triton_flash_attn_func
File "/home/user/anaconda3/envs/py31110/lib/python3.11/site-packages/flash_attn/flash_attn_triton_interface.py", line 3, in <module> 
from flash_attn import flash_attn_triton
File "/home/user/anaconda3/envs/py31110/lib/python3.11/site-packages/flash_attn/flash_attn_triton.py", line 544, in <module> 
empty = torch.empty(128, device="cuda")
/home/user/anaconda3/envs/py31110/lib/python3.11/site-packages/flash_attn/flash_attn_triton.py:544: UserWarning: Failed to initialize NumPy: _ARRAY_API not found (Triggered internally at /data/jenkins_workspace/workspace/pytorch@13/torch/csrc/utils/tensor_numpy.cpp:84.)
empty = torch.empty(128, device="cuda")

2.6.1

这意思是安装成功了还是没成功?知否只要更换numpy的版本就行,还是说这个empty = torch.empty(128, device="cuda")说明会有什么问题?

全部评论(1)
只看楼主
H
hepj
1楼
DCU上的torch 、fa都需要使用DCU的版本,2.6.1的torch目前还没有进行支持,使用的应该是NV的版本。docker pull image.sourcefind.cn:5000/dcu/admin/base/pytorch:2.4.1-ubuntu22.04-dtk25.04.1-py3.10这个是最新的镜像,里边已经支持了fa,可以使用这个镜像来进行调试
2025/7/7
没有更多内容了
--
楼主
Level.1
0 帖子
楼主热帖
暂无数据