Skip to content

Commit

Permalink
Fix MultiGPU hangs when interrupting training
Browse files Browse the repository at this point in the history
  • Loading branch information
weiliu89 committed Aug 5, 2017
1 parent 7ad1342 commit feb5038
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/caffe/parallel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -354,11 +354,12 @@ void NCCL<Dtype>::Run(const vector<int>& gpus, const char* restore) {
// Run first solver on current thread
Broadcast();
solver_->Solve();
barrier.wait(); // Hangs without it when running tests
// Wait for shutdown
for (int i = 1; i < gpus.size(); ++i) {
workers[i]->StopInternalThread();
}
// Hangs without it when running tests or multi-gpu training.
barrier.wait();
}

INSTANTIATE_CLASS(Params);
Expand Down

0 comments on commit feb5038

Please sign in to comment.