[Fix] [NPU] LoRA: Update for follow-up with changes in sgl-kernel-npu (#40908)
Co-authored-by: ronnie_zheng <zl19940307@163.com>
This commit is contained in:
co-authored by
ronnie_zheng
parent
2c00b5d129
commit
55b2aef7ad
@@ -104,7 +104,7 @@ class AscendLoRABackend(BaseLoRABackend):
|
||||
output_tensor = base_output
|
||||
|
||||
torch.ops.npu.sgemmv_expand(
|
||||
x,
|
||||
x.to(dtype=torch.float),
|
||||
weights,
|
||||
self.batch_info.weight_indices,
|
||||
self.batch_info.seg_lens,
|
||||
@@ -152,6 +152,7 @@ class AscendLoRABackend(BaseLoRABackend):
|
||||
self.batch_info.lora_ranks,
|
||||
self.batch_info.scalings,
|
||||
lora_a_output,
|
||||
n_slices,
|
||||
)
|
||||
|
||||
torch.ops.npu.sgemmv_expand(
|
||||
@@ -182,6 +183,7 @@ class AscendLoRABackend(BaseLoRABackend):
|
||||
total_seq_len, _ = x.shape
|
||||
_, weight_intermediate_dim, _ = gate_up_lora_a.shape
|
||||
_, weight_out_dim, _ = gate_up_lora_b.shape
|
||||
n_slices = 2
|
||||
|
||||
if base_output is None:
|
||||
output_tensor = torch.zeros(
|
||||
@@ -202,6 +204,7 @@ class AscendLoRABackend(BaseLoRABackend):
|
||||
self.batch_info.lora_ranks,
|
||||
self.batch_info.scalings,
|
||||
lora_a_output,
|
||||
n_slices,
|
||||
)
|
||||
|
||||
torch.ops.npu.sgemmv_expand(
|
||||
|
||||
Reference in New Issue
Block a user