tvm
|
The cost model with customized methods on the python-side. More...
#include <cost_model.h>
Public Types | |
using | FLoad = ffi::TypedFunction< void(String)> |
Load the cost model from given file location. More... | |
using | FSave = ffi::TypedFunction< void(String)> |
Save the cost model to given file location. More... | |
using | FUpdate = ffi::TypedFunction< void(const TuneContext &, const Array< MeasureCandidate > &, const Array< RunnerResult > &)> |
Update the cost model given running results. More... | |
using | FPredict = ffi::TypedFunction< void(const TuneContext &, const Array< MeasureCandidate > &, void *p_addr)> |
Predict the running results of given measure candidates. More... | |
using | FAsString = ffi::TypedFunction< String()> |
Get the cost model as string with name. More... | |
Public Member Functions | |
void | Load (const String &path) |
Load the cost model from given file location. More... | |
void | Save (const String &path) |
Save the cost model to given file location. More... | |
void | Update (const TuneContext &context, const Array< MeasureCandidate > &candidates, const Array< RunnerResult > &results) |
Update the cost model given running results. More... | |
std::vector< double > | Predict (const TuneContext &context, const Array< MeasureCandidate > &candidates) |
Predict the normalized score (the larger the better) of given measure candidates. More... | |
TVM_DECLARE_FINAL_OBJECT_INFO (PyCostModelNode, CostModelNode) | |
![]() | |
virtual | ~CostModelNode ()=default |
Virtual destructor. More... | |
TVM_DECLARE_BASE_OBJECT_INFO (CostModelNode, Object) | |
Public Attributes | |
FLoad | f_load |
The packed function to the Load function. More... | |
FSave | f_save |
The packed function to the Save function. More... | |
FUpdate | f_update |
The packed function to the Update function. More... | |
FPredict | f_predict |
The packed function to the Predict function. More... | |
FAsString | f_as_string |
The packed function to the AsString function. More... | |
Static Public Attributes | |
static constexpr const char * | _type_key = "meta_schedule.PyCostModel" |
![]() | |
static constexpr const char * | _type_key = "meta_schedule.CostModel" |
The cost model with customized methods on the python-side.
using tvm::meta_schedule::PyCostModelNode::FAsString = ffi::TypedFunction<String()> |
Get the cost model as string with name.
using tvm::meta_schedule::PyCostModelNode::FLoad = ffi::TypedFunction<void(String)> |
Load the cost model from given file location.
path | The file path. |
using tvm::meta_schedule::PyCostModelNode::FPredict = ffi::TypedFunction<void(const TuneContext&, const Array<MeasureCandidate>&, void* p_addr)> |
Predict the running results of given measure candidates.
context | The tuning context. |
candidates | The measure candidates. |
p_addr | The address to save the estimated running results. |
using tvm::meta_schedule::PyCostModelNode::FSave = ffi::TypedFunction<void(String)> |
Save the cost model to given file location.
path | The file path. |
using tvm::meta_schedule::PyCostModelNode::FUpdate = ffi::TypedFunction<void(const TuneContext&, const Array<MeasureCandidate>&, const Array<RunnerResult>&)> |
Update the cost model given running results.
context | The tuning context. |
candidates | The measure candidates. |
results | The running results of the measure candidates. |
|
virtual |
Load the cost model from given file location.
path | The file path. |
Implements tvm::meta_schedule::CostModelNode.
|
virtual |
Predict the normalized score (the larger the better) of given measure candidates.
context | The tuning context. |
candidates | The measure candidates. |
Implements tvm::meta_schedule::CostModelNode.
|
virtual |
Save the cost model to given file location.
path | The file path. |
Implements tvm::meta_schedule::CostModelNode.
tvm::meta_schedule::PyCostModelNode::TVM_DECLARE_FINAL_OBJECT_INFO | ( | PyCostModelNode | , |
CostModelNode | |||
) |
|
virtual |
Update the cost model given running results.
context | The tuning context. |
candidates | The measure candidates. |
results | The running results of the measure candidates. |
Implements tvm::meta_schedule::CostModelNode.
|
staticconstexpr |
FAsString tvm::meta_schedule::PyCostModelNode::f_as_string |
The packed function to the AsString
function.
FLoad tvm::meta_schedule::PyCostModelNode::f_load |
The packed function to the Load
function.
FPredict tvm::meta_schedule::PyCostModelNode::f_predict |
The packed function to the Predict
function.
FSave tvm::meta_schedule::PyCostModelNode::f_save |
The packed function to the Save
function.
FUpdate tvm::meta_schedule::PyCostModelNode::f_update |
The packed function to the Update
function.