Skip to content

[Model] Add LoRA support for TransformersModel #13770

New issue

Have a question about this project? No Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “No 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? No Sign in to your account

Merged

Conversation

jeejeelee
Copy link
Collaborator

@jeejeelee jeejeelee commented Feb 24, 2025

  • Add unit test
  • Update docs

Signed-off-by: Jee Jee Li <pandaleefree@gmail.com>
Copy link

👋 Hi! Thank you for contributing to the vLLM project.

💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels.

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 either: Add ready label to the PR or enable auto-merge.

🚀

@jeejeelee jeejeelee changed the title [Model] A到底 [Model] Add LoRA support for TransformersModel Feb 24, 2025
@jeejeelee jeejeelee marked this pull request as draft February 24, 2025 16:19
@hmellor hmellor self-assigned this Feb 24, 2025
Signed-off-by: Jee Jee Li <pandaleefree@gmail.com>
Signed-off-by: Jee Jee Li <pandaleefree@gmail.com>
Signed-off-by: Jee Jee Li <pandaleefree@gmail.com>
Signed-off-by: Jee Jee Li <pandaleefree@gmail.com>
Signed-off-by: Jee Jee Li <pandaleefree@gmail.com>
Signed-off-by: Jee Jee Li <pandaleefree@gmail.com>
@mergify mergify bot added the documentation Improvements or additions to documentation label Feb 27, 2025
@jeejeelee jeejeelee marked this pull request as ready for review February 27, 2025 13:27
@jeejeelee jeejeelee requested a review from hmellor February 27, 2025 13:27
Copy link
Member

@hmellor hmellor left a comment

Choose a reason for hiding this comment

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

This is nice, thank you for adding LoRA support!

I've made a suggestion that allows the can_replace_layer methods to get the parent_cls of the HFCompatibleLinear so that the equivalent of _is_hf_linear can live inside HFCompatibleLinear. Let me know what you think!

Signed-off-by: Jee Jee Li <pandaleefree@gmail.com>
@jeejeelee jeejeelee force-pushed the transformers-model-support-lora branch from 621441b to f945195 Compare February 28, 2025 13:20
Signed-off-by: Jee Jee Li <pandaleefree@gmail.com>
@jeejeelee jeejeelee requested a review from hmellor February 28, 2025 13:40
Copy link
Member

@hmellor hmellor 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 making the suggested changes.

One final suggestion is that we reuse the subclassing used for HFCompatibleLinear to create a HFCompatibleLoRA. It feels like less of a hack than replacing the forward method of the instance itself.

Signed-off-by: Jee Jee Li <pandaleefree@gmail.com>
Signed-off-by: Jee Jee Li <pandaleefree@gmail.com>
Copy link
Member

@hmellor hmellor left a comment

Choose a reason for hiding this comment

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

LGTM!

@hmellor hmellor enabled auto-merge (squash) February 28, 2025 16:57
@github-actions github-actions bot added the ready ONLY add when PR is ready to merge/full CI is needed label Feb 28, 2025
Signed-off-by: Jee Jee Li <pandaleefree@gmail.com>
@jeejeelee jeejeelee force-pushed the transformers-model-support-lora branch from 1770035 to f0b94cc Compare March 1, 2025 01:53
@hmellor hmellor disabled auto-merge March 1, 2025 09:49
Signed-off-by: Jee Jee Li <pandaleefree@gmail.com>
@mergify mergify bot added the ci/build label Mar 1, 2025
@jeejeelee jeejeelee merged commit cc5e8f6 into vllm-project:main Mar 2, 2025
60 checks passed
@jeejeelee jeejeelee deleted the transformers-model-support-lora branch March 3, 2025 03:26
Akshat-Tripathi pushed a commit to krai/vllm that referenced this pull request Mar 3, 2025
Signed-off-by: Jee Jee Li <pandaleefree@gmail.com>
lulmer pushed a commit to lulmer/vllm that referenced this pull request Apr 7, 2025
Signed-off-by: Jee Jee Li <pandaleefree@gmail.com>
Signed-off-by: Louis Ulmer <ulmerlouis@gmail.com>
No Sign up for free to join this conversation on GitHub. Already have an account? No Sign in to comment
Labels
ci/build 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.

2 participants