-
-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Core] Ensure LoRA linear respect the base_layer's tp_size and tp_rank #25487
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
Conversation
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.
Code Review
This pull request refactors the handling of tensor parallelism tp_size
and tp_rank
in LoRA layers to ensure consistency with the base layer, which is a solid improvement for maintainability and correctness. The changes also include some good optimizations to avoid unnecessary collective operations when tp_size
is 1. Additionally, this PR fixes a critical bug in lora_weights.py
where input_dim
and output_dim
properties were returning incorrect values. The changes are well-implemented and look good.
@@ -48,11 +48,11 @@ def optimize(self) -> "LoRALayerWeights": | |||
|
|||
@property | |||
def input_dim(self) -> int: | |||
return self.lora_a.shape[0] | |||
return self.lora_a.shape[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.
BTW, fix the dimension mismatch
Signed-off-by: Jee Jee Li <pandaleefree@gmail.com>
941d3d2
to
05e8559
Compare
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.
Thanks for the cleanup!
vllm-project#25487) Signed-off-by: Jee Jee Li <pandaleefree@gmail.com>
#25487) Signed-off-by: Jee Jee Li <pandaleefree@gmail.com> Signed-off-by: yewentao256 <zhyanwentao@126.com>
Purpose
Ensure all LoRA linear respect the base_layer's tp_size and tp_rank
Test Plan
Test Result
Essential Elements of an Effective PR Description Checklist
supported_models.md
andexamples
for a new model.