Skip to content

Commit 74878bd

Browse files
committed
revert change
1 parent 177c96a commit 74878bd

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

paddlenlp/trainer/utils/offload_optimizer.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,13 @@ def new_opt_op(*args):
6565
ret = origin_op(*args)
6666
is_offload_opt = getattr(args[0], "is_offload_opt", False)
6767
for i, arg in enumerate(args):
68-
need_offload_arg = i >= 2 and isinstance(arg, paddle.Tensor) and is_offload_opt
69-
if is_offload_opt_cache_master_weight():
70-
need_offload_arg = need_offload_arg and i != 8
71-
if need_offload_arg: # do not offload parameter and gradient
68+
# need_offload_arg = i >= 2 and isinstance(arg, paddle.Tensor) and is_offload_opt
69+
# if is_offload_opt_cache_master_weight():
70+
# need_offload_arg = need_offload_arg and i != 8
71+
# if need_offload_arg: # do not offload parameter and gradient
72+
if (
73+
i >= 2 and isinstance(arg, paddle.Tensor) and is_offload_opt
74+
): # do not offload parameter and gradient
7275
offload(arg)
7376
return ret
7477

0 commit comments

Comments
 (0)