jcf94 commented on a change in pull request #7197: URL: https://github.com/apache/tvm/pull/7197#discussion_r551206249
########## File path: src/auto_scheduler/feature.cc ########## @@ -1462,12 +1462,18 @@ void GetPerStoreFeaturesFromMeasurePairs(const Array<MeasureInput>& inputs, if (find_res == task_cache.end()) { if (inputs[i]->task->compute_dag.defined()) { // the measure input is complete task = inputs[i]->task; - } else { // the measure input is incomplete - // rebuild task for incomplete measure pairs read from file - Array<te::Tensor> tensors = (*workload_key_to_tensors)(workload_key); - task = SearchTask(ComputeDAG(tensors), workload_key, inputs[i]->task->target, - inputs[i]->task->target_host, inputs[i]->task->hardware_params, - inputs[i]->task->layout_rewrite_option); + } else { + // The measure input is incomplete, rebuild task for incomplete measure pairs read from file + try { + Array<te::Tensor> tensors = (*workload_key_to_tensors)(workload_key); + task = SearchTask(ComputeDAG(tensors), workload_key, inputs[i]->task->target, + inputs[i]->task->target_host, inputs[i]->task->hardware_params, + inputs[i]->task->layout_rewrite_option); + } catch (std::exception& e) { + // Cannot build ComputeDAG from workload key, the task may have not been registered in + // this search round + continue; Review comment: Emm ... I think this should be fine here. For example, I have a `log.json` which contains 100 tasks, and I would like to only tune the last 10 tasks next time. Without this `try ... catch`, we'll get error in reading the first 90 tasks because they have not been registered. And this modification just makes it works without loading the log of the first 90 tasks. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org