OpenBMB / MiniCPM-V

MiniCPM-V 2.6: A GPT-4V Level MLLM for Single Image, Multi Image and Video on Your Phone
Apache License 2.0
12.08k stars 847 forks source link

💡 [REQUEST] - <MiniCPM-V-2_6的int4量化> #431

Closed Alxemade closed 1 month ago

Alxemade commented 1 month ago

起始日期 | Start Date

No response

实现PR | Implementation PR

No response

相关Issues | Reference Issues

No response

摘要 | Summary

MiniCPM-V-2_6的int4量化是啥样的,直接使用 bnb_quantize.py 好像会报错。

next_tokens = torch.multinomial(probs, num_samples=1).squeeze(1)
RuntimeError: probability tensor contains either `inf`, `nan` or element < 0

基本示例 | Basic Example

暂无

缺陷 | Drawbacks

暂无

未解决问题 | Unresolved questions

No response

tc-mb commented 1 month ago

可以请问下是用什么跑的int4模型么?因为我记得没有提供bnb_quantize.py 这个文件。

colorfulandcjy0806 commented 1 month ago

这个问题有点神奇 应该是依赖库的原因 我重新pip install -r requirements.txt后成功了 应该是之前配vllm的时候 环境改动了

seasoncool commented 1 month ago

请问 MiniCPM-V-2_6 int4版本的 支持vllm的推理吗 ?

chengjungao commented 1 month ago

我和你遇到了一样的问题,我发现是torch版本的问题,原来我环境里安装的是2.1.0的torch, 重新安装2.1.2就好了

seasoncool commented 1 month ago

@chengjungao 請教下您 2.6版本的 int4量化,支持vllm推理嗎? token/s 怎麼樣呀?

ARES3366 commented 1 month ago

请教下,你用的是vllm0.5.4 吗,我跑不通,vllm不支持bitsandbytes量化类型。Unknown quantization method: bitsandbytes. Must be one of ['awq', 'gptq', 'squeezellm', 'marlin']。

我和你遇到了一样的问题,我发现是torch版本的问题,原来我环境里安装的是2.1.0的torch, 重新安装2.1.2就好了

tc-mb commented 1 month ago

cool,这个问题看起来是环境不同引起的,感谢 @colorfulandcjy0806 和 @chengjungao 的经验分享。