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

Use for_range to rewrite adam #6967

Merged
merged 3 commits into from
Dec 25, 2017

Conversation

reyoung
Copy link
Collaborator

@reyoung reyoung commented Dec 25, 2017

Fix #6985
CPU time from 14.81s --> 12.23s, save 17%.
GPU time from 0.16s --> 0.09s, save 43%

@reyoung reyoung changed the title [WIP]Use tranform to rewrite adam Use tranform to rewrite adam Dec 25, 2017
@reyoung reyoung changed the title Use tranform to rewrite adam Use for_range to rewrite adam Dec 25, 2017
Copy link
Contributor

@chengduoZH chengduoZH left a comment

Choose a reason for hiding this comment

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

I think it can be merge first, and these small questions will be modified later.

AdamFunctor(T beta1, T beta2, T epsilon, const T* beta1_pow,
const T* beta2_pow, const T* mom1, T* mom1_out, const T* mom2,
T* mom2_out, const T* lr, const T* grad, const T* param,
T* param_out)
Copy link
Contributor

Choose a reason for hiding this comment

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

The output variable should be the end of the function.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes. That will fit google C++ style.

@reyoung reyoung merged commit ea4bdca into PaddlePaddle:develop Dec 25, 2017
@reyoung reyoung deleted the feature/optimize_adam_speed branch December 26, 2017 09:20
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

2 participants