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

Silu double grad #53605

Merged
Merged

Conversation

xiaoguoguo626807
Copy link
Contributor

@xiaoguoguo626807 xiaoguoguo626807 commented May 8, 2023

PR types

Others

PR changes

Others

Description

Pcard-66975

  1. 增加silu_double_grad的拆解规则,使得动态图从二阶开始拆解。
    silu, tanh 的静态图二阶compositeOpMaker自动生成在名称上有误,修改成本高,暂时不处理。由于静态图目前可通过flag控制在一阶进行拆解,后续需完善高阶下动静统一的执行路线后修复代码生成问题。

2.将一阶拆解逻辑和二阶拆解逻辑分别在两个文件中实现,以便管理。

3.修复机制,当yaml中无kernel,无invoke,只有composite时的相关解析逻辑
原始yaml 解析逻辑判断如果没有invoke字段则一定需要有kernel字段以生成调用的执行路径(c++ api 或 invoke的其他c++api),此pr新增的op yaml 只具备composite 的执行方式,因此需要适配解析逻辑

@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.

cxxly
cxxly previously approved these changes May 12, 2023
Copy link
Contributor

@cxxly cxxly left a comment

Choose a reason for hiding this comment

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

LGTM for silu_double_grad, and with TODO:

  • change silu_grad、silu_double_grad with more numerical stability decomposite rules.

const Tensor& grad_x_grad,
Tensor* grad_x,
Tensor* grad_out_grad) {
auto exp_neg_x = exp<T>(-x);
Copy link
Contributor

@cxxly cxxly May 12, 2023

Choose a reason for hiding this comment

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

replace e^-x with out in next pr.

Copy link
Contributor Author

@xiaoguoguo626807 xiaoguoguo626807 May 12, 2023

Choose a reason for hiding this comment

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

done in this pr

Copy link
Contributor

@cxxly cxxly left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -0,0 +1,393 @@
// Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
Copy link
Contributor

Choose a reason for hiding this comment

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

2022 -> 2023

Copy link
Contributor Author

Choose a reason for hiding this comment

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

other pr will modify

@xiaoguoguo626807 xiaoguoguo626807 merged commit 94c3880 into PaddlePaddle:develop May 15, 2023
@xiaoguoguo626807 xiaoguoguo626807 deleted the silu_double_grad branch May 15, 2023 08:59
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