Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 9 additions & 19 deletions vllm_ascend/lora/punica_wrapper/lora_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,9 @@ def bgmv_expand_slice(inputs: torch.Tensor,
slice_offset: int,
slice_size: int,
add_inputs: bool = True):
return torch.ops._C.bgmv_expand(
inputs,
lora_b_weights,
lora_indices_tensor,
output_tensor,
slice_offset,
slice_size
)
return torch.ops._C.bgmv_expand(inputs, lora_b_weights,
lora_indices_tensor, output_tensor,
slice_offset, slice_size)
Comment thread
Yikun marked this conversation as resolved.


def sgmv_shrink(
Expand All @@ -74,8 +69,9 @@ def sgmv_shrink(
token_nums: int,
scaling: float,
):
return torch.ops._C.sgmv_shrink(inputs, lora_a_weights, lora_indices_tensor,
seq_len_tensor, output_tensor, scaling)
return torch.ops._C.sgmv_shrink(inputs, lora_a_weights,
lora_indices_tensor, seq_len_tensor,
output_tensor, scaling)
Comment thread
Yikun marked this conversation as resolved.


def sgmv_expand(inputs: torch.Tensor,
Expand Down Expand Up @@ -111,12 +107,6 @@ def sgmv_expand_slice(inputs: torch.Tensor,
slice_offset: int,
slice_size: int,
add_inputs: bool = False):
return torch.ops._C.sgmv_expand(
inputs,
lora_b_weights,
lora_indices_tensor,
seq_len_tensor,
output_tensor,
slice_offset,
slice_size
)
return torch.ops._C.sgmv_expand(inputs, lora_b_weights,
lora_indices_tensor, seq_len_tensor,
output_tensor, slice_offset, slice_size)
Comment thread
Yikun marked this conversation as resolved.
21 changes: 8 additions & 13 deletions vllm_ascend/meta_registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,23 +80,18 @@ def get_masked_input_and_mask_meta(input: torch.Tensor,

return masked_input, mask

def bgmv_expand_meta(x: torch.Tensor,
weight: torch.Tensor,
indices: torch.Tensor,
y: torch.Tensor,
slice_offset: int,
slice_size: int):

def bgmv_expand_meta(x: torch.Tensor, weight: torch.Tensor,
indices: torch.Tensor, y: torch.Tensor, slice_offset: int,
slice_size: int):
Comment thread
Yikun marked this conversation as resolved.

y_out = torch.empty_like(y)
return y_out

def sgmv_expand_meta(x: torch.Tensor,
weight: torch.Tensor,
lora_indices: torch.Tensor,
seq_len: torch.Tensor,
y: torch.Tensor,
slice_offset: int,
slice_size: int):

def sgmv_expand_meta(x: torch.Tensor, weight: torch.Tensor,
lora_indices: torch.Tensor, seq_len: torch.Tensor,
y: torch.Tensor, slice_offset: int, slice_size: int):
Comment thread
Yikun marked this conversation as resolved.

y_out = torch.empty_like(y)
return y_out
Expand Down
Loading