19 #ifndef TVM_META_SCHEDULE_TUNE_CONTEXT_H_ 20 #define TVM_META_SCHEDULE_TUNE_CONTEXT_H_ 42 namespace meta_schedule {
44 class TaskSchedulerNode;
45 class MeasureCallback;
84 v->Visit(
"mod", &mod);
85 v->Visit(
"target", &target);
86 v->Visit(
"space_generator", &space_generator);
87 v->Visit(
"search_strategy", &search_strategy);
88 v->Visit(
"sch_rules", &sch_rules);
89 v->Visit(
"postprocs", &postprocs);
90 v->Visit(
"mutator_probs", &mutator_probs);
91 v->Visit(
"task_name", &task_name);
93 v->Visit(
"rand_state", &rand_state);
94 v->Visit(
"num_threads", &num_threads);
95 v->Visit(
"is_terminated", &is_terminated);
96 v->Visit(
"measure_candidates", &measure_candidates);
97 v->Visit(
"builder_results", &builder_results);
98 v->Visit(
"runner_futures", &runner_futures);
127 static constexpr
const char*
_type_key =
"meta_schedule.TuneContext";
168 #endif // TVM_META_SCHEDULE_TUNE_CONTEXT_H_ void _SendToBuilder(const Builder &builder)
Send the measure candidates to builder.
Array< ScheduleRule > sch_rules
The schedule rules.
Definition: tune_context.h:60
Optional< Target > target
The target to be tuned for.
Definition: tune_context.h:54
Runtime Optional container types.
#define TVM_DEFINE_MUTABLE_NOTNULLABLE_OBJECT_REF_METHODS(TypeName, ParentType, ObjectName)
Definition: object.h:758
void Initialize()
Initialize members that needs initialization with tune context.
void _SetMeasureCandidates(const Array< MeasureCandidate > &candidates)
Set the measure candidates from the SearchStrategy.
Runtime String container types.
Random number generator. It provides a generic interface consistent with std::uniform_random_bit_gene...
Optional< Array< MeasureCandidate > > measure_candidates
The measure candidates.
Definition: tune_context.h:77
IRModule that holds the functions and type definitions.
runtime implementation for LibTorch/TorchScript.
Definition: analyzer.h:36
void _ClearMeasureState()
Set measure_candidates, builder_results and runner_futures to null.
support::LinearCongruentialEngine::TRandState rand_state
The random state.
Definition: tune_context.h:70
Optional< String > task_name
The name of the tuning task.
Definition: tune_context.h:66
base class of all object containers.
Definition: object.h:167
Optional< SpaceGenerator > space_generator
The design space generator.
Definition: tune_context.h:56
Optional< IRModule > mod
The workload to be tuned.
Definition: tune_context.h:52
Managed reference to TuneContextNode.
Definition: tune_context.h:135
int64_t TRandState
Definition: random_engine.h:54
Runtime Array container types.
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
Array< Postproc > postprocs
The postprocessors.
Definition: tune_context.h:62
int num_threads
The number of threads to be used.
Definition: tune_context.h:72
Optional< SearchStrategy > search_strategy
The search strategy.
Definition: tune_context.h:58
Array, container representing a contiguous sequence of ObjectRefs.
Definition: array.h:289
Array< RunnerResult > _Join()
Join the running tasks.
The auto tuning context.
Definition: tune_context.h:49
bool is_terminated
Whether the tuning task has been stopped or finished.
Definition: tune_context.h:75
TVM_DECLARE_FINAL_OBJECT_INFO(TuneContextNode, Object)
void VisitAttrs(tvm::AttrVisitor *v)
Definition: tune_context.h:83
Base class of all object reference.
Definition: object.h:511
PackedFunc logging_func
The tuning task's logging function. t.
Definition: tune_context.h:68
A managed object in the TVM runtime.
Map< Mutator, FloatImm > mutator_probs
The probability of using certain mutator.
Definition: tune_context.h:64
static constexpr const char * _type_key
Definition: tune_context.h:127
Optional< Array< BuilderResult > > builder_results
The building results.
Definition: tune_context.h:79
Compilation target object.
Map container of NodeRef->NodeRef in DSL graph. Map implements copy on write semantics, which means map is mutable but copy will happen when array is referenced in more than two places.
Definition: map.h:1271
Runtime Map container types.
Optional< Array< RunnerFuture > > runner_futures
Packed functions to fetch the runner results asynchronously.
Definition: tune_context.h:81
Packed function is a type-erased function. The arguments are passed by packed format.
Definition: packed_func.h:138
Optional container that to represent to a Nullable variant of T.
Definition: optional.h:51
void _SendToRunner(const Runner &runner)
Send the built measure candidates to runner.
Reflection and serialization of compiler IR/AST nodes.
TuneContext Clone() const
Clone the tune context.
Type-erased function used across TVM API.