|
tvm
|
The database with customized methods on the python-side. More...
#include <database.h>
Public Types | |
| using | FHasWorkload = ffi::TypedFunction< bool(const IRModule &)> |
The function type of HasWorkload method. More... | |
| using | FCommitWorkload = ffi::TypedFunction< Workload(const IRModule &)> |
The function type of CommitWorkload method. More... | |
| using | FCommitTuningRecord = ffi::TypedFunction< void(const TuningRecord &)> |
The function type of CommitTuningRecord method. More... | |
| using | FGetTopK = ffi::TypedFunction< ffi::Array< TuningRecord >(const Workload &, int)> |
The function type of GetTopK method. More... | |
| using | FGetAllTuningRecords = ffi::TypedFunction< ffi::Array< TuningRecord >()> |
The function type of GetAllTuningRecords method. More... | |
| using | FQueryTuningRecord = ffi::TypedFunction< ffi::Optional< TuningRecord >(const IRModule &, const Target &, const ffi::String &)> |
The function type of QueryTuningRecord method. More... | |
| using | FQuerySchedule = ffi::TypedFunction< ffi::Optional< tir::Schedule >(const IRModule &, const Target &, const ffi::String &)> |
The function type of QuerySchedule method. More... | |
| using | FQueryIRModule = ffi::TypedFunction< ffi::Optional< IRModule >(const IRModule &, const Target &, const ffi::String &)> |
The function type of QueryIRModule method. More... | |
| using | FSize = ffi::TypedFunction< int64_t()> |
The function type of Size method. More... | |
Public Member Functions | |
| PyDatabaseNode (ffi::String mod_eq_name="structural") | |
| Constructor. More... | |
| 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... | |
| ffi::Array< TuningRecord > | GetTopK (const Workload &workload, int top_k) final |
| Get the top K valid tuning records of given workload from the database. More... | |
| ffi::Array< TuningRecord > | GetAllTuningRecords () final |
| Get all tuning records from the database. More... | |
| ffi::Optional< TuningRecord > | QueryTuningRecord (const IRModule &mod, const Target &target, const ffi::String &workload_name) final |
| Query the best record of the given workload from the database. More... | |
| ffi::Optional< tir::Schedule > | QuerySchedule (const IRModule &mod, const Target &target, const ffi::String &workload_name) final |
| Query the best schedule of the given workload from the database. More... | |
| ffi::Optional< IRModule > | QueryIRModule (const IRModule &mod, const Target &target, const ffi::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_FFI_DECLARE_OBJECT_INFO_FINAL ("meta_schedule.PyDatabase", PyDatabaseNode, DatabaseNode) | |
Public Member Functions inherited from tvm::meta_schedule::DatabaseNode | |
| DatabaseNode (ffi::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_FFI_DECLARE_OBJECT_INFO ("meta_schedule.Database", DatabaseNode, runtime::Object) | |
Static Public Member Functions | |
| static void | RegisterReflection () |
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 bool | _type_mutable = true |
Static Public Attributes inherited from tvm::meta_schedule::DatabaseNode | |
| static constexpr const bool | _type_mutable = true |
The database with customized methods on the python-side.
| using tvm::meta_schedule::PyDatabaseNode::FCommitTuningRecord = ffi::TypedFunction<void(const TuningRecord&)> |
The function type of CommitTuningRecord method.
| record | The tuning record to be added. |
| using tvm::meta_schedule::PyDatabaseNode::FCommitWorkload = ffi::TypedFunction<Workload(const IRModule&)> |
| using tvm::meta_schedule::PyDatabaseNode::FGetAllTuningRecords = ffi::TypedFunction<ffi::Array<TuningRecord>()> |
The function type of GetAllTuningRecords method.
| using tvm::meta_schedule::PyDatabaseNode::FGetTopK = ffi::TypedFunction<ffi::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 = ffi::TypedFunction<bool(const IRModule&)> |
The function type of HasWorkload method.
| mod | The IRModule to be searched for. |
| using tvm::meta_schedule::PyDatabaseNode::FQueryIRModule = ffi::TypedFunction<ffi::Optional<IRModule>(const IRModule&, const Target&, const ffi::String&)> |
| using tvm::meta_schedule::PyDatabaseNode::FQuerySchedule = ffi::TypedFunction<ffi::Optional<tir::Schedule>( const IRModule&, const Target&, const ffi::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 = ffi::TypedFunction<ffi::Optional<TuningRecord>( const IRModule&, const Target&, const ffi::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 = ffi::TypedFunction<int64_t()> |
The function type of Size method.
|
explicit |
Constructor.
| 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.
|
inlinestatic |
|
inlinefinalvirtual |
Get the size of the database.
Implements tvm::meta_schedule::DatabaseNode.
| tvm::meta_schedule::PyDatabaseNode::TVM_FFI_DECLARE_OBJECT_INFO_FINAL | ( | "meta_schedule.PyDatabase" | , |
| PyDatabaseNode | , | ||
| DatabaseNode | |||
| ) |
|
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.