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

Sgd support update selected rows #9597

Merged

Conversation

jacquesqiao
Copy link
Member

@jacquesqiao jacquesqiao commented Apr 3, 2018

task list: #9211

ctx.device_context());
} else {
PADDLE_THROW("Param should be LoDTensor or SelectedRows");
}
Copy link
Contributor

Choose a reason for hiding this comment

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

line46-58 is similar to line21-35 of lookup_tabel_op, so I think we should add a new API, like GetPODTypeFromVar, do you think so?

Copy link
Member Author

Choose a reason for hiding this comment

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

done

"when param "
"is SelectedRows, gradient should also be SelectedRows");
const auto &param = param_var->Get<framework::SelectedRows>();
auto *param_out = ctx.Output<framework::SelectedRows>("ParamOut");
Copy link
Contributor

Choose a reason for hiding this comment

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

Can param_out and param be different?

Copy link
Member Author

Choose a reason for hiding this comment

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

Currently, they need to share the same memory, but we should use different vars to represent them for:

  1. Input is const, the output is mutable.
  2. In the future, they can be different.

Copy link
Contributor

@chengduoZH chengduoZH Apr 4, 2018

Choose a reason for hiding this comment

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

Now that, it should have a check under line89, like: PADDLE_ENFORCE_EQ(param, param_out);. And adding TODO to describe this.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think this enforce is not needed.

Copy link
Contributor

@luotao1 luotao1 left a comment

Choose a reason for hiding this comment

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

approve it since other jobs depend this pr.

@jacquesqiao jacquesqiao merged commit 424dd2f into PaddlePaddle:develop Apr 5, 2018
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