Update fast_lora.py
This commit is contained in:
parent
cb06ce849b
commit
4f573494da
1 changed files with 7 additions and 4 deletions
|
|
@ -124,11 +124,14 @@ class LoRA_MLP(torch.autograd.Function):
|
|||
|
||||
DW = matmul_lora(dY, downW.t(), downW_quant, downB, downA, downS)
|
||||
se = torch.nn.functional.sigmoid(e)
|
||||
f = e * se
|
||||
h = f * g
|
||||
df = se * (1 - f) + f
|
||||
f = torch.nn.functional.silu(e)
|
||||
DW_f = DW * f
|
||||
DW_dfg = DW * df * g
|
||||
DW_dfg = DW * se * g * (1 + f * (1 - se))
|
||||
# f = e * se
|
||||
# h = f * g
|
||||
# df = se * (1 - f) + f
|
||||
# DW_f = DW * f
|
||||
# DW_dfg = DW * df * g
|
||||
# DW = matmul_lora(dY, downW.t(), downW_quant, downB, downA, downS)
|
||||
# DW, e, g = swiglu_DWf_DW_dfg_kernel(DW, e, g)
|
||||
# h, DW_f, DW_dfg = DW, e, g
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue