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

Fix Lora Rebase #290

Merged

Conversation

hlahkar
Copy link

@hlahkar hlahkar commented Sep 17, 2024

Fixes Lora Related issues in vllm Rebase

@hlahkar hlahkar changed the title Fix Lora Issues Fix Lora Rebase Sep 17, 2024
@@ -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())

Choose a reason for hiding this comment

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

Suggested change
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.

Copy link
Author

@hlahkar hlahkar Sep 19, 2024

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

@hlahkar hlahkar force-pushed the dev/hlahkar/lora_rebase branch 3 times, most recently from 9d43b43 to 2a7e513 Compare September 19, 2024 04:20
tests/lora/test_lora_hpu.py Show resolved Hide resolved
vllm/lora/models.py Show resolved Hide resolved
vllm/lora/layers.py Show resolved Hide resolved
@michalkuligowski michalkuligowski added the intel Issues or PRs submitted by Intel label Sep 20, 2024
@vivekgoe vivekgoe added habana Issues or PRs submitted by Habana Labs and removed intel Issues or PRs submitted by Intel labels Sep 20, 2024
@vivekgoe
Copy link

@michalkuligowski I have changed label from Intel to Habana. Both myself & Himangshu are from Habana team :-)

@kzawora-intel kzawora-intel merged commit b2653ab into private/kzawora/vllm_v0_6_0_rebase Sep 20, 2024
@hlahkar hlahkar deleted the dev/hlahkar/lora_rebase branch October 1, 2024 10:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
habana Issues or PRs submitted by Habana Labs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants