-
Notifications
You must be signed in to change notification settings - Fork 463
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
[Feature] Support llava onevision #2783
base: main
Are you sure you want to change the base?
[Feature] Support llava onevision #2783
Conversation
c15538a
to
948fffe
Compare
Hi, @deepindeed2022 thanks for your contribution to LMDeploy |
Yes, I 'll follow up after this PR #2810 merge. |
Hi, @deepindeed2022 |
- update llava doc - fix multi-gpus load issue - support llava onevision qwen
948fffe
to
7b5a83d
Compare
@lvhan028 the pr_ete_test failed with GPU resources. How to confirm CUDA_VISIBLE_DEVICES=5 is free or how to retry? |
@deepindeed2022 hi, there's an issue with pr_ete_test and the fixing pr will come soon. Pls ignore at the moment. |
lmdeploy/vl/model/llava.py
Outdated
from transformers import AutoConfig, AutoModelForCausalLM | ||
|
||
from lmdeploy.utils import get_logger | ||
from lmdeploy.vl.model.llava_hf import VISION_MODELS, LlavaHfVisionModel | ||
from lmdeploy.vl.model.utils import disable_logging, rewrite_ctx | ||
from lmdeploy.vl.model.utils import (disable_logging, | ||
get_vision_encoder_device_map, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
get_vision_encoder_device_map
is shared by LlavaHfVisionModel
, LlavaVisionModel
and LlavaNextVisionModel
I think it's better to put this function in the base class LlavaHfVisionModel
This reverts commit c2fef11.
…mdeploy into support_llava_onevision
return device_map | ||
|
||
for keys in same_device_keys: | ||
fuzzy_keys = [kk for kk in device_map for k in keys if kk.find(k)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fuzzy_keys = [kk for kk in device_map for k in keys if kk.find(k) != -1]
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
after changing it to
fuzzy_keys = [kk for kk in device_map for k in keys if k in kk]
it suffers RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:1 and cuda:2!
I will fix it later on
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tested ok on llavaonvision, llava, llava-hf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Is there any problem with this PR ? When is it expected to be used directly in the official code repository ? |
Hi, @deepindeed2022 |
Thanks for your contribution and we appreciate it a lot. The following instructions would make your pull request more healthy and more easily receiving feedbacks. If you do not understand some items, don't worry, just make the pull request and seek help from maintainers.
Motivation
Support llava-onevision with LMDeploy
Modification
Use cases (Optional)
Checklist