Skip to content

Commit 8383e48

Browse files
committed
Fix new remote updater sending all 0 param / grad to pserver
1 parent 238abc4 commit 8383e48

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

paddle/trainer/NewRemoteParameterUpdater.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,6 @@ void NewRemoteParameterUpdater::init(
4343
const std::vector<ParameterPtr> &parameters) {
4444
ParameterUpdater::init(parameters);
4545

46-
for (auto &para : parameters_) {
47-
para->getBuf(PARAMETER_VALUE)->zeroMem();
48-
para->getBuf(PARAMETER_GRADIENT)->zeroMem();
49-
}
50-
5146
// create parameter server client.
5247
if (useEtcd_) {
5348
parameterClient_ =
@@ -109,6 +104,8 @@ void NewRemoteParameterUpdater::init(
109104
LOG(ERROR) << "got unsupported v1 learning_rate_schedule config: "
110105
<< trainerConfig_.learning_rate_schedule() << ", set to const";
111106
optimizerConfigV2.set_lr_policy(paddle::OptimizerConfig::Const);
107+
optimizerConfigV2.mutable_const_lr()->set_learning_rate(
108+
trainerConfig_.learning_rate());
112109
}
113110

114111
// overwrite optimizerConfigV2 for per-parameter(layer) configs

0 commit comments

Comments
 (0)