tvm
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | List of all members
tvm::s_tir::meta_schedule::CostModelObj Class Referenceabstract

Cost model. More...

#include <cost_model.h>

Inheritance diagram for tvm::s_tir::meta_schedule::CostModelObj:
Collaboration diagram for tvm::s_tir::meta_schedule::CostModelObj:

Public Member Functions

virtual ~CostModelObj ()=default
 Virtual destructor.
 
virtual void Load (const ffi::String &path)=0
 Load the cost model from given file location.
 
virtual void Save (const ffi::String &path)=0
 Save the cost model to given file location.
 
virtual void Update (const TuneContext &context, const ffi::Array< MeasureCandidate > &candidates, const ffi::Array< RunnerResult > &results)=0
 Update the cost model given running results.
 
virtual std::vector< double > Predict (const TuneContext &context, const ffi::Array< MeasureCandidate > &candidates)=0
 Predict the normalized score (the larger the better) of given measure candidates.
 
 TVM_FFI_DECLARE_OBJECT_INFO ("s_tir.meta_schedule.CostModel", CostModelObj, ffi::Object)
 

Static Public Attributes

static constexpr const bool _type_mutable = true
 

Detailed Description

Cost model.

Constructor & Destructor Documentation

◆ ~CostModelObj()

virtual tvm::s_tir::meta_schedule::CostModelObj::~CostModelObj ( )
virtualdefault

Virtual destructor.

Member Function Documentation

◆ Load()

virtual void tvm::s_tir::meta_schedule::CostModelObj::Load ( const ffi::String &  path)
pure virtual

Load the cost model from given file location.

Parameters
pathThe file path.

Implemented in tvm::s_tir::meta_schedule::PyCostModelObj.

◆ Predict()

virtual std::vector< double > tvm::s_tir::meta_schedule::CostModelObj::Predict ( const TuneContext &  context,
const ffi::Array< MeasureCandidate > &  candidates 
)
pure virtual

Predict the normalized score (the larger the better) of given measure candidates.

Parameters
contextThe tuning context.
candidatesThe measure candidates.
Returns
The predicted normalized score.

Implemented in tvm::s_tir::meta_schedule::PyCostModelObj.

◆ Save()

virtual void tvm::s_tir::meta_schedule::CostModelObj::Save ( const ffi::String &  path)
pure virtual

Save the cost model to given file location.

Parameters
pathThe file path.

Implemented in tvm::s_tir::meta_schedule::PyCostModelObj.

◆ TVM_FFI_DECLARE_OBJECT_INFO()

tvm::s_tir::meta_schedule::CostModelObj::TVM_FFI_DECLARE_OBJECT_INFO ( "s_tir.meta_schedule.CostModel"  ,
CostModelObj  ,
ffi::Object   
)

◆ Update()

virtual void tvm::s_tir::meta_schedule::CostModelObj::Update ( const TuneContext &  context,
const ffi::Array< MeasureCandidate > &  candidates,
const ffi::Array< RunnerResult > &  results 
)
pure virtual

Update the cost model given running results.

Parameters
contextThe tuning context.
candidatesThe measure candidates.
resultsThe running results of the measure candidates.

Implemented in tvm::s_tir::meta_schedule::PyCostModelObj.

Member Data Documentation

◆ _type_mutable

constexpr const bool tvm::s_tir::meta_schedule::CostModelObj::_type_mutable = true
staticconstexpr

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