tvm
|
The database with customized methods on the python-side. More...
#include <database.h>
Public Types | |
using | FHasWorkload = runtime::TypedPackedFunc< bool(const IRModule &)> |
The function type of HasWorkload method. More... | |
using | FCommitWorkload = runtime::TypedPackedFunc< Workload(const IRModule &)> |
The function type of CommitWorkload method. More... | |
using | FCommitTuningRecord = runtime::TypedPackedFunc< void(const TuningRecord &)> |
The function type of CommitTuningRecord method. More... | |
using | FGetTopK = runtime::TypedPackedFunc< Array< TuningRecord >(const Workload &, int)> |
The function type of GetTopK method. More... | |
using | FGetAllTuningRecords = runtime::TypedPackedFunc< Array< TuningRecord >()> |
The function type of GetAllTuningRecords method. More... | |
using | FQueryTuningRecord = runtime::TypedPackedFunc< Optional< TuningRecord >(const IRModule &, const Target &, const String &)> |
The function type of QueryTuningRecord method. More... | |
using | FQuerySchedule = runtime::TypedPackedFunc< Optional< tir::Schedule >(const IRModule &, const Target &, const String &)> |
The function type of QuerySchedule method. More... | |
using | FQueryIRModule = runtime::TypedPackedFunc< Optional< IRModule >(const IRModule &, const Target &, const String &)> |
The function type of QueryIRModule method. More... | |
using | FSize = runtime::TypedPackedFunc< int64_t()> |
The function type of Size method. More... | |
Public Types inherited from tvm::runtime::Object | |
typedef void(* | FDeleter) (Object *self) |
Object deleter. More... | |
using | RefCounterType = std::atomic< int32_t > |
Public Member Functions | |
PyDatabaseNode (String mod_eq_name="structural") | |
Constructor. More... | |
void | VisitAttrs (tvm::AttrVisitor *v) |
bool | HasWorkload (const IRModule &mod) final |
Check if the database has the given workload. More... | |
Workload | CommitWorkload (const IRModule &mod) final |
Look up or add workload to the database if missing. More... | |
void | CommitTuningRecord (const TuningRecord &record) final |
Add a tuning record to the database. More... | |
Array< TuningRecord > | GetTopK (const Workload &workload, int top_k) final |
Get the top K valid tuning records of given workload from the database. More... | |
Array< TuningRecord > | GetAllTuningRecords () final |
Get all tuning records from the database. More... | |
Optional< TuningRecord > | QueryTuningRecord (const IRModule &mod, const Target &target, const String &workload_name) final |
Query the best record of the given workload from the database. More... | |
Optional< tir::Schedule > | QuerySchedule (const IRModule &mod, const Target &target, const String &workload_name) final |
Query the best schedule of the given workload from the database. More... | |
Optional< IRModule > | QueryIRModule (const IRModule &mod, const Target &target, const String &workload_name) final |
Query the best IRModule of the given workload from the database. More... | |
int64_t | Size () final |
Get the size of the database. More... | |
TVM_DECLARE_FINAL_OBJECT_INFO (PyDatabaseNode, DatabaseNode) | |
Public Member Functions inherited from tvm::meta_schedule::DatabaseNode | |
DatabaseNode (String mod_eq_name="structural") | |
Constructor. More... | |
virtual | ~DatabaseNode () |
Default destructor. More... | |
void | DumpPruned (Database destination) |
Prune the database and dump it a given database. More... | |
const ModuleEquality & | GetModuleEquality () const |
Return a reference to the owned module equality method instance. More... | |
TVM_DECLARE_BASE_OBJECT_INFO (DatabaseNode, runtime::Object) | |
Public Member Functions inherited from tvm::runtime::Object | |
uint32_t | type_index () const |
std::string | GetTypeKey () const |
size_t | GetTypeKeyHash () const |
template<typename TargetType > | |
bool | IsInstance () const |
bool | unique () const |
Object () | |
Object (const Object &other) | |
Object (Object &&other) | |
Object & | operator= (const Object &other) |
Object & | operator= (Object &&other) |
Public Attributes | |
FHasWorkload | f_has_workload |
The packed function to the HasWorkload function. More... | |
FCommitWorkload | f_commit_workload |
The packed function to the CommitWorkload function. More... | |
FCommitTuningRecord | f_commit_tuning_record |
The packed function to the CommitTuningRecord function. More... | |
FGetTopK | f_get_top_k |
The packed function to the GetTopK function. More... | |
FGetAllTuningRecords | f_get_all_tuning_records |
The packed function to the GetAllTuningRecords function. More... | |
FQueryTuningRecord | f_query_tuning_record |
The packed function to the QueryTuningRecord function. More... | |
FQuerySchedule | f_query_schedule |
The packed function to the QuerySchedule function. More... | |
FQueryIRModule | f_query_ir_module |
The packed function to the QueryIRModule function. More... | |
FSize | f_size |
The packed function to the Size function. More... | |
Static Public Attributes | |
static constexpr const char * | _type_key = "meta_schedule.PyDatabase" |
Static Public Attributes inherited from tvm::meta_schedule::DatabaseNode | |
static constexpr const char * | _type_key = "meta_schedule.Database" |
Static Public Attributes inherited from tvm::runtime::Object | |
static constexpr const char * | _type_key = "runtime.Object" |
static constexpr bool | _type_final = false |
static constexpr uint32_t | _type_child_slots = 0 |
static constexpr bool | _type_child_slots_can_overflow = true |
static constexpr bool | _type_has_method_visit_attrs = true |
static constexpr bool | _type_has_method_sequal_reduce = false |
static constexpr bool | _type_has_method_shash_reduce = false |
static constexpr uint32_t | _type_index = TypeIndex::kDynamic |
Additional Inherited Members | |
Static Public Member Functions inherited from tvm::runtime::Object | |
static std::string | TypeIndex2Key (uint32_t tindex) |
Get the type key of the corresponding index from runtime. More... | |
static size_t | TypeIndex2KeyHash (uint32_t tindex) |
Get the type key hash of the corresponding index from runtime. More... | |
static uint32_t | TypeKey2Index (const std::string &key) |
Get the type index of the corresponding key from runtime. More... | |
static uint32_t | _GetOrAllocRuntimeTypeIndex () |
static uint32_t | RuntimeTypeIndex () |
Protected Member Functions inherited from tvm::runtime::Object | |
void | IncRef () |
developer function, increases reference counter. More... | |
void | DecRef () |
developer function, decrease reference counter. More... | |
Static Protected Member Functions inherited from tvm::runtime::Object | |
static uint32_t | GetOrAllocRuntimeTypeIndex (const std::string &key, uint32_t static_tindex, uint32_t parent_tindex, uint32_t type_child_slots, bool type_child_slots_can_overflow) |
Get the type index using type key. More... | |
Protected Attributes inherited from tvm::runtime::Object | |
uint32_t | type_index_ {0} |
Type index(tag) that indicates the type of the object. More... | |
RefCounterType | ref_counter_ {0} |
The internal reference counter. More... | |
FDeleter | deleter_ = nullptr |
deleter of this object to enable customized allocation. If the deleter is nullptr, no deletion will be performed. The creator of the object must always set the deleter field properly. More... | |
The database with customized methods on the python-side.
using tvm::meta_schedule::PyDatabaseNode::FCommitTuningRecord = runtime::TypedPackedFunc<void(const TuningRecord&)> |
The function type of CommitTuningRecord
method.
record | The tuning record to be added. |
using tvm::meta_schedule::PyDatabaseNode::FGetAllTuningRecords = runtime::TypedPackedFunc<Array<TuningRecord>()> |
The function type of GetAllTuningRecords
method.
using tvm::meta_schedule::PyDatabaseNode::FGetTopK = runtime::TypedPackedFunc<Array<TuningRecord>(const Workload&, int)> |
The function type of GetTopK
method.
workload | The workload to be searched for. |
top_k | The number of top records to be returned. |
using tvm::meta_schedule::PyDatabaseNode::FHasWorkload = runtime::TypedPackedFunc<bool(const IRModule&)> |
The function type of HasWorkload
method.
mod | The IRModule to be searched for. |
using tvm::meta_schedule::PyDatabaseNode::FQueryIRModule = runtime::TypedPackedFunc<Optional<IRModule>(const IRModule&, const Target&, const String&)> |
using tvm::meta_schedule::PyDatabaseNode::FQuerySchedule = runtime::TypedPackedFunc<Optional<tir::Schedule>( const IRModule&, const Target&, const String&)> |
The function type of QuerySchedule
method.
mod | The IRModule to be searched for. |
target | The target to be searched for. |
workload_name | The name of the workload to be searched for. |
using tvm::meta_schedule::PyDatabaseNode::FQueryTuningRecord = runtime::TypedPackedFunc<Optional<TuningRecord>( const IRModule&, const Target&, const String&)> |
The function type of QueryTuningRecord
method.
mod | The IRModule to be searched for. |
target | The target to be searched for. |
workload_name | The name of the workload to be searched for. |
using tvm::meta_schedule::PyDatabaseNode::FSize = runtime::TypedPackedFunc<int64_t()> |
The function type of Size
method.
|
explicit |
mod_eq_name | A string to specify the module equality testing and hashing method. It must be one of the followings:
|
|
inlinefinalvirtual |
Add a tuning record to the database.
record | The tuning record to be added. |
Implements tvm::meta_schedule::DatabaseNode.
|
inlinefinalvirtual |
Look up or add workload to the database if missing.
mod | The IRModule to be searched for or added. |
Implements tvm::meta_schedule::DatabaseNode.
|
inlinefinalvirtual |
Get all tuning records from the database.
Implements tvm::meta_schedule::DatabaseNode.
|
inlinefinalvirtual |
Get the top K valid tuning records of given workload from the database.
workload | The workload to be searched for. |
top_k | The number of top records to be returned. |
Implements tvm::meta_schedule::DatabaseNode.
|
inlinefinalvirtual |
Check if the database has the given workload.
mod | The IRModule to be searched for. |
Implements tvm::meta_schedule::DatabaseNode.
|
inlinefinalvirtual |
Query the best IRModule of the given workload from the database.
mod | The IRModule to be searched for. |
target | The target to be searched for. |
workload_name | The name of the workload to be searched for. |
Reimplemented from tvm::meta_schedule::DatabaseNode.
|
inlinefinalvirtual |
Query the best schedule of the given workload from the database.
mod | The IRModule to be searched for. |
target | The target to be searched for. |
workload_name | The name of the workload to be searched for. |
Reimplemented from tvm::meta_schedule::DatabaseNode.
|
inlinefinalvirtual |
Query the best record of the given workload from the database.
mod | The IRModule to be searched for. |
target | The target to be searched for. |
workload_name | The name of the workload to be searched for. |
Reimplemented from tvm::meta_schedule::DatabaseNode.
|
inlinefinalvirtual |
Get the size of the database.
Implements tvm::meta_schedule::DatabaseNode.
tvm::meta_schedule::PyDatabaseNode::TVM_DECLARE_FINAL_OBJECT_INFO | ( | PyDatabaseNode | , |
DatabaseNode | |||
) |
|
inline |
|
staticconstexpr |
FCommitTuningRecord tvm::meta_schedule::PyDatabaseNode::f_commit_tuning_record |
The packed function to the CommitTuningRecord
function.
FCommitWorkload tvm::meta_schedule::PyDatabaseNode::f_commit_workload |
The packed function to the CommitWorkload
function.
FGetAllTuningRecords tvm::meta_schedule::PyDatabaseNode::f_get_all_tuning_records |
The packed function to the GetAllTuningRecords
function.
FGetTopK tvm::meta_schedule::PyDatabaseNode::f_get_top_k |
The packed function to the GetTopK
function.
FHasWorkload tvm::meta_schedule::PyDatabaseNode::f_has_workload |
The packed function to the HasWorkload
function.
FQueryIRModule tvm::meta_schedule::PyDatabaseNode::f_query_ir_module |
The packed function to the QueryIRModule
function.
FQuerySchedule tvm::meta_schedule::PyDatabaseNode::f_query_schedule |
The packed function to the QuerySchedule
function.
FQueryTuningRecord tvm::meta_schedule::PyDatabaseNode::f_query_tuning_record |
The packed function to the QueryTuningRecord
function.
FSize tvm::meta_schedule::PyDatabaseNode::f_size |
The packed function to the Size
function.