Result¶
Tuning result of auto_scheduler dialect.
- class lorien.dialect.tvm_dial.auto_scheduler_dial.result.AutoSchedulerRecords(target_key: str, workload_key: Optional[str] = None)¶
The container to maintain the records of an auto_scheduler task.
- static decode(record_str: str) Tuple[tvm.auto_scheduler.measure.MeasureInput, tvm.auto_scheduler.measure.MeasureResult] ¶
Decode a string to a record.
- static encode(record: Tuple[tvm.auto_scheduler.measure.MeasureInput, tvm.auto_scheduler.measure.MeasureResult]) str ¶
Encode a record to a string.
- static gen_record_item(record: Tuple[tvm.auto_scheduler.measure.MeasureInput, tvm.auto_scheduler.measure.MeasureResult])¶
Generate an item for a record that can be appended to the task item.
- gen_task_item() Dict[str, Any] ¶
No additional attribute is required for auto_scheduler.
- peak() Tuple[tvm.auto_scheduler.measure.MeasureInput, tvm.auto_scheduler.measure.MeasureResult] ¶
Peak the first record.
- pop() Tuple[tvm.auto_scheduler.measure.MeasureInput, tvm.auto_scheduler.measure.MeasureResult] ¶
Pop the worst record in the container and remove the cost.
- push(record: Tuple[tvm.auto_scheduler.measure.MeasureInput, tvm.auto_scheduler.measure.MeasureResult])¶
Push a new record.
- Parameters
record (Any) -- The record to be pushed.
- to_list(nbest: int = - 1) List[Tuple[tvm.auto_scheduler.measure.MeasureInput, tvm.auto_scheduler.measure.MeasureResult]] ¶
Sort the record (of any layout) to be a list and return the best N.
- Parameters
nbest (int) -- The best N records to be returned. Default to return all.
- Returns
records -- The sorted list of records.
- Return type
List[Tuple[MeasureInput, MeasureResult]]
- class lorien.dialect.tvm_dial.auto_scheduler_dial.result.AutoSchedulerTuneResult¶
The result of a tuning job.
- static create_records_by_workloads(log_file_path: str, nbest: int, workload: Optional[lorien.workload.Workload] = None) Sequence[lorien.dialect.tvm_dial.auto_scheduler_dial.result.AutoSchedulerRecords] ¶
Parse records from the tuning log and group them by workloads.
- Parameters
log_file_path (str) -- The log file path.
nbest (int) -- The maximum number of best records to be kept.
workload (Optional[Workload]) -- The target workload. If presented, the returnede map will only have one entry.
- Returns
records -- A list of created records.
- Return type
Sequence[AutoSchedulerRecords]
- static gen_features(log_file_path: str, out_path: str)¶
Featurize tuning logs to be input features of the performance cost model.
- Parameters
log_file_path (str) -- The log file path. It can be a file path for a single file, or a directory of several log files.
out_path (str) -- The path to write generated features and artifacts.