ymcui / Chinese-LLaMA-Alpaca

中文LLaMA&Alpaca大语言模型+本地CPU/GPU训练部署 (Chinese LLaMA & Alpaca LLMs)
https://github.com/ymcui/Chinese-LLaMA-Alpaca/wiki
Apache License 2.0
18.23k stars 1.86k forks source link

请问使用 llama.cpp推理模型是否支持GPU加速 #853

Closed whisky-12 closed 11 months ago

whisky-12 commented 11 months ago

提交前必须检查以下项目

问题类型

模型推理

基础模型

LLaMA-7B

操作系统

Linux

详细描述问题

您好 ,请问我使用 llama.cpp推理模型是否支持GPU加速,目前执行如下脚本,只使用了cpu资源,gpu资源未被调用,每轮propmt耗时比较久, CPU是4核32G,GPU是A100 32G 推理命令如下 cd llama.cpp && ./main -m codeLlama/CodeLlama-7b/ggml-model-q4_0.bin --color -f prompts/alpaca.txt -ins -c 2048 --temp 0.2 -n 256 --repeat_penalty 1.3

依赖情况(代码类问题务必提供)

#pip list | grep -E 'transformers|peft|torch'

运行日志或截图

![image](https://github.com/ymcui/Chinese-LLaMA-Alpaca/assets/79358023/06a1e529-5a79-4bb7-813b-c769bcba1a29)
![image](https://github.com/ymcui/Chinese-LLaMA-Alpaca/assets/79358023/8b3cf7b6-c077-4df6-bc81-b1c83af9e87e)
ymcui commented 11 months ago

仔细看wiki里的信息,调用GPU需要指定-ngl 1(前提是编译llama.cpp时启用了cublas)。 另外,你用的是codellama,和本项目无关 :)