-
Notifications
You must be signed in to change notification settings - Fork 50
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
Fix Lora Rebase #290
Fix Lora Rebase #290
Conversation
@@ -131,9 +132,9 @@ def convert_mapping( | |||
if long_lora_context: | |||
assert long_lora_offsets is not None | |||
indices_list.append(long_lora_offsets) | |||
indices = torch.tensor(indices_list, dtype=torch.long, device="cuda") | |||
indices = torch.tensor(indices_list, dtype=torch.long, device=get_device()) |
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.
indices = torch.tensor(indices_list, dtype=torch.long, device=get_device()) | |
device = 'hpu' if current_platform.is_hpu() else 'cuda' | |
indices = torch.tensor(indices_list, dtype=torch.long, device=device) |
Then use device
instead of get_device()
in the remainder of the file. For getting current_platform
, add from vllm.platforms import current_platform
at the top of the file.
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.
We are using get_device; to localize this if condition; as get_device is used in many places in lora/models.py, lora/punica.py. This way the code looks clean
9d43b43
to
2a7e513
Compare
2a7e513
to
b6a2d2a
Compare
@michalkuligowski I have changed label from Intel to Habana. Both myself & Himangshu are from Habana team :-) |
Fixes Lora Related issues in vllm Rebase