-
Notifications
You must be signed in to change notification settings - Fork 77
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
Support for long-contexts with LoRA #385
Conversation
752fff5
to
e19f189
Compare
Signed-off-by: Sanju C Sudhakaran <scsudhakaran@habana.ai>
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.
@SanjuCSudhakaran added review comments, please check.
self.model.embedding_modules, | ||
self.model.embedding_padding_modules) | ||
self.model.embedding_padding_modules, | ||
max_position_embeddings=self.model.config. |
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.
Why we are not initializing it exactly as it is being done in upstream code? Refer to
https://github.com/vllm-project/vllm/blob/dbfa8d31d5e7627a84671c6068ecc8fa58acd1d1/vllm/worker/model_runner.py#L1083
long_lora_offsets = torch.zeros(len(index_mapping_indices), | ||
device=get_device(), | ||
dtype=torch.long) | ||
long_lora_offsets_list = [] |
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.
follow notation, add type List[int]
|
||
long_lora_offsets = torch.tensor(long_lora_offsets_list, |
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.
W.r.t. functionality this change is ok for other backends (e.g. CUDA) also. @kzawora-intel is it ok to keep it? or do we need to make it HPU specific to be more upstream(ing) friendly?
key, | ||
offsets=self.punica_wrapper.long_lora_indices, | ||
) | ||
offsets = self.punica_wrapper.long_lora_indices.reshape_as(positions) |
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.
Is this change ok for other backends (e.g. CUDA)?
return (type(source_layer) is LinearScalingRotaryEmbedding | ||
or type(source_layer) is RotaryEmbedding) | ||
if current_platform.is_hpu(): | ||
return (type(source_layer) is HpuLinearScalingRotaryEmbedding |
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.
Is there any functional impact of using default code?
These changes are no longer required since the latest vllm-fork already refactored RoPE to handle this. PR #404 |
This PR does the following