Unverified Commit 9e753741 authored by Ther's avatar Ther Committed by GitHub
Browse files

fix QLoRA mem bug: delete useless buffered activation (#1270)

* chore: delete useless buffered activation

* fix: fix bugs
parent 39b42e74
......@@ -513,7 +513,7 @@ class MatMul4Bit(torch.autograd.Function):
ctx.dtype_A, ctx.dtype_B, ctx.dtype_bias = A.dtype, B.dtype, None if bias is None else bias.dtype
if any(ctx.needs_input_grad[:2]):
ctx.tensors = (A, B)
ctx.tensors = (None, B)
else:
ctx.tensors = (None, None)
......@@ -526,7 +526,7 @@ class MatMul4Bit(torch.autograd.Function):
return torch.zeros_like(ctx.A), torch.zeros_like(ctx.B), None, bias_grad, None
req_gradA, _, _, req_gradBias, _ = ctx.needs_input_grad
A, B = ctx.tensors
_, B = ctx.tensors
grad_A, grad_B, grad_bias = None, None, None
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment