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

Adam selectedrows and scatter functors #7045

Merged
merged 8 commits into from
Jan 2, 2018

Conversation

typhoonzero
Copy link
Contributor

@typhoonzero typhoonzero commented Dec 26, 2017

Fix #7019

Start: 2017.12.27
Due: 2018.1.3

T mom2 = moment2_[rows_[i] * row_numel_ + j];
T lr = *lr_;
T beta1_pow = *beta1_pow_;
T beta2_pow = *beta2_pow_;
Copy link
Contributor

Choose a reason for hiding this comment

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

T lr = *lr_;
T beta1_pow = *beta1_pow_;
T beta2_pow = *beta2_pow_;

For GPU, these operations are always call the data from memory to register?

mom2 = beta2_ * mom2 + (1 - beta2_) * g * g;
p -= lr * (mom1 / (sqrt(mom2) + epsilon_));
// IMPORTANT:
// FIXME(typhoonzero): row id may be duplicate
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! Will update this.

@typhoonzero typhoonzero changed the title Adam selectedrows [WIP] Adam selectedrows and scatter functors Dec 27, 2017
@typhoonzero typhoonzero changed the title [WIP] Adam selectedrows and scatter functors Adam selectedrows and scatter functors Dec 29, 2017
Copy link
Member

@QiJune QiJune left a comment

Choose a reason for hiding this comment

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

LGTM

if (tid == 0) {
for (size_t i = 0; i < out_rows_size; i++) {
if (input_rows[ty] == out_rows[i]) {
out_idx = i;
Copy link
Member

Choose a reason for hiding this comment

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

We can add a break here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure. I'll try to fix in next PR since I'm considering a way to simplify the functors.

@typhoonzero typhoonzero merged commit 0bd7f97 into PaddlePaddle:develop Jan 2, 2018
@typhoonzero typhoonzero deleted the adam_selectedrows branch January 2, 2018 01:40
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