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

Managed reference to SearchStrategyNode. More...

#include <search_strategy.h>

Inheritance diagram for tvm::meta_schedule::SearchStrategy:
Collaboration diagram for tvm::meta_schedule::SearchStrategy:

Public Types

using FInitializeWithTuneContext = runtime::TypedPackedFunc< void(const TuneContext &)>
 The function type of InitializeWithTuneContext method. More...
 
using FPreTuning = runtime::TypedPackedFunc< void(int max_trials, int num_trials_per_iter, const Array< tir::Schedule > &, const Optional< Database > &, const Optional< CostModel > &)>
 The function type of PreTuning method. More...
 
using FPostTuning = runtime::TypedPackedFunc< void()>
 The function type of PostTuning method. More...
 
using FGenerateMeasureCandidates = runtime::TypedPackedFunc< Optional< Array< MeasureCandidate > >()>
 The function type of GenerateMeasureCandidates method. More...
 
using FNotifyRunnerResults = runtime::TypedPackedFunc< void(const Array< MeasureCandidate > &, const Array< RunnerResult > &)>
 The function type of NotifyRunnerResults method. More...
 
using FClone = runtime::TypedPackedFunc< SearchStrategy()>
 The function type of Clone method. More...
 
- Public Types inherited from tvm::runtime::ObjectRef
using ContainerType = Object
 type indicate the container type. More...
 

Public Member Functions

 TVM_DEFINE_MUTABLE_OBJECT_REF_METHODS (SearchStrategy, ObjectRef, SearchStrategyNode)
 
- Public Member Functions inherited from tvm::runtime::ObjectRef
 ObjectRef ()=default
 default constructor More...
 
 ObjectRef (ObjectPtr< Object > data)
 Constructor from existing object ptr. More...
 
bool same_as (const ObjectRef &other) const
 Comparator. More...
 
bool operator== (const ObjectRef &other) const
 Comparator. More...
 
bool operator!= (const ObjectRef &other) const
 Comparator. More...
 
bool operator< (const ObjectRef &other) const
 Comparator. More...
 
bool defined () const
 
const Objectget () const
 
const Objectoperator-> () const
 
bool unique () const
 
int use_count () const
 
template<typename ObjectType , typename = std::enable_if_t<std::is_base_of_v<Object, ObjectType>>>
const ObjectType * as () const
 Try to downcast the internal Object to a raw pointer of a corresponding type. More...
 
template<typename ObjectRefType , typename = std::enable_if_t<std::is_base_of_v<ObjectRef, ObjectRefType>>>
Optional< ObjectRefType > as () const
 Try to downcast the ObjectRef to a Optional<T> of the requested type. More...
 

Static Public Member Functions

static SearchStrategy PySearchStrategy (FInitializeWithTuneContext f_initialize_with_tune_context, FPreTuning f_pre_tuning, FPostTuning f_post_tuning, FGenerateMeasureCandidates f_generate_measure_candidates, FNotifyRunnerResults f_notify_runner_results, FClone f_clone)
 Create a search strategy with customized methods on the python-side. More...
 
static SearchStrategy ReplayTrace (int max_fail_count)
 Constructor of replay trace search strategy. More...
 
static SearchStrategy ReplayFunc ()
 Constructor of replay func search strategy. More...
 
static SearchStrategy EvolutionarySearch (int population_size, double init_measured_ratio, int init_min_unmeasured, int max_fail_count, int genetic_num_iters, double genetic_mutate_prob, int genetic_max_fail_count, double eps_greedy)
 Constructor of evolutionary search strategy. More...
 

Additional Inherited Members

- Static Public Attributes inherited from tvm::runtime::ObjectRef
static constexpr bool _type_is_nullable = true
 
- Protected Member Functions inherited from tvm::runtime::ObjectRef
Objectget_mutable () const
 
- Static Protected Member Functions inherited from tvm::runtime::ObjectRef
template<typename T >
static T DowncastNoCheck (ObjectRef ref)
 Internal helper function downcast a ref without check. More...
 
static void FFIClearAfterMove (ObjectRef *ref)
 Clear the object ref data field without DecRef after we successfully moved the field. More...
 
template<typename ObjectType >
static ObjectPtr< ObjectType > GetDataPtr (const ObjectRef &ref)
 Internal helper function get data_ as ObjectPtr of ObjectType. More...
 
- Protected Attributes inherited from tvm::runtime::ObjectRef
ObjectPtr< Objectdata_
 Internal pointer that backs the reference. More...
 

Detailed Description

Managed reference to SearchStrategyNode.

See also
SearchStrategyNode

Member Typedef Documentation

◆ FClone

The function type of Clone method.

Returns
The cloned search strategy.

◆ FGenerateMeasureCandidates

The function type of GenerateMeasureCandidates method.

Returns
The measure candidates generated, nullptr if finished.

◆ FInitializeWithTuneContext

The function type of InitializeWithTuneContext method.

Parameters
contextThe tuning context for initialization.

◆ FNotifyRunnerResults

The function type of NotifyRunnerResults method.

Parameters
resultsThe measurement results from the runner.

◆ FPostTuning

The function type of PostTuning method.

◆ FPreTuning

using tvm::meta_schedule::SearchStrategy::FPreTuning = runtime::TypedPackedFunc<void( int max_trials, int num_trials_per_iter, const Array<tir::Schedule>&, const Optional<Database>&, const Optional<CostModel>&)>

The function type of PreTuning method.

Member Function Documentation

◆ EvolutionarySearch()

static SearchStrategy tvm::meta_schedule::SearchStrategy::EvolutionarySearch ( int  population_size,
double  init_measured_ratio,
int  init_min_unmeasured,
int  max_fail_count,
int  genetic_num_iters,
double  genetic_mutate_prob,
int  genetic_max_fail_count,
double  eps_greedy 
)
static

Constructor of evolutionary search strategy.

Parameters
population_sizeThe initial sample population.
init_measured_ratioThe ratio of measures samples in initial population.
init_min_unmeasuredThe minimal size of unmeasured population in the initial sampling.
max_fail_countThe max number of failure during initial sampling.
genetic_num_itersThe iterations to run the genetic algorithm.
genetic_mutate_probThe probability of mutation.
genetic_max_fail_countThe maximum number to try evolving the given trace.
eps_greedyThe ratio to select samples in a greedy fashion via their predicted score.

◆ PySearchStrategy()

static SearchStrategy tvm::meta_schedule::SearchStrategy::PySearchStrategy ( FInitializeWithTuneContext  f_initialize_with_tune_context,
FPreTuning  f_pre_tuning,
FPostTuning  f_post_tuning,
FGenerateMeasureCandidates  f_generate_measure_candidates,
FNotifyRunnerResults  f_notify_runner_results,
FClone  f_clone 
)
static

Create a search strategy with customized methods on the python-side.

Parameters
f_initialize_with_tune_contextThe packed function of InitializeWithTuneContext.
f_pre_tuningThe packed function of PreTuning.
f_post_tuningThe packed function of PostTuning.
f_generate_measure_candidatesThe packed function of GenerateMeasureCandidates.
f_notify_runner_resultsThe packed function of NotifyRunnerResults.
f_cloneThe packed function of Clone.
Returns
The search strategy created.

◆ ReplayFunc()

static SearchStrategy tvm::meta_schedule::SearchStrategy::ReplayFunc ( )
static

Constructor of replay func search strategy.

◆ ReplayTrace()

static SearchStrategy tvm::meta_schedule::SearchStrategy::ReplayTrace ( int  max_fail_count)
static

Constructor of replay trace search strategy.

Parameters
max_fail_countThe max number of failures during trace replaying.

◆ TVM_DEFINE_MUTABLE_OBJECT_REF_METHODS()

tvm::meta_schedule::SearchStrategy::TVM_DEFINE_MUTABLE_OBJECT_REF_METHODS ( SearchStrategy  ,
ObjectRef  ,
SearchStrategyNode   
)

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