解决50系显卡cuda报错 CUDA error: no kernel image is available & 50系安装Flash attention
·
CUDA error: no kernel image is available for execution on the device
pip uninstall torch torchvision torchaudio
pip cache purge
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu128
git clone https://github.com/Dao-AILab/flash-attention
cd flash-attention #进入目录
git submodule update --init --recursive
安装最新的编译工具
pip install --upgrade wheel
卸载ninja工具,否则会编译出错!
pip uninstall ninja
如果你是其他架构的显卡,则将里面的“120”改为该架构对应的代号。
export FLASH_ATTN_CUDA_ARCHS="120"
python setup.py install # 1h
更新conda环境内的 libstdc++ 库,否则运行时会报错,方法如下:
conda install -c conda-forge libstdcxx-ng
try:
import flash_attn
print("flash-attention 已安装,版本:", flash_attn.__version__)
except ImportError:
print("flash-attention 未安装")

欢迎来到由智源人工智能研究院发起的Triton中文社区,这里是一个汇聚了AI开发者、数据科学家、机器学习爱好者以及业界专家的活力平台。我们致力于成为业内领先的Triton技术交流与应用分享的殿堂,为推动人工智能技术的普及与深化应用贡献力量。
更多推荐
所有评论(0)