From 4bfbccec4b399f5795d06b01101d471dd69ac20a Mon Sep 17 00:00:00 2001 From: Daniel Han-Chen Date: Fri, 26 Jan 2024 18:04:59 +1100 Subject: [PATCH] Update fast_lora.py --- unsloth/kernels/fast_lora.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/unsloth/kernels/fast_lora.py b/unsloth/kernels/fast_lora.py index 418a6bfd64..d79826f5c8 100644 --- a/unsloth/kernels/fast_lora.py +++ b/unsloth/kernels/fast_lora.py @@ -178,11 +178,8 @@ pass def apply_lora_mlp(self, X): - gate = self.gate_proj(X) - up = self. up_proj(X) - h = torch.nn.functional.silu(gate) * up - down = self.down_proj(h) - return down + down_proj = self.down_proj(self.act_fn(self.gate_proj(X)) * self.up_proj(X)) + return down_proj gateW, gateW_quant, gateA, gateB, gateS = get_lora_parameters(self.gate_proj) upW, upW_quant, upA, upB, upS = get_lora_parameters(self. up_proj) downW, downW_quant, downA, downB, downS = get_lora_parameters(self.down_proj)