From c57495df6fd7b61e6fe2b8ce463f0c8ae06fb1d6 Mon Sep 17 00:00:00 2001 From: Daniel Han-Chen Date: Sat, 27 Jan 2024 03:38:19 +1100 Subject: [PATCH] Update fast_lora.py --- unsloth/kernels/fast_lora.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unsloth/kernels/fast_lora.py b/unsloth/kernels/fast_lora.py index c383bf4136..b7649683b3 100644 --- a/unsloth/kernels/fast_lora.py +++ b/unsloth/kernels/fast_lora.py @@ -184,7 +184,7 @@ pass class LoRA_MLP_New(torch.autograd.Function): - @staticmethod + @classmethod @torch.cuda.amp.custom_fwd def forward(ctx, X : torch.Tensor, gateW, gateW_quant, gateA, gateB, gateS, @@ -214,7 +214,7 @@ class LoRA_MLP_New(torch.autograd.Function): return (dy.float() * sigm * (1 + X.float() * (1 - sigm))).to(X.dtype) pass - @staticmethod + @classmethod @torch.cuda.amp.custom_bwd def backward(ctx, dY : torch.Tensor): gateW, gateW_quant, gateS, upW, upW_quant, upS, downW, downW_quant, downS, = \