pip install flash_attn 报错

目录

    • 报错截图
    • 关键问题
    • nvcc -V 查看 cuda 版本
    • 查看 usr/local/cuda-* 安装的cuda版本
    • 设置 cuda-12.0 (添加入环境变量)
    • FlashAttention 安装成功

报错截图

ImportError: This modeling file requires the following packages that were not found in your environment: flash_attn. Run pip install flash_attn

在这里插入图片描述

关键问题

RuntimeError: FlashAttention is only supported on CUDA 11.6 and above. Note: make sure nvcc has a supported version by running nvcc -V.(FalshAttention库只支持cuda>=11.6的

nvcc -V 查看 cuda 版本

在这里插入图片描述

查看 usr/local/cuda-* 安装的cuda版本

使用的是远程服务器,个人账户没有权限安装新的cuda,考虑现成的
发现已有cuda-11.1和cuda-12.0两个版本

在这里插入图片描述

设置 cuda-12.0 (添加入环境变量)

export PATH=/usr/local/cuda-12.0/bin:$PATH

再次使用nvcc -V查看,版本已经更新

在这里插入图片描述

FlashAttention 安装成功

(llama) xucg@qaz:/data/home/xucg/Llama-Chinese$ pip install flash-attn
Collecting flash-attnUsing cached flash_attn-2.5.8.tar.gz (2.5 MB)Preparing metadata (setup.py) ... done
Requirement already satisfied: torch in /home/xucg/anaconda3/envs/llama/lib/python3.10/site-packages (from flash-attn                                                        ) (2.1.2)
Collecting einops (from flash-attn)Using cached einops-0.8.0-py3-none-any.whl.metadata (12 kB)
Requirement already satisfied: packaging in /home/xucg/anaconda3/envs/llama/lib/python3.10/site-packages (from flash-                                                        attn) (24.0)
Requirement already satisfied: ninja in /home/xucg/anaconda3/envs/llama/lib/python3.10/site-packages (from flash-attn                                                        ) (1.11.1.1)
Requirement already satisfied: filelock in /home/xucg/anaconda3/envs/llama/lib/python3.10/site-packages (from torch->                                                        flash-attn) (3.14.0)
Requirement already satisfied: typing-extensions in /home/xucg/anaconda3/envs/llama/lib/python3.10/site-packages (fro                                                        m torch->flash-attn) (4.11.0)
Requirement already satisfied: sympy in /home/xucg/anaconda3/envs/llama/lib/python3.10/site-packages (from torch->fla                                                        sh-attn) (1.12)
Requirement already satisfied: networkx in /home/xucg/anaconda3/envs/llama/lib/python3.10/site-packages (from torch->                                                        flash-attn) (3.3)
Requirement already satisfied: jinja2 in /home/xucg/anaconda3/envs/llama/lib/python3.10/site-packages (from torch->fl                                                        ash-attn) (3.1.3)
Requirement already satisfied: fsspec in /home/xucg/anaconda3/envs/llama/lib/python3.10/site-packages (from torch->fl                                                        ash-attn) (2024.3.1)
Requirement already satisfied: nvidia-cuda-nvrtc-cu12==12.1.105 in /home/xucg/anaconda3/envs/llama/lib/python3.10/sit                                                        e-packages (from torch->flash-attn) (12.1.105)
Requirement already satisfied: nvidia-cuda-runtime-cu12==12.1.105 in /home/xucg/anaconda3/envs/llama/lib/python3.10/s                                                        ite-packages (from torch->flash-attn) (12.1.105)
Requirement already satisfied: nvidia-cuda-cupti-cu12==12.1.105 in /home/xucg/anaconda3/envs/llama/lib/python3.10/sit                                                        e-packages (from torch->flash-attn) (12.1.105)
Requirement already satisfied: nvidia-cudnn-cu12==8.9.2.26 in /home/xucg/anaconda3/envs/llama/lib/python3.10/site-pac                                                        kages (from torch->flash-attn) (8.9.2.26)
Requirement already satisfied: nvidia-cublas-cu12==12.1.3.1 in /home/xucg/anaconda3/envs/llama/lib/python3.10/site-pa                                                        ckages (from torch->flash-attn) (12.1.3.1)
Requirement already satisfied: nvidia-cufft-cu12==11.0.2.54 in /home/xucg/anaconda3/envs/llama/lib/python3.10/site-pa                                                        ckages (from torch->flash-attn) (11.0.2.54)
Requirement already satisfied: nvidia-curand-cu12==10.3.2.106 in /home/xucg/anaconda3/envs/llama/lib/python3.10/site-                                                        packages (from torch->flash-attn) (10.3.2.106)
Requirement already satisfied: nvidia-cusolver-cu12==11.4.5.107 in /home/xucg/anaconda3/envs/llama/lib/python3.10/sit                                                        e-packages (from torch->flash-attn) (11.4.5.107)
Requirement already satisfied: nvidia-cusparse-cu12==12.1.0.106 in /home/xucg/anaconda3/envs/llama/lib/python3.10/sit                                                        e-packages (from torch->flash-attn) (12.1.0.106)
Requirement already satisfied: nvidia-nccl-cu12==2.18.1 in /home/xucg/anaconda3/envs/llama/lib/python3.10/site-packag                                                        es (from torch->flash-attn) (2.18.1)
Requirement already satisfied: nvidia-nvtx-cu12==12.1.105 in /home/xucg/anaconda3/envs/llama/lib/python3.10/site-pack                                                        ages (from torch->flash-attn) (12.1.105)
Requirement already satisfied: triton==2.1.0 in /home/xucg/anaconda3/envs/llama/lib/python3.10/site-packages (from to                                                        rch->flash-attn) (2.1.0)
Requirement already satisfied: nvidia-nvjitlink-cu12 in /home/xucg/anaconda3/envs/llama/lib/python3.10/site-packages                                                         (from nvidia-cusolver-cu12==11.4.5.107->torch->flash-attn) (12.4.127)
Requirement already satisfied: MarkupSafe>=2.0 in /home/xucg/anaconda3/envs/llama/lib/python3.10/site-packages (from                                                         jinja2->torch->flash-attn) (2.1.5)
Requirement already satisfied: mpmath>=0.19 in /home/xucg/anaconda3/envs/llama/lib/python3.10/site-packages (from sym                                                        py->torch->flash-attn) (1.3.0)
Using cached einops-0.8.0-py3-none-any.whl (43 kB)
Building wheels for collected packages: flash-attnBuilding wheel for flash-attn (setup.py) ... doneCreated wheel for flash-attn: filename=flash_attn-2.5.8-cp310-cp310-linux_x86_64.whl size=120616671 sha256=1e782463                                                        ba32d2193924771c940805d74c365435d4142df18a261fc5a2fdff82Stored in directory: /home/xucg/.cache/pip/wheels/9b/5b/2b/dea8af4e954161c49ef1941938afcd91bb93689371ed12a226
Successfully built flash-attn
Installing collected packages: einops, flash-attn
Successfully installed einops-0.8.0 flash-attn-2.5.8

在这里插入图片描述

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.hqwc.cn/news/679473.html

如若内容造成侵权/违法违规/事实不符,请联系编程知识网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

【Redis7】了解Redis

1.常见数据库 1.1.键值存储数据库 如 Map 一样的key-value 对,典型代表就是 Redis。 1.2.列存储数据库 关系型数据库是典型的行存储数据库,按行存储的数据在物理层面占用的是连续存储空间,不适合海量数据存储。而按列存储则可实现分布式存储&…

小猪APP分发:重塑应用分发市场的创新力量

在移动互联网蓬勃发展的今天,应用分发平台作为连接开发者与用户的桥梁,扮演着至关重要的角色。然而,随着市场的饱和,如何在众多平台中脱颖而出,为开发者提供更宽广的舞台,同时确保用户能够便捷、安全地获取…

VALSE 2024 Workshop报告分享┆多模态大模型Monkey及其在文档智能中的应用

2024年视觉与学习青年学者研讨会(VALSE 2024)于5月5日到7日在重庆悦来国际会议中心举行。本公众号将全方位地对会议的热点进行报道,方便广大读者跟踪和了解人工智能的前沿理论和技术。欢迎广大读者对文章进行关注、阅读和转发。文章是对报告人…

[MySQL数据库] Java的JDBC编程(MySQL数据库基础操作完结)

🌸个人主页:https://blog.csdn.net/2301_80050796?spm1000.2115.3001.5343 🏵️热门专栏:🍕 Collection与数据结构 (91平均质量分)https://blog.csdn.net/2301_80050796/category_12621348.html?spm1001.2014.3001.5482 🧀Java …

添砖Java之路其二——基本数据类型,scanner,字符拼接。

目录 基本数据类型: ​编辑 Scanner: 字符拼接: 课后小题: 基本数据类型: 如图可见:Java里面有八种基本数据类型。 注意:在其中我们需要注意的是int默认整型数据,double是默认浮点型数据。因…

JAVA基础之jsp标准标签

jsp动作标签实现实例化一个实体类 <jsp:useBean id"标识符" class"java类名" scope"作用范围"> 传统的java方式实例化一个实体类 Users user new Users(); <%%> id: 对象名 * class:类 创建对象时,完全限定名(包名…

pytest教程-40-钩子函数-pytest_runtest_call

领取资料&#xff0c;咨询答疑&#xff0c;请➕wei: June__Go 上一小节我们学习了pytest_runtest_setup钩子函数的使用方法&#xff0c;本小节我们讲解一下pytest_runtest_call钩子函数的使用方法。 pytest_runtest_call 钩子函数在 pytest 调用测试函数&#xff08;即测试用…

如何进行Go语言的性能测试和调优?

文章目录 开篇一、性能测试1. 使用标准库中的testing包2. 使用第三方工具 二、性能调优1. 优化算法和数据结构2. 减少不必要的内存分配和垃圾回收3. 并发和并行 结尾 开篇 Go语言以其出色的性能和简洁的语法受到了广大开发者的喜爱。然而&#xff0c;在实际开发中&#xff0c;…

IO 5.8日

1&#xff1a;使用 dup2 实现错误日志功能 使用 write 和 read 实现文件的拷贝功能&#xff0c;注意&#xff0c;代码中所有函数后面&#xff0c;紧跟perror输出错误信息&#xff0c;要求这些错误信息重定向到错误日志 err.txt 中去 2&#xff1a;判断一个文件是否拥有用户可写…

Python爬虫基础知识学习(以爬取某二手房数据、某博数据与某红薯(书)评论数据为例)

一、爬虫基础流程 爬虫的过程模块化&#xff0c;基本上可以归纳为以下几个步骤&#xff1a; 1、分析网页URL&#xff1a;打开你想要爬取数据的网站&#xff0c;然后寻找真实的页面数据URL地址&#xff1b; 2、请求网页数据&#xff1a;模拟请求网页数据&#xff0c;这里我们介…

jmeter控制器讲解

1&#xff0c;随机顺序控制器和随机控制器的区别&#xff1a;随机顺序控制器下所有的接口都会执行&#xff0c;只是执行顺序是随机的&#xff0c;随机控制器下所有的接口中随机执行一个接口&#xff0c;其余接口不执行。

Python数据可视化------地图

基础地图使用 # 地图基本演示 # 导包 from pyecharts.charts import Map from pyecharts.options import TitleOpts, VisualMapOpts# 准备地图对象 cmap Map() # 准备数据&#xff08;列表&#xff09; data [("北京市", 99), ("上海市", 199), ("…