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

【Hackathon 第三期 No.4】 为 Paddle 新增 cummax API #45073

Conversation

OccupyMars2025
Copy link
Contributor

PR types

New features

PR changes

APIs

Describe

为 Paddle 新增 cummax API

@paddle-bot
Copy link

paddle-bot bot commented Aug 11, 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.

@paddle-bot paddle-bot bot added contributor External developers status: proposed labels Aug 11, 2022
1. change "ops::CummaxGradMaker"  to  "ops::CummaxGradOpMaker"
2.  change "ops::CumOp"   to   "ops::CummaxOp"
@OccupyMars2025
Copy link
Contributor Author

OccupyMars2025 commented Aug 16, 2022

完全可以借鉴 cumsum 和 logcumsumexp 这两个API的实现,我的 forward kernel 几乎就是直接借鉴过来,只改了一行代码,其中 forward CPU kernel 似乎是没问题, 但是 forward GPU kernel 有点问题。 backward kernel 应该就需要自己理解后,完全自己写了。


if in_dygraph_mode():
if axis is None: axis = -1
return _C_ops.final_state_cummax(x, axis, flatten, False, False)
Copy link
Contributor

Choose a reason for hiding this comment

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

你好,Paddle底层过了改造,同意去掉了final_state_前缀。麻烦把这里的final_state_删掉吧~

Copy link
Contributor

Choose a reason for hiding this comment

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

@OccupyMars2025
改造的PR见 :#45306
开发文档的改造见:#45306 (comment)

Comment on lines +3146 to +3148
return _C_ops.cummax(x, 'flatten', flatten)
else:
return _C_ops.cummax(x, 'axis', axis, 'flatten', flatten)
Copy link
Contributor

Choose a reason for hiding this comment

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

你好,Paddle底层过了改造,以后老动态图API不再放在_C_ops,而是放在_legacy_C_ops下。辛苦这里也修改一下吧。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants