根据LLama Factory对Python 3.10的要求,推荐以下两种经过验证的版本组合:
一、高配组合(推荐)
Python: 3.10
PyTorch: 2.5.1
CUDA: 12.4
Auto-GPTQ: 0.7.1
vLLM: 0.6.5
安装方法:
pip install auto-gptq==0.7.1 # 需指定版本:ml-citation{ref="3" data="citationList"}
pip install vllm==0.6.5 # 安装时会自动覆盖CUDA为12.4、PyTorch为2.5.1:ml-citation{ref="3" data="citationList"}
二、保守组合(稳定优先)
Python: 3.10
PyTorch: 2.1.0
CUDA: 12.1
Auto-GPTQ: 0.5.1
vLLM: 0.5.4
安装方法:
pip install auto-gptq==0.5.1 # 需指定版本:ml-citation{ref="3" data="citationList"}
pip install vllm==0.5.4 # 安装时保持CUDA 12.1和PyTorch 2.1.0:ml-citation{ref="3" data="citationList"}
注意事项
CUDA版本兼容性:需根据NVIDIA显卡支持的CUDA最高版本选择组合。通过 nvidia-smi 或NVIDIA控制面板查看显卡支持的CUDA版本。
自动覆盖问题:高配组合中安装vllm会强制升级CUDA和PyTorch版本,无需手动干预。
PyTorch安装验证:安装完成后,可通过以下代码验证是否支持GPU:
python
import torch
print(torch.__version__) # 输出PyTorch版本:ml-citation{ref="2,7" data="citationList"}
print(torch.cuda.is_available()) # 应返回True:ml-citation{ref="2,4" data="citationList"}
以上组合均经过LLama Factory环境适配测试,建议优先选择高配组合以获得更好的性能支持。