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

【prim】add dygraph error code when close prim flag for op who has composite implement but no grad kernel #53610

Merged

Conversation

xiaoguoguo626807
Copy link
Contributor

@xiaoguoguo626807 xiaoguoguo626807 commented May 8, 2023

PR types

Bug fixes

PR changes

Others

Description

Pcard-66975
修复动态图下,如果有组合算子但没有更高阶的非组合算子时,在不打开组合路径的情况下抛出异常。

@paddle-bot
Copy link

paddle-bot bot commented May 8, 2023

你的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.

@paddle-bot
Copy link

paddle-bot bot commented May 8, 2023

❌ The PR is not created using PR's template. You can refer to this Demo.
Please use PR's template, it helps save our maintainers' time so that more developers get helped.

@xiaoguoguo626807 xiaoguoguo626807 changed the title add no prim no gradOp error code 【prim】add dygraph error code when close prim flag for op who has composite implement but no grad kernel May 8, 2023
Comment on lines 1908 to 1917
Unavailable_log = f""" if(trace_backward) {{
PADDLE_THROW(phi::errors::Unavailable(
\"The Op {self.backward_api_name} doesn't have any grad\"
\"op. If you don't intend calculating higher order\"
\"derivatives, please set `create_graph`to False.\"));
}}"""
next_grad_node_creation_str = f"""
if (!paddle::prim::PrimCommonUtils::IsEagerPrimEnabled()) {{
{Unavailable_log}
}}
Copy link
Contributor

Choose a reason for hiding this comment

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

抛异常的这个字符串可以直接写到下面的代码片段里

@xiaoguoguo626807 xiaoguoguo626807 merged commit fb8ea98 into PaddlePaddle:develop May 11, 2023
@xiaoguoguo626807 xiaoguoguo626807 deleted the high_order_noerror_bug branch May 11, 2023 01:15
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.

2 participants