MiniCPM-V
MiniCPM-V copied to clipboard
[BUG] 计算 vision embedding 时没有凑batch,导致性能差
是否已有关于该错误的issue或讨论? | Is there an existing issue / discussion for this?
- [X] 我已经搜索过已有的issues和讨论 | I have searched the existing issues / discussions
该问题是否在FAQ中有解答? | Is there an existing answer for this in FAQ?
- [X] 我已经搜索过FAQ | I have searched FAQ
当前行为 | Current Behavior
计算 vision embedding 时,在 bs 维度有一个 for 循环,导致无法充分利用显卡性能。想知道这样是 bydesign 的,还是实现有缺陷。
代码位置: https://huggingface.co/openbmb/MiniCPM-V-2/blob/ee00ff7ce36667e7df81cb2a018951b663bdcc59/modeling_minicpmv.py#L106
期望行为 | Expected Behavior
凑batch计算
复现方法 | Steps To Reproduce
No response
运行环境 | Environment
- OS:
- Python:
- Transformers:
- PyTorch:
- CUDA (`python -c 'import torch; print(torch.version.cuda)'`):
备注 | Anything else?
No response
如果是缺陷,我乐意提 pr
非常欢迎您尝试修改, 这个是 minicpm-v 2.0 存在的一个问题, 我们已经对v2以后的模型进行了修改 使用的是 huggingfaceM4实现的siglip 并且支持batch推理的~
非常欢迎您尝试修改, 这个是 minicpm-v 2.0 存在的一个问题, 我们已经对v2以后的模型进行了修改 使用的是 huggingfaceM4实现的siglip 并且支持batch推理的~
如果在这边resize/padding ,凑成batch输入,会对算法性能有影响吗
是会的