-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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】support higher order autodiff for dy2static+composite #53171
【Prim】support higher order autodiff for dy2static+composite #53171
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
❌ The PR is not created using PR's template. You can refer to this Demo. |
883bcd2
to
ab25750
Compare
Sorry to inform you that ab25750's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually. |
94120d9
to
aee095e
Compare
aee095e
to
40fd316
Compare
40fd316
to
aa74cfe
Compare
): | ||
composite_block.create_var(name=name) | ||
op.desc.infer_var_type(composite_block.desc) | ||
op.desc.infer_shape(composite_block.desc) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
为什么这样修改
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
当前Block只包含前向OP列表,只需要对于没有输出的OP创建输出并推断形状,不需要将OP重复添加到block中。infershape_for_composite
会重复创建OP,比如fill_any_like
# this patch for primitive operators. | ||
for arg in grad_op_desc.output_arg_names(): | ||
if arg in new_vars: | ||
_infer_var_data_type_shape_(arg, block) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这部分修改是否可以合并至1784 else 分支中
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
可以的,只不过这样代码是一个非常Hack的补丁(Paddle 1.x版本已存在),单独放一段逻辑更容易引起注意
PR types
New features
PR changes
Others
Description
Pcard-66975
动转静+组合模式适配高阶微分部分逻辑:
_strip_grad_suffix_
适配,高阶微分模式下, 会产生z@GRAD_slice_0@GRAD
反向梯度命名,当前逻辑会错误解析为z
,正确命名应为z@GRAD_slice_0
其它参考: