-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Sgd support update selected rows #9597
Conversation
… sgd-support-update-selected-rows
paddle/fluid/operators/sgd_op.cc
Outdated
ctx.device_context()); | ||
} else { | ||
PADDLE_THROW("Param should be LoDTensor or SelectedRows"); | ||
} |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 ¶m = param_var->Get<framework::SelectedRows>(); | ||
auto *param_out = ctx.Output<framework::SelectedRows>("ParamOut"); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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:
- Input is const, the output is mutable.
- In the future, they can be different.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
… sgd-support-update-selected-rows
There was a problem hiding this 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.
task list: #9211