@@ -56,8 +56,9 @@ class GraphExecutorDebug : public GraphExecutor {
5656 * By default, one `repeat` contains `number` runs. If this parameter is set,
5757 * the parameters `number` will be dynamically adjusted to meet the
5858 * minimum duration requirement of one `repeat`.
59- * \param max_repeat_ms The maximum number of repeats when measured time is equal to 0.
60- * It helps to avoid hanging during measurements.
59+ * \param limit_zero_time_iterations The maximum number of repeats when
60+ * measured time is equal to 0. It helps to avoid hanging during
61+ * measurements.
6162 * \param cooldown_interval_ms The cooldown interval in milliseconds between the number of repeats
6263 * defined by `repeats_to_cooldown`.
6364 * \param repeats_to_cooldown The number of repeats before the
@@ -66,23 +67,25 @@ class GraphExecutorDebug : public GraphExecutor {
6667 * representing the number of layers. Next the encoded real numbers are float32_t in the number of
6768 * repeat multiplied by the number of layers.
6869 */
69- std::string RunIndividual (int number, int repeat, int min_repeat_ms, int max_repeat_num,
70- int cooldown_interval_ms, int repeats_to_cooldown) {
70+ std::string RunIndividual (int number, int repeat, int min_repeat_ms,
71+ int limit_zero_time_iterations, int cooldown_interval_ms,
72+ int repeats_to_cooldown) {
7173 // warmup run
7274 GraphExecutor::Run ();
7375 std::string tkey = module_->type_key ();
7476 std::vector<std::vector<double >> time_sec_per_op (op_execs_.size ());
7577 if (tkey == " rpc" ) {
7678 // RPC modules rely on remote timing which implements the logic from the else branch.
7779 for (size_t index = 0 ; index < op_execs_.size (); ++index) {
78- time_sec_per_op[index] = RunOpRPC (index, number, repeat, min_repeat_ms, max_repeat_num,
79- cooldown_interval_ms, repeats_to_cooldown);
80+ time_sec_per_op[index] =
81+ RunOpRPC (index, number, repeat, min_repeat_ms, limit_zero_time_iterations,
82+ cooldown_interval_ms, repeats_to_cooldown);
8083 }
8184 } else {
8285 int op = 0 ;
8386 for (size_t index = 0 ; index < op_execs_.size (); ++index) {
8487 std::string result_str =
85- RunIndividualNode (index, number, repeat, min_repeat_ms, max_repeat_num ,
88+ RunIndividualNode (index, number, repeat, min_repeat_ms, limit_zero_time_iterations ,
8689 cooldown_interval_ms, repeats_to_cooldown);
8790 const double * blob_ptr = reinterpret_cast <const double *>(result_str.data ());
8891 for (int i = 0 ; i < repeat; ++i, ++blob_ptr) {
@@ -113,7 +116,7 @@ class GraphExecutorDebug : public GraphExecutor {
113116 }
114117
115118 std::string RunIndividualNode (int node_index, int number, int repeat, int min_repeat_ms,
116- int max_repeat_num , int cooldown_interval_ms,
119+ int limit_zero_time_iterations , int cooldown_interval_ms,
117120 int repeats_to_cooldown) {
118121 std::string tkey = module_->type_key ();
119122
@@ -135,12 +138,13 @@ class GraphExecutorDebug : public GraphExecutor {
135138 Device& d = devices_[0 ];
136139 PackedFunc time_evaluator = profiling::WrapTimeEvaluator (
137140 TypedPackedFunc<void ()>([this , node_index]() { this ->RunOpHost (node_index); }), d, number,
138- repeat, min_repeat_ms, max_repeat_num, cooldown_interval_ms, repeats_to_cooldown);
141+ repeat, min_repeat_ms, limit_zero_time_iterations, cooldown_interval_ms,
142+ repeats_to_cooldown);
139143 return time_evaluator ();
140144 }
141145
142146 std::vector<double > RunOpRPC (int index, int number, int repeat, int min_repeat_ms,
143- int max_repeat_num , int cooldown_interval_ms,
147+ int limit_zero_time_iterations , int cooldown_interval_ms,
144148 int repeats_to_cooldown) {
145149 std::vector<double > results (repeat, 0 );
146150 // Right now we expect either "tvm_op" for nodes which run PackedFunc or "null" for nodes
@@ -167,7 +171,7 @@ class GraphExecutorDebug : public GraphExecutor {
167171 runtime::Registry::Get (" runtime.RPCTimeEvaluator" )
168172 ->
169173 operator ()(module_, name, static_cast <int >(dev.device_type ), dev.device_id , number,
170- repeat, min_repeat_ms, max_repeat_num , cooldown_interval_ms,
174+ repeat, min_repeat_ms, limit_zero_time_iterations , cooldown_interval_ms,
171175 repeats_to_cooldown, " " );
172176
173177 int num_flat_args = num_inputs + num_outputs;
@@ -391,17 +395,18 @@ PackedFunc GraphExecutorDebug::GetFunction(const std::string& name,
391395 int number = args[0 ];
392396 int repeat = args[1 ];
393397 int min_repeat_ms = args[2 ];
394- int max_repeat_num = args[3 ];
398+ int limit_zero_time_iterations = args[3 ];
395399 int cooldown_interval_ms = args[4 ];
396400 int repeats_to_cooldown = args[5 ];
397401 ICHECK_GT (number, 0 );
398402 ICHECK_GT (repeat, 0 );
399403 ICHECK_GE (min_repeat_ms, 0 );
400- ICHECK_GE (max_repeat_num , 0 );
404+ ICHECK_GE (limit_zero_time_iterations , 0 );
401405 ICHECK_GE (cooldown_interval_ms, 0 );
402406 ICHECK_GT (repeats_to_cooldown, 0 );
403- std::string blob = this ->RunIndividual (number, repeat, min_repeat_ms, max_repeat_num,
404- cooldown_interval_ms, repeats_to_cooldown);
407+ std::string blob =
408+ this ->RunIndividual (number, repeat, min_repeat_ms, limit_zero_time_iterations,
409+ cooldown_interval_ms, repeats_to_cooldown);
405410 TVMByteArray arr;
406411 arr.size = blob.length ();
407412 arr.data = blob.data ();
@@ -413,20 +418,20 @@ PackedFunc GraphExecutorDebug::GetFunction(const std::string& name,
413418 int number = args[1 ];
414419 int repeat = args[2 ];
415420 int min_repeat_ms = args[3 ];
416- int max_repeat_num = args[4 ];
421+ int limit_zero_time_iterations = args[4 ];
417422 int cooldown_interval_ms = args[5 ];
418423 int repeats_to_cooldown = args[6 ];
419424 ICHECK_GE (node_index, 0 );
420425 ICHECK_LT (node_index, nodes_.size ());
421426 ICHECK_GT (number, 0 );
422427 ICHECK_GT (repeat, 0 );
423428 ICHECK_GE (min_repeat_ms, 0 );
424- ICHECK_GE (max_repeat_num , 0 );
429+ ICHECK_GE (limit_zero_time_iterations , 0 );
425430 ICHECK_GE (cooldown_interval_ms, 0 );
426431 ICHECK_GT (repeats_to_cooldown, 0 );
427- std::string blob =
428- this -> RunIndividualNode (node_index, number, repeat, min_repeat_ms, max_repeat_num ,
429- cooldown_interval_ms, repeats_to_cooldown);
432+ std::string blob = this -> RunIndividualNode (node_index, number, repeat, min_repeat_ms,
433+ limit_zero_time_iterations, cooldown_interval_ms ,
434+ repeats_to_cooldown);
430435 TVMByteArray arr;
431436 arr.size = blob.length ();
432437 arr.data = blob.data ();
0 commit comments