llama.cpp量化选项、推理速度对比 #195
ymcui
announced in
Announcements
Replies: 1 comment 2 replies
-
哇,在mac上面这么快,我用的V100,40层都加载在gpu里面都没你快,不知道是啥选项搞得有问题 |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
llama.cpp中提供了多种量化方式。下表中给出了最新版本中支持的量化参数及其相关对比,供参考。
已更新至Wiki:https://github.com/ymcui/Chinese-LLaMA-Alpaca/wiki/llama.cpp量化部署
关于量化参数
量化程序
./quantize
中的最后一个参数,其默认值为2,即使用q4_0
量化模式。下表给出了其他方式的效果对比。测试中使用了默认-t
参数(默认值:4),推理模型为中文Alpaca-7B,测试环境M1 Max。测试命令更多关于量化参数可参考llama.cpp#PPL。关于量化模型预测速度
关于速度方面,
-t
参数并不是越大越好,要根据自己的处理器进行适配。下表给出了M1 Max芯片(8大核2小核)的推理速度对比。可以看到,与核心数一致的时候速度最快,超过这个数值之后速度反而变慢。Beta Was this translation helpful? Give feedback.
All reactions