[Intel][XPU][LoRA] Enable LoRA on Intel XPU (#30345)

This commit is contained in:
Anupa Sajikumar
2026-09-08 12:46:41 +08:00
committed by GitHub
parent 80e9a4ec74
commit 91a45ea37e
19 changed files with 1262 additions and 78 deletions
File diff suppressed because it is too large Load Diff
+9 -5
View File
@@ -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))