Skip to content

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.

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.

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.

4 participants