Skip to content

Conversation

2742195759
Copy link
Contributor

PR types

Bug fixes

PR changes

Others

Describe

Fix recurrent_grad tmp variable@GRAD don't exsit in VariableScope

背景

在seq2seq模型上开启新执行器的时候,发现RNN的一个OP报了错误:一个临时变量不存在VariableScope中。最后定位到了recurrent_grad op出现了问题。recurrent_grad这个Op实现的时候支持输入的临时变量GRAD不存在scope中。如果不存在,那么就会进行特殊处理。但是新执行器在执行前进行变量check,同时进行id映射。就导致了Op里面的特殊判断没有作用。

修改方式,在新执行器的 build_variable_map 中进行了一个特判,如果是 enforce_exist,才是检测不存在直接报错。如果enforce_exist=False,那么不存在的话直接跳过这个变量。

@paddle-bot-old
Copy link

paddle-bot-old bot commented Nov 9, 2021

Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

Copy link
Contributor

@wanghuancoder wanghuancoder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Aurelius84 Aurelius84 merged commit 81cfbdd into PaddlePaddle:develop Nov 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants