File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments