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

[Cherry-pick] fix affine_channel no_need buffer bug #18849

Conversation

sneaxiy
Copy link
Collaborator

@sneaxiy sneaxiy commented Jul 26, 2019

Cherry-pick #18844.

@sneaxiy sneaxiy changed the title fix affine_channel no_need buffer bug, test=release/1.5 [Cherry-pick] fix affine_channel no_need buffer bug Jul 26, 2019
@sneaxiy sneaxiy requested a review from zhhsplendid July 26, 2019 13:12
!HasInput(framework::GradVarName("Bias"))) {
std::unordered_set<std::string> operator()() const override {
if (!HasOutput(framework::GradVarName("Scale")) &&
!HasOutput(framework::GradVarName("Bias"))) {
Copy link
Member

Choose a reason for hiding this comment

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

Since, Out = Scale*X + Bias, do we have to have X's data when computing Bias@Grad?

Can we write:

if (!HasOutput(framework::GradVarName("Scale"))) {
return {"X"};
}

Copy link
Member

Choose a reason for hiding this comment

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

Same comment as develop branch.

Copy link
Member

Choose a reason for hiding this comment

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

Discussed offline, the OP calculates Scale@Grad and Bias@Grad at the same time. In other words, the two Grads must occur at the same time. The PR LGTM

Copy link
Member

@zhhsplendid zhhsplendid left a comment

Choose a reason for hiding this comment

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

LGTM

@sneaxiy sneaxiy merged commit 46c5345 into PaddlePaddle:release/1.5 Jul 29, 2019
@sneaxiy sneaxiy deleted the release/1.5_fix_affine_channel_no_need_buffer_bug branch October 17, 2019 07:03
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