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

Fix parallel.do with batch norm #8186

Closed

Conversation

reyoung
Copy link
Collaborator

@reyoung reyoung commented Feb 6, 2018

Related issue #8153

@@ -248,6 +248,8 @@ class ParallelDoGradOp : public framework::OperatorBase {
const std::vector<framework::Scope *> &sub_scopes,
const platform::PlaceList &places) const {
for (auto &s : Outputs(framework::GradVarName(kParameters))) {
VLOG(10) << "Accumulating " << s;
if (s == framework::kEmptyVarName) continue;
Copy link
Collaborator Author

@reyoung reyoung Feb 6, 2018

Choose a reason for hiding this comment

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

Do not accumulate @EMPTY@

PADDLE_ENFORCE(ctx->HasOutputs(framework::GradVarName(kParameters)));
ctx->SetOutputsDim(framework::GradVarName(kParameters),
ctx->GetInputsDim(kParameters));
auto p_dims = ctx->GetInputsDim(kParameters);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

If parameter gradient is empty, do not infer shape.

@@ -274,21 +274,20 @@ def get_parameters(self):
parent_block = self.parent_block()

local_inputs = set()

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The previous logic cannot calculate parameters that used and updated by the same operator.

@tonyyang-svail
Copy link

tonyyang-svail commented Feb 6, 2018

For the purpose of this PR, please ignore the nccl error: unhandled cuda error. Possible reason: #8195

Update: it turns out the driver version of 199 is not enough. @helinwang is updating it.

@reyoung
Copy link
Collaborator Author

reyoung commented Feb 8, 2018

Merged by #8249

@reyoung reyoung closed this Feb 8, 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.

2 participants