InternLM-XComposer icon indicating copy to clipboard operation
InternLM-XComposer copied to clipboard

模型推理性能优化

Open will-wiki opened this issue 2 years ago • 6 comments

感谢博主开源~ 最近试用了InternLM-XComposer-VL-7b模型,效果很棒,就是推理的速度有点慢,目前使用V100进行推理,显存26G,耗时10s/条,想问下模型有什么推荐的推理加速方法么,还望博主给点建议

另外还尝试了internlm/internlm-xcomposer-7b-4bit模型,相同机器环境,显存从26G降到20G,耗时翻倍20s/条,不知道是不是我哪里设置的不对,推理上变慢了很多,这是为什么呢

以下是我使用的环境: 机器:V100 torch:2.1 cuda:11.8 python:3.9

will-wiki avatar Dec 01 '23 02:12 will-wiki

Thank you for submitting your request. To assist you better, could you please provide us with the code you are currently running along with the command you used? We will review it as soon as possible.

myownskyW7 avatar Dec 04 '23 13:12 myownskyW7

@myownskyW7 使用仓库中的examples/example_chat_4bit.py和examples/example_chat.py代码测试的,一个prompt预测多张图片计算得到的平均推理耗时

will-wiki avatar Dec 05 '23 02:12 will-wiki

@myownskyW7 同学你好,想问下这个问题有结论了吗?4bit量化应该是性能会提升,这样有点奇怪了

will-wiki avatar Dec 08 '23 08:12 will-wiki

同问,InternLM-XComposer-VL-7b模型,A100单卡推理,耗时5s/条。有什么优化方案么

LianghuiGuo avatar Jan 11 '24 03:01 LianghuiGuo

感谢博主开源~ 最近试用了InternLM-XComposer-VL-7b模型,效果很棒,就是推理的速度有点慢,目前使用V100进行推理,显存26G,耗时10s/条,想问下模型有什么推荐的推理加速方法么,还望博主给点建议

另外还尝试了internlm/internlm-xcomposer-7b-4bit模型,相同机器环境,显存从26G降到20G,耗时翻倍20s/条,不知道是不是我哪里设置的不对,推理上变慢了很多,这是为什么呢

以下是我使用的环境: 机器:V100 torch:2.1 cuda:11.8 python:3.9

您好,打扰一下,我是用博主开源的example/demo_chat.py文件,同样使用V100,为啥一直显示CUDA不足,博主可能修改文件了,您能分享一下examples/example_chat_4bit.py和examples/example_chat.py这两个文件吗,感谢

hyyuan123 avatar Feb 19 '24 02:02 hyyuan123

Thank you for submitting your request. To assist you better, could you please provide us with the code you are currently running along with the command you used? We will review it as soon as possible.

您好,我是用V100运行example/gradio_demo_chat.py文件,但是一直显示CUDA不足,这个程序运行需要多大的内存环境配置?我看有人可以使用V100卡运行成功,是什么问题导致的?

hyyuan123 avatar Feb 19 '24 02:02 hyyuan123