[Intel][XPU][LoRA] Enable LoRA on Intel XPU (#30345)
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -103,18 +103,20 @@ class TestTorchNativeLoRABackend(CustomTestCase):
|
||||
self.lora_ranks, dtype=torch.int32, device=self.device
|
||||
)
|
||||
|
||||
output_offset = torch.tensor(
|
||||
[0, weight_out_dim], dtype=torch.int32, device="cpu"
|
||||
)
|
||||
|
||||
expect_output = reference_sgmv_expand(
|
||||
x,
|
||||
weights,
|
||||
weight_indices_tensor,
|
||||
seg_len_tensor,
|
||||
lora_ranks_tensor,
|
||||
slice_offsets=torch.tensor(
|
||||
[0, weight_out_dim], dtype=torch.int32, device="cpu"
|
||||
),
|
||||
slice_offsets=output_offset,
|
||||
)
|
||||
|
||||
actual_output = self.backend.run_lora_b_sgemm(x, weights)
|
||||
actual_output = self.backend.run_lora_b_sgemm(x, weights, output_offset)
|
||||
|
||||
self.assertTrue(torch.allclose(actual_output, expect_output))
|
||||
|
||||
@@ -237,7 +239,9 @@ class TestTorchNativeLoRABackend(CustomTestCase):
|
||||
slice_offsets=output_offset,
|
||||
)
|
||||
|
||||
actual_output = self.backend.run_gate_up_lora(x, gate_up_lora_a, gate_up_lora_b)
|
||||
actual_output = self.backend.run_gate_up_lora(
|
||||
x, gate_up_lora_a, gate_up_lora_b, output_offset
|
||||
)
|
||||
self.assertTrue(torch.allclose(actual_output, expect_output))
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user