Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
li126com committed Jul 9, 2024
1 parent 8951edb commit 4b41bb5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internlm/solver/activation_checkpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ def recompute_forward_context(args, no_communication):

if handle:
handle.wait()
args = list(args)
args[0] = grad_output


Expand Down Expand Up @@ -157,6 +156,7 @@ def backward(ctx, *args):

detached_inputs = detach_variable(tuple(inputs))

args = list(args)
with recompute_forward_context(args, no_communication):
if ctx.had_autocast_in_fwd:
with torch.enable_grad(), internlm_accelerator.amp.autocast():
Expand Down

0 comments on commit 4b41bb5

Please sign in to comment.