-
Notifications
You must be signed in to change notification settings - Fork 295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
minicpm-v采用W4A16量化,推理速度没什么变化 #1906
Comments
帮忙看看这个问题 |
@lvhan028 帮忙看看 |
请提供测速的方法。 |
测速的方法是,用同一批数据请求量化后和量化前的模型,分别统计两者的用时 |
能不能直接贴测试代码呢?对着代码说更清楚些。btw,vision 模型默认的batch size只有1。是要调整的。 |
另外请教下,『vision 模型默认的batch size只有1』,是什么意思,这个哪里用到了,跟github中的批处理有关系吗?(下面的代码) pipe = pipeline('liuhaotian/llava-v1.6-vicuna-7b', image_urls=[ |
lmdeploy的优势是在 LLM 推理部分,视觉部分没有优化。感觉是视觉处理占了大头,显得 w4a16 相比于 fp16 提升不明显。 |
这句话是啥意思,这个在哪里调整呢 |
推理速度提升的是LLM的部分,要测试的话,不要带图片。 可以参考这个文档 docs/zh_cn/benchmark/profile_api_server.md |
@irexyc 求助下,为什么我这边使用同样语句去量化minicpm会报错,运行环境是官方的docker,lmdeploy==0.5.0 File "/opt/conda/lib/python3.12/site-packages/lmdeploy/cli/entrypoint.py", line 43, in run |
@luoyangen 建议重新起一个容器,不要改任何东西试试一下。 |
@irexyc 把transformers的版本降到4.40.0可用了 |
Checklist
Describe the bug
minicpm-v采用W4A16量化后,显存占用确实小了,但是推理速度却没什么变化,是什么原因导致的呢?
量化脚本:
lmdeploy lite auto_awq
$HF_MODEL
--calib-dataset 'ptb'
--calib-samples 128
--calib-seqlen 2048
--w-bits 4
--w-group-size 128
--batch-size 1
--search-scale False
--work-dir $WORK_DIR
推理脚本:
pipe = pipeline(path, chat_template_config=ChatTemplateConfig(model_name='llama3'), backend_config=TurbomindEngineConfig(cache_max_entry_count=0.5, model_format='awq'))
Reproduction
无
Environment
Error traceback
The text was updated successfully, but these errors were encountered: