Skip to content

Commit

Permalink
revert change in task_scheduler.cc
Browse files Browse the repository at this point in the history
  • Loading branch information
masahi committed Apr 10, 2022
1 parent 476129b commit d4b496d
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions src/meta_schedule/task_scheduler/task_scheduler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -128,18 +128,7 @@ void TaskSchedulerNode::Tune() {
ICHECK(!task->is_terminated);
ICHECK(!task->runner_futures.defined());
SearchStrategy strategy = task->search_strategy.value();
Optional<Array<MeasureCandidate>> candidates = strategy->GenerateMeasureCandidates();
if (candidates.defined()) {
// Filter out invalid candidates.
// An invalid candidate can arise due to a schdule application failure (e.g. tensorize).
Array<MeasureCandidate> valid_candidates;
for (MeasureCandidate candidate : candidates.value()) {
if (candidate.defined()) {
valid_candidates.push_back(candidate);
}
}

task->measure_candidates = std::move(valid_candidates);
if ((task->measure_candidates = strategy->GenerateMeasureCandidates()).defined()) {
num_trials_already += task->measure_candidates.value().size();
SendToBuilder(this->builder, task);
SendToRunner(this->runner, task);
Expand Down

0 comments on commit d4b496d

Please sign in to comment.