Skip to content

Commit

Permalink
Added missing mutexes around tensor table during auto-tuning (#906)
Browse files Browse the repository at this point in the history
  • Loading branch information
tgaddair committed Mar 12, 2019
1 parent 44bb0b5 commit 088db5a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions horovod/common/operations.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1210,6 +1210,7 @@ bool RunLoopOnce(HorovodGlobalState& state, MPIContext& ctx, bool is_coordinator
std::vector<std::string> tensor_names;
int64_t total_tensor_size = 0;
if (state.param_manager.IsAutoTuning()) {
std::lock_guard<std::mutex> guard(state.mutex);
for (auto& response : response_list.responses()) {
if (response.response_type() == Response::ResponseType::ALLREDUCE) {
for (auto& tensor_name : response.tensor_names()) {
Expand Down Expand Up @@ -1268,6 +1269,7 @@ bool RunLoopOnce(HorovodGlobalState& state, MPIContext& ctx, bool is_coordinator
std::vector<std::string> tensor_names;
int64_t total_tensor_size = 0;
if (state.param_manager.IsAutoTuning()) {
std::lock_guard<std::mutex> guard(state.mutex);
for (auto& response : response_list.responses()) {
if (response.response_type() == Response::ResponseType::ALLREDUCE) {
for (auto& tensor_name : response.tensor_names()) {
Expand Down

0 comments on commit 088db5a

Please sign in to comment.