tvm
Public Types | Public Member Functions | Public Attributes | Static Public Attributes | List of all members
tvm::meta_schedule::PyDatabaseNode Class Reference

The database with customized methods on the python-side. More...

#include <database.h>

Inheritance diagram for tvm::meta_schedule::PyDatabaseNode:
Collaboration diagram for tvm::meta_schedule::PyDatabaseNode:

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 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

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< TuningRecordGetTopK (const Workload &workload, int top_k) final
 Get the top K tuning records of given workload from the database. More...
 
Array< TuningRecordGetAllTuningRecords () final
 Get all tuning records 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
virtual ~DatabaseNode ()=default
 Default destructor. 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)
 
Objectoperator= (const Object &other)
 
Objectoperator= (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...
 
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...
 

Detailed Description

The database with customized methods on the python-side.

Member Typedef Documentation

◆ FCommitTuningRecord

The function type of CommitTuningRecord method.

Parameters
recordThe tuning record to be added.

◆ FCommitWorkload

The function type of CommitWorkload method.

Parameters
modThe IRModule to be searched for or added.
Returns
The workload corresponding to the given IRModule.

◆ FGetAllTuningRecords

The function type of GetAllTuningRecords method.

Returns
An Array of all the tuning records in the database.

◆ FGetTopK

The function type of GetTopK method.

Parameters
workloadThe workload to be searched for.
top_kThe number of top records to be returned.
Returns
An array of top K tuning records for the given workload.

◆ FHasWorkload

The function type of HasWorkload method.

Parameters
modThe IRModule to be searched for.
Returns
Whether the database has the given workload.

◆ FSize

The function type of Size method.

Returns
The size of the database.

Member Function Documentation

◆ CommitTuningRecord()

void tvm::meta_schedule::PyDatabaseNode::CommitTuningRecord ( const TuningRecord record)
inlinefinalvirtual

Add a tuning record to the database.

Parameters
recordThe tuning record to be added.

Implements tvm::meta_schedule::DatabaseNode.

◆ CommitWorkload()

Workload tvm::meta_schedule::PyDatabaseNode::CommitWorkload ( const IRModule mod)
inlinefinalvirtual

Look up or add workload to the database if missing.

Parameters
modThe IRModule to be searched for or added.
Returns
The workload corresponding to the given IRModule.

Implements tvm::meta_schedule::DatabaseNode.

◆ GetAllTuningRecords()

Array<TuningRecord> tvm::meta_schedule::PyDatabaseNode::GetAllTuningRecords ( )
inlinefinalvirtual

Get all tuning records from the database.

Returns
An Array of all the tuning records in the database.

Implements tvm::meta_schedule::DatabaseNode.

◆ GetTopK()

Array<TuningRecord> tvm::meta_schedule::PyDatabaseNode::GetTopK ( const Workload workload,
int  top_k 
)
inlinefinalvirtual

Get the top K tuning records of given workload from the database.

Parameters
workloadThe workload to be searched for.
top_kThe number of top records to be returned.
Returns
An array of top K tuning records for the given workload.

Implements tvm::meta_schedule::DatabaseNode.

◆ HasWorkload()

bool tvm::meta_schedule::PyDatabaseNode::HasWorkload ( const IRModule mod)
inlinefinalvirtual

Check if the database has the given workload.

Parameters
modThe IRModule to be searched for.
Returns
Whether the database has the given workload.

Implements tvm::meta_schedule::DatabaseNode.

◆ Size()

int64_t tvm::meta_schedule::PyDatabaseNode::Size ( )
inlinefinalvirtual

Get the size of the database.

Returns
The size of the database.

Implements tvm::meta_schedule::DatabaseNode.

◆ TVM_DECLARE_FINAL_OBJECT_INFO()

tvm::meta_schedule::PyDatabaseNode::TVM_DECLARE_FINAL_OBJECT_INFO ( PyDatabaseNode  ,
DatabaseNode   
)

◆ VisitAttrs()

void tvm::meta_schedule::PyDatabaseNode::VisitAttrs ( tvm::AttrVisitor v)
inline

Member Data Documentation

◆ _type_key

constexpr const char* tvm::meta_schedule::PyDatabaseNode::_type_key = "meta_schedule.PyDatabase"
static

◆ f_commit_tuning_record

FCommitTuningRecord tvm::meta_schedule::PyDatabaseNode::f_commit_tuning_record

The packed function to the CommitTuningRecord function.

◆ f_commit_workload

FCommitWorkload tvm::meta_schedule::PyDatabaseNode::f_commit_workload

The packed function to the CommitWorkload function.

◆ f_get_all_tuning_records

FGetAllTuningRecords tvm::meta_schedule::PyDatabaseNode::f_get_all_tuning_records

The packed function to the GetAllTuningRecords function.

◆ f_get_top_k

FGetTopK tvm::meta_schedule::PyDatabaseNode::f_get_top_k

The packed function to the GetTopK function.

◆ f_has_workload

FHasWorkload tvm::meta_schedule::PyDatabaseNode::f_has_workload

The packed function to the HasWorkload function.

◆ f_size

FSize tvm::meta_schedule::PyDatabaseNode::f_size

The packed function to the Size function.


The documentation for this class was generated from the following file: