Skip to content

Commit ded2153

Browse files
author
chengduo
authored
Merge pull request #10645 from chengduoZH/fix_pe_bug
Fix pe bug
2 parents 0acc93c + a3ca4c9 commit ded2153

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

python/paddle/fluid/backward.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,8 @@ def append_backward(loss, parameter_list=None, no_grad_set=None,
480480

481481
program.current_block_idx = current_block_idx
482482
program.sync_with_cpp()
483+
# FIXME(zcd): prevent loss.grad optimized by mem_opt.
484+
loss.block.var(_append_grad_suffix_(loss.name)).persistable = True
483485

484486
if parameter_list is not None:
485487
parameters = parameter_list

0 commit comments

Comments
 (0)