Skip to content

Commit afa102d

Browse files
authored
fix offload optimizer (#10608)
1 parent 3fe3724 commit afa102d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

paddlenlp/trainer/utils/offload_optimizer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ def hack_offload_optimizer():
4343

4444
def new_add_accumulator(self, *args, **kwargs):
4545
x = origin_add_accumulator(self, *args, **kwargs)
46-
return offload(x)
46+
offload(x)
47+
return x
4748

4849
setattr(Optimizer, "_add_accumulator", new_add_accumulator)
4950

0 commit comments

Comments
 (0)