Skip to content

Commit a9badbc

Browse files
committed
Fix different time counting methods.
1 parent 83797fa commit a9badbc

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/meta_schedule/task_scheduler/gradient_based.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ class GradientBasedNode final : public TaskSchedulerNode {
131131
}
132132

133133
int NextTaskId() final {
134-
time_counter.start_timer("TaskScheduler::NextTaskId");
134+
time_counter.start_timer("GradientBasedTaskScheduler::NextTaskId");
135135
int n_tasks = task_records_.size();
136136
// Round robin
137137
if (num_rounds_already_ == 0) {
@@ -182,12 +182,12 @@ class GradientBasedNode final : public TaskSchedulerNode {
182182
if (tasks[task_id]->runner_futures.defined()) {
183183
JoinRunningTask(task_id);
184184
}
185-
time_counter.end_timer("TaskScheduler::NextTaskId");
185+
time_counter.end_timer("GradientBasedTaskScheduler::NextTaskId");
186186
return task_id;
187187
}
188188

189189
Array<RunnerResult> JoinRunningTask(int task_id) final {
190-
time_counter.start_timer("TaskScheduler::JoinRunningTask");
190+
time_counter.start_timer("GradientBasedTaskScheduler::JoinRunningTask");
191191
TaskRecord& record = task_records_[task_id];
192192
Array<RunnerResult> results = TaskSchedulerNode::JoinRunningTask(task_id);
193193
double& best_time_cost = this->best_time_cost_per_task_[task_id];
@@ -201,7 +201,7 @@ class GradientBasedNode final : public TaskSchedulerNode {
201201
TVM_PY_LOG(INFO, this->logging_func)
202202
<< "[Updated] Task #" << task_id << ": " << record.task->task_name << "\n"
203203
<< this->TuningStatistics();
204-
time_counter.end_timer("TaskScheduler::JoinRunningTask");
204+
time_counter.end_timer("GradientBasedTaskScheduler::JoinRunningTask");
205205
return results;
206206
}
207207
};

src/meta_schedule/task_scheduler/task_scheduler.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ void TaskSchedulerNode::InitializeTask(int task_id) {
123123
}
124124

125125
void TaskSchedulerNode::Tune() {
126-
time_counter.start_timer("TaskScheduler::Tune");
127126
int n_tasks = this->tasks.size();
128127
for (int task_id = 0; task_id < n_tasks; ++task_id) {
129128
InitializeTask(task_id);
@@ -166,7 +165,6 @@ void TaskSchedulerNode::Tune() {
166165
}
167166
task->search_strategy.value()->PostTuning();
168167
}
169-
time_counter.end_timer("TaskScheduler::Tune");
170168
}
171169

172170
void TaskSchedulerNode::TouchTask(int task_id) {
@@ -191,9 +189,11 @@ Array<RunnerResult> TaskSchedulerNode::JoinRunningTask(int task_id) {
191189
int n = futures.size();
192190
Array<RunnerResult> results;
193191
results.reserve(n);
192+
time_counter.start_timer("TaskScheduler::JoinRunningTask::future->Result");
194193
for (RunnerFuture future : futures) {
195194
results.push_back(future->Result());
196195
}
196+
time_counter.end_timer("TaskScheduler::JoinRunningTask::future->Result");
197197
task->search_strategy.value()->NotifyRunnerResults(task, task->measure_candidates.value(),
198198
results);
199199
// Invoke the callbacks

0 commit comments

Comments
 (0)