Skip to content

Commit 8fe4a33

Browse files
committed
bug fix for multi cpu machine training
ISSUE=4602845 git-svn-id: https://svn.baidu.com/idl/trunk/paddle@1448 1ad973e4-5ce8-4261-8a94-b56d1f490c56
1 parent 66be6fe commit 8fe4a33

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

paddle/trainer/RemoteParameterUpdater.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ void ConcurrentRemoteParameterUpdater::recv(Parameter* para) {
467467
}
468468

469469
void ConcurrentRemoteParameterUpdater::recv() {
470-
hl_set_device(FLAGS_gpu_id);
470+
if (FLAGS_use_gpu) hl_set_device(FLAGS_gpu_id);
471471
StatPtr stat = getStat("recv");
472472
FOR_TIMING(Timer timer);
473473
while (true) {
@@ -496,7 +496,7 @@ void ConcurrentRemoteParameterUpdater::recv() {
496496
}
497497

498498
void ConcurrentRemoteParameterUpdater::send() {
499-
hl_set_device(FLAGS_gpu_id);
499+
if (FLAGS_use_gpu) hl_set_device(FLAGS_gpu_id);
500500
StatPtr stat = getStat("send");
501501
FOR_TIMING(Timer timer);
502502
while (true) {

0 commit comments

Comments
 (0)