From f2168cef296ac180b3c451fb5e199446fb69b185 Mon Sep 17 00:00:00 2001 From: "M. Zeeshan Siddiqui" Date: Mon, 2 Nov 2020 07:05:28 -0800 Subject: [PATCH] Misc. cleanup. (#5659) Co-authored-by: Ubuntu --- onnxruntime/core/framework/execution_frame.cc | 2 +- onnxruntime/core/framework/mem_pattern_planner.h | 9 +++------ orttraining/tools/ci_test/run_convergence_test.py | 2 -- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/onnxruntime/core/framework/execution_frame.cc b/onnxruntime/core/framework/execution_frame.cc index 67a538393259c..6aaa3a756d536 100644 --- a/onnxruntime/core/framework/execution_frame.cc +++ b/onnxruntime/core/framework/execution_frame.cc @@ -292,7 +292,7 @@ ExecutionFrame::ExecutionFrame(const std::vector& feed_mlvalue_idxs, const } // log size of activation. Keep it commented out for now to avoid log flooding. - printf("\n **** Allocated memory for activations, size: %zu ***\n", mem_patterns_->patterns[i].PeakSize()); + VLOGS(session_state_.Logger(), 1) << "**** Allocated memory for activations, size: " <patterns[i].PeakSize(); } } } diff --git a/onnxruntime/core/framework/mem_pattern_planner.h b/onnxruntime/core/framework/mem_pattern_planner.h index cb57ae31d3f3f..a78b56d95fc4f 100644 --- a/onnxruntime/core/framework/mem_pattern_planner.h +++ b/onnxruntime/core/framework/mem_pattern_planner.h @@ -42,24 +42,21 @@ class MemPatternPlanner { size_t index_1 = 0; size_t index_2 = 0; - bool overlap = false; while ((index_1 < program_counter_start_1.size()) && (index_2 < program_counter_start_2.size())) { if (program_counter_start_1[index_1] <= program_counter_start_2[index_2]) { if (program_counter_end_1[index_1] >= program_counter_start_2[index_2]) { - overlap = true; - break; + return true; } index_1 += 1; } else { if (program_counter_end_2[index_2] >= program_counter_start_1[index_1]) { - overlap = true; - break; + return true; } index_2 += 1; } } - return overlap; + return false; } void TraceAllocation(int ml_value_idx, const std::vector& program_counter_start, const std::vector& program_counter_end, size_t size) { diff --git a/orttraining/tools/ci_test/run_convergence_test.py b/orttraining/tools/ci_test/run_convergence_test.py index 9b100d7fc2d3f..68528e2897ca6 100755 --- a/orttraining/tools/ci_test/run_convergence_test.py +++ b/orttraining/tools/ci_test/run_convergence_test.py @@ -31,8 +31,6 @@ def main(): # run BERT training subprocess.run([ - "/bert_ort/openmpi/bin/mpirun", - "-n", "2", os.path.join(args.binary_dir, "onnxruntime_training_bert"), "--model_name", os.path.join( args.model_root, "nv/bert-base/bert-base-uncased_L_12_H_768_A_12_V_30528_S_512_Dp_0.1_optimized_layer_norm_opset12"),