19 #ifndef TVM_META_SCHEDULE_DATABASE_H_ 20 #define TVM_META_SCHEDULE_DATABASE_H_ 37 namespace meta_schedule {
52 v->Visit(
"mod", &mod);
56 static constexpr
const char*
_type_key =
"meta_schedule.Workload";
107 const ModuleEquality& mod_eq_;
128 v->Visit(
"trace", &trace);
129 v->Visit(
"workload", &workload);
130 v->Visit(
"run_secs", &run_secs);
131 v->Visit(
"target", &target);
132 v->Visit(
"args_info", &args_info);
135 static constexpr
const char*
_type_key =
"meta_schedule.TuningRecord";
151 bool IsValid()
const;
177 TVM_DLL
static TuningRecord FromJSON(
const ObjectRef& json_obj,
const Workload& workload);
216 virtual void CommitTuningRecord(
const TuningRecord& record) = 0;
233 virtual int64_t Size() = 0;
242 const String& workload_name);
251 const String& workload_name);
260 const String& workload_name);
268 static constexpr
const char*
_type_key =
"meta_schedule.Database";
273 std::unique_ptr<ModuleEquality> mod_eq_;
390 ICHECK(f_has_workload !=
nullptr) <<
"PyDatabase's HasWorkload method not implemented!";
391 return f_has_workload(
mod);
395 ICHECK(f_commit_workload !=
nullptr) <<
"PyDatabase's CommitWorkload method not implemented!";
396 return f_commit_workload(
mod);
400 ICHECK(f_commit_tuning_record !=
nullptr)
401 <<
"PyDatabase's CommitTuningRecord method not implemented!";
402 f_commit_tuning_record(record);
406 ICHECK(f_get_top_k !=
nullptr) <<
"PyDatabase's GetTopK method not implemented!";
407 return f_get_top_k(workload, top_k);
411 ICHECK(f_get_all_tuning_records !=
nullptr)
412 <<
"PyDatabase's GetAllTuningRecords method not implemented!";
413 return f_get_all_tuning_records();
417 const String& workload_name)
final {
418 if (f_query_tuning_record ==
nullptr) {
421 return f_query_tuning_record(
mod, target, workload_name);
426 const String& workload_name)
final {
427 if (f_query_schedule ==
nullptr) {
430 return f_query_schedule(
mod, target, workload_name);
435 const String& workload_name)
final {
436 if (f_query_ir_module ==
nullptr) {
439 return f_query_ir_module(
mod, target, workload_name);
444 ICHECK(f_size !=
nullptr) <<
"PyDatabase's Size method not implemented!";
448 static constexpr
const char*
_type_key =
"meta_schedule.PyDatabase";
462 TVM_DLL
static Database MemoryDatabase(
String mod_eq_name =
"structural");
469 TVM_DLL
static Database ScheduleFnDatabase(
479 bool allow_missing,
String mod_eq_name =
"structural");
519 String mod_eq_name =
"structural");
523 void EnterWithScope();
525 void ExitWithScope();
533 #endif // TVM_META_SCHEDULE_DATABASE_H_
#define TVM_DEFINE_MUTABLE_NOTNULLABLE_OBJECT_REF_METHODS(TypeName, ParentType, ObjectName)
Definition: object.h:758
Runtime String container types.
IRModule that holds the functions and type definitions.
runtime implementation for LibTorch/TorchScript.
Definition: analyzer.h:36
base class of all object containers.
Definition: object.h:167
Managed reference to ScheduleNode.
Definition: schedule.h:813
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, container representing a contiguous sequence of ObjectRefs.
Definition: array.h:289
Reference to string objects.
Definition: string.h:98
Managed reference class to TargetNode.
Definition: target.h:183
Base class of all object reference.
Definition: object.h:511
A managed object in the TVM runtime.
Managed reference class to IRModuleNode.
Definition: module.h:348
Compilation target object.
Managed reference to TraceNode.
Definition: trace.h:141
Optional container that to represent to a Nullable variant of T.
Definition: optional.h:51
Reflection and serialization of compiler IR/AST nodes.
#define TVM_DECLARE_BASE_OBJECT_INFO(TypeName, ParentType)
helper macro to declare a base object type that can be inherited.
Definition: object.h:648
#define TVM_DEFINE_NOTNULLABLE_OBJECT_REF_METHODS(TypeName, ParentType, ObjectName)
Definition: object.h:728
Type-erased function used across TVM API.