Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix dygraph higer node creation #47231

Merged

Conversation

Charles-hit
Copy link
Contributor

@Charles-hit Charles-hit commented Oct 20, 2022

PR types

Bug fixes

PR changes

Others

Describe

背景:
动态图下目前使用到未实现的高阶算子,框架目前没有对这种情况进行处理,导致后续运算结果出现错误。

修复:
在自动代码生成部分,为使用到的未实现的高阶算子添加相应的报错信息。

拿matmul四阶举例,新增的报错信息如下:
"The Op matmul_triple_grad doesn't have any grad op. If you don't intend calculating higher order derivatives, please set create_graph to False."

@paddle-bot
Copy link

paddle-bot bot commented Oct 20, 2022

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

return (
next_grad_node_creation_str,
next_grad_node_out_list,
next_node_generator.backward_forward_inputs_map,
has_higher_order_node,
Copy link
Contributor

Choose a reason for hiding this comment

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

表示状态信息的has_higher_order_node放在开头或许更合适一些

Copy link
Contributor Author

@Charles-hit Charles-hit Oct 24, 2022

Choose a reason for hiding this comment

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

done

Comment on lines 1827 to 1829
\"don't intend calculating higher order \"
\"derivatives, please set `create_graph` to \"
\"False.\"));
Copy link
Contributor

Choose a reason for hiding this comment

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

这个换行看上去不太对齐

Copy link
Contributor Author

@Charles-hit Charles-hit Oct 24, 2022

Choose a reason for hiding this comment

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

done

Copy link
Contributor

@zyfncg zyfncg left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@JiabinYang JiabinYang left a comment

Choose a reason for hiding this comment

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

LGTM

@JiabinYang JiabinYang merged commit cb09cf9 into PaddlePaddle:develop Oct 26, 2022
Copy link
Contributor

@veyron95 veyron95 left a comment

Choose a reason for hiding this comment

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

LGTM, nice job

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.

4 participants