mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-30 20:18:08 +00:00
pipeline_worker_pool_.JoinAll() should be called in pipeline code path (#5604)
Co-authored-by: Weixing Zhang <wezhan@microsoft.com>
This commit is contained in:
parent
6f824c25e5
commit
b851973f22
1 changed files with 3 additions and 8 deletions
|
|
@ -628,13 +628,6 @@ void TrainingRunner::RunWithUpdate(VectorString& feed_names,
|
|||
}
|
||||
}
|
||||
|
||||
// Wait all workers to finish this around of pipeline parallism.
|
||||
// The last batch in a pipeline collects gradient and update the model.
|
||||
pipeline_worker_pool_.JoinAll();
|
||||
for (auto& status : pipeline_worker_pool_.worker_states) {
|
||||
CheckWorkerException(status.execution_exception);
|
||||
}
|
||||
|
||||
// TODO: move this to an operator in graph.
|
||||
onnxruntime::contrib::OrtEventPool::GetInstance().ResetAllEvents();
|
||||
|
||||
|
|
@ -905,7 +898,9 @@ Status TrainingRunner::TrainingLoop(IDataLoader& training_data_loader, IDataLoad
|
|||
}
|
||||
} // end of one file/shard
|
||||
|
||||
pipeline_worker_pool_.JoinAll();
|
||||
if (params_.pipeline_parallel_size > 1) {
|
||||
pipeline_worker_pool_.JoinAll();
|
||||
}
|
||||
if (step_ < params_.num_train_steps) {
|
||||
training_data_loader.MoveToNextDataSet();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue