AI软件下载
有趣网站推荐及实用软件下载

Windows系统解决flash-attn安装很慢的方法

Windows系统直接pip 安装flash-attn是非常慢的,不过有大佬编译好了windows版本,我们可以直接拿来用。

项目地址:https://github.com/bdashore3/flash-attention/releases

上面项目支持的torch版本不全,可以用下面这个库

https://huggingface.co/lldacing/flash-attention-windows-wheel

先pip list,看看你的torch版本是哪个,你的是哪个版本,就选哪个版本flash-attn

比如说,我是torch2.4.0,我的python版本是3.10,也就是

flash_attn-2.7.1.post1+cu124torch2.4.0cxx11abiFALSE-cp310-cp310-win_amd64.whl

你也可以查看其它的Assets,查看更多版本列表

鼠标右键点击这一项,选择复制链接地址

然后在命令窗口里输入:

pip install https://github.com/bdashore3/flash-attention/releases/download/v2.7.1.post1/flash_attn-2.7.1.post1+cu124torch2.4.0cxx11abiFALSE-cp310-cp310-win_amd64.whl

经本人电脑测试,windows电脑上推荐使用组合torch2.7.0

pip install https://mirrors.nju.edu.cn/pytorch/whl/cu128/torch-2.7.0%2Bcu128-cp310-cp310-win_amd64.whl#sha256=c52c4b869742f00b12cb34521d1381be6119fa46244791704b00cc4a3cb06850

加torch2.8.0版flash-attention wheel

pip install https://huggingface.co/lldacing/flash-attention-windows-wheel/resolve/main/flash_attn-2.7.4.post1%2Bcu128torch2.8.0cxx11abiTRUE-cp310-cp310-win_amd64.whl?download=true

linux系统直接pip install flash-attn安装的话速度同样很慢,时间也要几个小时,可以直接安装编译好的whl,比如我的环境是python 3.10+torch 2.7.1+cu128,安装命令如下:

pip install https://github.com/Dao-AILab/flash-attention/releases/download/v2.8.2/flash_attn-2.8.2+cu12torch2.7cxx11abiTRUE-cp310-cp310-linux_x86_64.whl

flash-attention官方仓库链接:https://github.com/Dao-AILab/flash-attention


AI软件用不了?2元爽玩4090: 立即体验>>

软件催更及1对1人工答疑支持: https://nuowa.net/1806
赞(0) 打赏
软件无法使用?点击查看常见问题说明>>

最近更新

UV包管理器用法基础教程

UV是一个用 Rust 编写的高性能工具,旨在替代 Python 传统的包管理工具链,速度比 pip 和 Conda 快数十甚至上百倍。 安装 uv 你可以通过一条命令安装 uv: 安装后,...

觉得文章对你有帮助就打赏一下作者

非常感谢你的打赏,我将有更多的动力继续提供优质内容,让我们一起创建更加美好的世界!

支付宝扫一扫

微信扫一扫