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.75k stars 893 forks source link

[BUG] 为什么如何调整参数,显存占用都是接近80G? #660

Open DankoZhang opened 3 weeks ago

DankoZhang commented 3 weeks ago

是否已有关于该错误的issue或讨论? | Is there an existing issue / discussion for this?

该问题是否在FAQ中有解答? | Is there an existing answer for this in FAQ?

当前行为 | Current Behavior

max_slices_num = 9或者80 max_length = 2048或者4096 batch_size = 1或者9 无论这些参数如何配置,显存占用都是打满状态,两张A100 80G @LDLINGLINGLING

期望行为 | Expected Behavior

帮忙定位下原因

复现方法 | Steps To Reproduce

运行环境 | Environment

- OS: Linux
- Python: 3.12
- Transformers: 4.40
- PyTorch: 2.1.2
- CUDA (`python -c 'import torch; print(torch.version.cuda)'`):

备注 | Anything else?

LDLINGLINGLING commented 2 weeks ago

请问您是在微调过程中出现这个问题还是,推理

DankoZhang commented 2 weeks ago

请问您是在微调过程中出现这个问题还是,推理

@LDLINGLINGLING 是微调过程中。 max_slices_num,我猜测是图片分辨率都比较小,max_slices_num=9就能覆盖,所以显存占用变化不大; max_length和batch_size,就不太理解了