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] Simplify bn vjp #54012

Merged
merged 5 commits into from May 22, 2023

Conversation

cyber-pioneer
Copy link
Contributor

@cyber-pioneer cyber-pioneer commented May 21, 2023

PR types

Performance optimization

PR changes

Others

Description

Pcard-66975
Merge pr #53673.
To recompute part of batch_norm's vjp rule, in order to improve performance of CINN by enhancing op fusion.

@paddle-bot
Copy link

paddle-bot bot commented May 21, 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 21, 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.

Copy link
Contributor

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

@xiaoguoguo626807 xiaoguoguo626807 left a comment

Choose a reason for hiding this comment

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

为什么这样修改,需要牺牲计算时间吗

@cyber-pioneer
Copy link
Contributor Author

cyber-pioneer commented May 22, 2023

为什么这样修改,需要牺牲计算时间吗

cinn在算子融合的时候x_sub_mean这个变量在多个不同的group的里面由于同时引用,会生成多次缓存,通过recompute,可以优化显存使用,实测resnet50速度也有提升

@cyber-pioneer cyber-pioneer merged commit ad49e0f into PaddlePaddle:develop May 22, 2023
24 of 25 checks passed
bukejiyu pushed a commit to bukejiyu/Paddle that referenced this pull request May 22, 2023
* recompute bn grad

* fix test case

---------

Co-authored-by: sunli <466530738@qq.com>
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.

None yet

3 participants