Skip to content
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

[Model][LoRA]LoRA support added for Qwen2VLForConditionalGeneration #10022

Merged
merged 8 commits into from
Nov 6, 2024

Conversation

ericperfect
Copy link
Contributor

@ericperfect ericperfect commented Nov 5, 2024

[Model][LoRA]LoRA support added for Qwen2VLForConditionalGeneration
LoRA supported for inference in Qwen2VL
ping @ywang96 @DarkLight1337

Copy link

github-actions bot commented Nov 5, 2024

👋 Hi! Thank you for contributing to the vLLM project.
Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run fastcheck CI which starts running only a small and essential subset of CI tests to quickly catch errors. You can run other CI tests on top of those by going to your fastcheck build on Buildkite UI (linked in the PR checks section) and unblock them. If you do not have permission to unblock, ping simon-mo or khluu to add you in our Buildkite org.

Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging.

To run CI, PR reviewers can do one of these:

  • Add ready label to the PR
  • Enable auto-merge.

🚀

@ericperfect ericperfect changed the title Support lora of Qwen2VLForConditionalGeneration [Model][LoRA]LoRA support added for Qwen2VLForConditionalGeneration Nov 5, 2024
"gate_up_proj",
"down_proj",
]
embedding_modules = {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although vllm currently only supports lora inference for language model, considering that inference for vision modules will be supported in the future, we should also add vision encoder related modules.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

However, currently fine-tuning only the language model with LoRA achieves good results and meets the needs of most users. Further optimizations can be made later if necessary.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I agree with your view. I just think it might be better to complete the additions first. If you're interested, you can refer to Qwen-VL's implementation, see: https://github.com/vllm-project/vllm/blob/main/vllm/model_executor/models/qwen.py#L1015-L1046.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I'll take a look.

@jeejeelee
Copy link
Contributor

You can run bash format.sh to fix the code formatting errors

vllm/model_executor/models/qwen2_vl.py Outdated Show resolved Hide resolved
Signed-off-by: ericperfect <[email protected]>
Signed-off-by: ericperfect <[email protected]>
Signed-off-by: ericperfect <[email protected]>
Signed-off-by: ericperfect <[email protected]>
Signed-off-by: ericperfect <[email protected]>
Signed-off-by: ericperfect <[email protected]>
Copy link
Contributor

@jeejeelee jeejeelee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively, you could add TODO above the supported_lora_modules , indicating that we need to add LoRA for the visual encoder in the future. Additionally, you need to update the documentation to specify that this model supports LoRA.

…sage and update documentation.

Signed-off-by: ericperfect <[email protected]>
@mergify mergify bot added the documentation Improvements or additions to documentation label Nov 6, 2024
@ericperfect
Copy link
Contributor Author

Thanks, I already have added the TODO information and updated the documentation.

Copy link
Member

@DarkLight1337 DarkLight1337 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding this!

Also thanks @jeejeelee for the review

@DarkLight1337 DarkLight1337 enabled auto-merge (squash) November 6, 2024 10:23
@github-actions github-actions bot added the ready ONLY add when PR is ready to merge/full CI is needed label Nov 6, 2024
@DarkLight1337 DarkLight1337 merged commit 406d4cc into vllm-project:main Nov 6, 2024
61 checks passed
JC1DA pushed a commit to JC1DA/vllm that referenced this pull request Nov 11, 2024
sumitd2 pushed a commit to sumitd2/vllm that referenced this pull request Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation ready ONLY add when PR is ready to merge/full CI is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants