42 #ifndef TVM_AUTO_SCHEDULER_SEARCH_POLICY_H_
43 #define TVM_AUTO_SCHEDULER_SEARCH_POLICY_H_
50 #include <unordered_set>
55 namespace auto_scheduler {
57 class ProgramMeasurer;
58 class SearchPolicyNode;
73 static constexpr
const char*
_type_key =
"auto_scheduler.SearchCallback";
95 static constexpr
const char*
_type_key =
"auto_scheduler.PreloadMeasuredStates";
123 "auto_scheduler_simplify_const_tensor_indices";
153 virtual State Search(
int num_measure_trials,
int early_stopping,
int num_measures_per_round,
177 static constexpr
const char*
_type_key =
"auto_scheduler.SearchPolicy";
Visitor class to get the attributes of an AST/IR node. The content is going to be called for each fie...
Definition: reflection.h:52
Preload measured states from a log file. This can resume the state of the search policy.
Definition: search_policy.h:88
void Callback(SearchPolicyNode *policy) final
Run the registered callback function.
static constexpr const char * _type_key
Definition: search_policy.h:95
TVM_DECLARE_FINAL_OBJECT_INFO(PreloadMeasuredStatesNode, SearchCallbackNode)
String filename
The name of the record log file.
Definition: search_policy.h:91
Managed reference to PreloadMeasuredStatesNode.
Definition: search_policy.h:103
PreloadMeasuredStates(String filename)
The constructor.
TVM_DEFINE_MUTABLE_OBJECT_REF_METHODS(PreloadMeasuredStates, SearchCallback, PreloadMeasuredStatesNode)
Managed reference to ProgramMeasurerNode.
Definition: measure.h:520
Callback function to be called by the search process. This interface allows to do extra initializatio...
Definition: search_policy.h:65
virtual void Callback(SearchPolicyNode *policy)=0
Run the registered callback function.
static constexpr const char * _type_key
Definition: search_policy.h:73
TVM_DECLARE_BASE_OBJECT_INFO(SearchCallbackNode, Object)
Managed reference to SearchCallbackNode.
Definition: search_policy.h:81
TVM_DEFINE_MUTABLE_OBJECT_REF_METHODS(SearchCallback, ObjectRef, SearchCallbackNode)
The base class of search policies.
Definition: search_policy.h:129
static constexpr const char * _type_key
Definition: search_policy.h:177
void VisitAttrs(AttrVisitor *v)
Definition: search_policy.h:139
SearchTask search_task
The current search task.
Definition: search_policy.h:132
void RunCallbacks(const Array< SearchCallback > &callbacks)
Call SearchCallback with the current SearchPolicyNode.
virtual std::pair< Array< MeasureInput >, Array< MeasureResult > > ContinueSearchOneRound(int num_measure, ProgramMeasurer measurer)=0
Continue the search by doing an additional search round.
std::vector< float > measured_states_throughputs_
The throughputs of already measured states.
Definition: search_policy.h:191
int verbose
Verbose level to control the screen output during schedule search. 0 for silent, 1 to output state & ...
Definition: search_policy.h:137
TVM_DECLARE_BASE_OBJECT_INFO(SearchPolicyNode, Object)
virtual State Search(int num_measure_trials, int early_stopping, int num_measures_per_round, ProgramMeasurer measurer)=0
Do schedule search for a task. Takes the SearchTask as input and returns the best state found during ...
std::vector< State > measured_states_vector_
The array of already measured states. The good states can be used as the initial population in evolut...
Definition: search_policy.h:189
std::unordered_set< std::string > measured_states_set_
The set of already measured states. We store the string format of a state for redundancy check....
Definition: search_policy.h:186
void PreloadMeasuredStates(const String &log_file)
Preload measured states from a log file to resume the state of the search policy.
Managed reference to SearchPolicyNode.
Definition: search_policy.h:198
TVM_DEFINE_MUTABLE_OBJECT_REF_METHODS(SearchPolicy, ObjectRef, SearchPolicyNode)
Managed reference to SearchTaskNode.
Definition: search_task.h:148
Managed reference to StateNode.
Definition: loop_state.h:272
Array, container representing a contiguous sequence of ObjectRefs.
Definition: array.h:289
Base class of all object reference.
Definition: object.h:519
base class of all object containers.
Definition: object.h:171
Reference to string objects.
Definition: string.h:98
Distributed measurement infrastructure to measure the runtime costs of tensor programs....
runtime implementation for LibTorch/TorchScript.
Definition: analyzer.h:36
Definitions and helper macros for IR/AST nodes.
Meta information and hardware parameters for a search task.
Attribute keys of ops used for SearchPolicy.
Definition: search_policy.h:116
static constexpr const char * simplify_const_tensor_indices
The specified iterators are indices of const tensors in "fake reduction".
Definition: search_policy.h:122
static constexpr const char * always_unroll_inner
Always apply unroll to the inner most iterator of the specificed iterators.
Definition: search_policy.h:118
static constexpr const char * no_split_at_inner
The specified iterators will be placed in the inner most tile without split.
Definition: search_policy.h:120