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 bug in MultiGradientMachine. #2650

Merged
merged 1 commit into from
Jun 28, 2017

Conversation

qingqing01
Copy link
Contributor

Fix #2649

Copy link
Contributor

@pkuyym pkuyym left a comment

Choose a reason for hiding this comment

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

Great, LGTM.

@@ -601,7 +601,7 @@ void TrainerThread::backward() {

void TrainerThread::backwardCallback(Parameter* para) {
// CPU parameters are merged in the end
if (!para->useGpu()) return;
if (!para->useGpu() || para->isStatic()) return;
Copy link
Contributor

Choose a reason for hiding this comment

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

Better to add detail comments here.

@@ -601,7 +601,7 @@ void TrainerThread::backward() {

void TrainerThread::backwardCallback(Parameter* para) {
// CPU parameters are merged in the end
if (!para->useGpu()) return;
if (!para->useGpu() || para->isStatic()) return;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

If the batch size for one thread is 0, all the parameters will call backwardCallback function to merge gradient in the line 593. But the static parameters which do not need to be updated should not call backwardCallback . So add a check here.

@qingqing01 qingqing01 merged commit 47a3d45 into PaddlePaddle:develop Jun 28, 2017
@qingqing01 qingqing01 deleted the data_feeder_debug branch July 7, 2017 13:34
heavengate pushed a commit to heavengate/Paddle that referenced this pull request Aug 16, 2021
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

4 participants