Result

Tuning records of TVM dialect.

class lorien.dialect.tvm_dial.result.TVMRecords(target_key: str, alter_key: Optional[str] = None, workload_key: Optional[str] = None)

The container to maintain the records of a tuning task.

static decode(record_str: str) TVMRecordType

Decode a string to a record.

static encode(record: TVMRecordType) str

Encode a record to a string.

static gen_record_item(record: TVMRecordType)

Generate an item for a record that can be appended to the task item.

gen_task_item() Dict[str, Any]

Generate an item that can be committed to the database. Note that since all records in this container should be for the same task, they should be in the same task item.

get_framework_build_config() Optional[Dict[str, str]]

Get the framework build configurations that generate these records. If None, then the committed records will not have this information.

peak() TVMRecordType

Peak the first record.

pop() TVMRecordType

Pop the worst record in the container.

push(record: TVMRecordType)

Push a new record.

Parameters

record (Any) -- The record to be pushed.

to_list(nbest: int = - 1) List[TVMRecordType]

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[RecordType]