Windows下安装BigDL-LLM的总结(附Whisper加速环境需求)

1. 下载安装Anaconda

2. 新建Python虚拟环境

在Windows下启动Anaconda PowerShell Prompt,输入以下命令新建名为bigdl-llm的虚拟环境

conda create -n bigdl-llm python=3.9

从base切换虚拟环境至bigdl-llm

conda activate bigdl-llm

3. 安装jupyter、BigDL-LLM

pip install jupyter
pip install --pre --upgrade bigdl-llm[all]
pip install -U librosa

如果pip下载安装缓慢,建议切为国内镜像源,例如清华源,操作如下

pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

启动jupyter服务

jupyter notebook

4. 安装Chocolatey

Chocolatey 是 windows 下一款命令行包管理软件 ,简单说这就是 Windows 的 apt-get
以管理员身份运行PowerShell,运行以下

Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))

验证是否安装成功

choco -v

5. 安装whisper

pip install -U openai-whisper

因为需要用到ffmpeg,所以使用Chocolatey进行安装
安装ffmpeg(on Windows using Chocolatey),运行以下

choco install ffmpeg

6. 安装Visual Studio 2022 社区版

安装时选择“使用 C++ 的桌面开发”

7. 安装或更新最新的GPU驱动

8. 安装Intel® oneAPI Base Toolkit 2024.0

pip install dpcpp-cpp-rt==2024.0.2 mkl-dpcpp==2024.0.0 onednn==2024.0.0

9. GPU方式使用BigDL-LLM

如果已安装过虚拟环境,只缺少libuv,则可

conda install libuv

安装BigDL-LLM(GPU方式)有两种方式

  1. 通过PyPI
pip install --pre --upgrade bigdl-llm[xpu] -f https://developer.intel.com/ipex-whl-stable-xpu
  1. 通过Wheel
    如果网络不好,可以在https://developer.intel.com/ipex-whl-stable-xpu根据您的系统环境选择下载torch、torchvision、intel_extension_for_pytorch的对应的whl后再进行安装
pip install torch-2.1.0a0+cxx11.abi-cp39-cp39-win_amd64.whl
pip install torchvision-0.16.0a0+cxx11.abi-cp39-cp39-win_amd64.whl
pip install intel_extension_for_pytorch-2.1.10+xpu-cp39-cp39-win_amd64.whl
    
pip install --pre --upgrade bigdl-llm[xpu]

10. 环境变量配置

Intel iGPU 下

set SYCL_CACHE_PERSISTENT=1
set BIGDL_LLM_XMX_DISABLED=1

Intel Arc™ A300-Series or Pro A60 下

set SYCL_CACHE_PERSISTENT=1

对于每个模型第一次在Intel iGPU/Intel Arc™ A300-Series or Pro A60下运行时,都需要几分钟暖机

版权声明:本文为博主作者:dasha004原创文章,版权归属原作者,如果侵权,请联系我们删除!

原文链接:https://blog.csdn.net/dasha004/article/details/136836817

共计人评分,平均

到目前为止还没有投票!成为第一位评论此文章。

(0)
青葱年少的头像青葱年少普通用户
上一篇 2024年4月1日
下一篇 2024年4月1日

相关推荐