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

The abstract interface of task schedulers. More...

#include <task_scheduler.h>

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

Public Member Functions

virtual ~TaskSchedulerObj ()=default
 The default destructor.
 
virtual int NextTaskId ()=0
 Fetch the next task id.
 
virtual ffi::Array< RunnerResult > JoinRunningTask (int task_id)
 Wait until the task is finished.
 
virtual void Tune (ffi::Array< TuneContext > tasks, ffi::Array< FloatImm > task_weights, int max_trials_global, int max_trials_per_task, int num_trials_per_iter, Builder builder, Runner runner, ffi::Array< MeasureCallback > measure_callbacks, ffi::Optional< Database > database, ffi::Optional< CostModel > cost_model)
 Jointly tune a given list of tasks.
 
void TerminateTask (int task_id)
 Terminate a task.
 
void TouchTask (int task_id)
 Touch the task and update its status.
 
void PrintTuningStatistics ()
 Print out a human-readable format of the tuning statistics.
 
 TVM_FFI_DECLARE_OBJECT_INFO ("s_tir.meta_schedule.TaskScheduler", TaskSchedulerObj, ffi::Object)
 

Static Public Member Functions

static void RegisterReflection ()
 

Public Attributes

ffi::Function logger
 The tuning task's logging function.
 
ffi::Array< TaskRecord > tasks_
 Records for each task.
 
ffi::Array< MeasureCallback > measure_callbacks_
 The list of measure callbacks of the scheduler.
 
ffi::Optional< Database > database_
 The database used in tuning.
 
ffi::Optional< CostModel > cost_model_
 The cost model used in tuning.
 
int remaining_tasks_
 The number of remaining tasks to be tuned.
 

Static Public Attributes

static constexpr const bool _type_mutable = true
 

Detailed Description

The abstract interface of task schedulers.

Note
The relationship between SpaceGenerator and other classes are as follows: +-----------------------------------------------------------—+ +–+--------------------------------------------------------—+ | +–+---------------— Tune Context --------------------------—+ | | | +------------------—+ | | | | | | Generate | | | | | Space Generator +-----------—+ | | | | | | | | | | | +------------------—+ v | | | | Design Space | | | | +------------------—+ | | | | | Generate | | Pretuning | | | | | +--------—+ Search Strategy |<----------—+ | | | | | | | | +–+ | | +------------------—+ +–+ +-—+-------------------------------------------------------—+ | | +-—+-------------— Managed By Task Scheduler ------------------—+ | | +--------—+ | | | Send to | | Send to | | v +----------—+| Builder +-------—+ | | Measure Candidate | Builder | | Runner | | | | | +--------—+ | | | | +---------—+---------—+ | | | | | | +--------—+ | | | +-—>| Task Scheduler | | | | | | | | | Runner |<--—+ | | +----------------------—+ | | | | ^ +--—+--—+ | | | | | | +-— Runner Future <----—+ | +------------------------------------------------------------------—+

Constructor & Destructor Documentation

◆ ~TaskSchedulerObj()

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

The default destructor.

Member Function Documentation

◆ JoinRunningTask()

virtual ffi::Array< RunnerResult > tvm::s_tir::meta_schedule::TaskSchedulerObj::JoinRunningTask ( int  task_id)
virtual

Wait until the task is finished.

Parameters
task_idThe task id to be joined.
Returns
The results from the runner.

Reimplemented in tvm::s_tir::meta_schedule::PyTaskSchedulerObj.

◆ NextTaskId()

virtual int tvm::s_tir::meta_schedule::TaskSchedulerObj::NextTaskId ( )
pure virtual

Fetch the next task id.

Returns
The next task id.

Implemented in tvm::s_tir::meta_schedule::PyTaskSchedulerObj.

◆ PrintTuningStatistics()

void tvm::s_tir::meta_schedule::TaskSchedulerObj::PrintTuningStatistics ( )

Print out a human-readable format of the tuning statistics.

◆ RegisterReflection()

static void tvm::s_tir::meta_schedule::TaskSchedulerObj::RegisterReflection ( )
inlinestatic

◆ TerminateTask()

void tvm::s_tir::meta_schedule::TaskSchedulerObj::TerminateTask ( int  task_id)

Terminate a task.

Parameters
task_idThe id of the task to be terminated

◆ TouchTask()

void tvm::s_tir::meta_schedule::TaskSchedulerObj::TouchTask ( int  task_id)

Touch the task and update its status.

Parameters
task_idThe task id to be checked.

◆ Tune()

virtual void tvm::s_tir::meta_schedule::TaskSchedulerObj::Tune ( ffi::Array< TuneContext >  tasks,
ffi::Array< FloatImm >  task_weights,
int  max_trials_global,
int  max_trials_per_task,
int  num_trials_per_iter,
Builder  builder,
Runner  runner,
ffi::Array< MeasureCallback >  measure_callbacks,
ffi::Optional< Database >  database,
ffi::Optional< CostModel >  cost_model 
)
virtual

Jointly tune a given list of tasks.

Parameters
tasksThe tasks to be tuned
task_weightsThe weight of each task
max_trials_globalThe maximum number of trials to be performed globally
max_trials_per_taskThe maximum number of trials to be performed for each task
num_trials_per_iterThe number of trials to be performed in each iteration
builderThe MetaSchedule builder
runnerThe MetaSchedule runner
measure_callbacksThe callbacks to be called after each measurement
databaseThe database used in tuning
cost_modelThe cost model used in tuning

Reimplemented in tvm::s_tir::meta_schedule::PyTaskSchedulerObj.

◆ TVM_FFI_DECLARE_OBJECT_INFO()

tvm::s_tir::meta_schedule::TaskSchedulerObj::TVM_FFI_DECLARE_OBJECT_INFO ( "s_tir.meta_schedule.TaskScheduler"  ,
TaskSchedulerObj  ,
ffi::Object   
)

Member Data Documentation

◆ _type_mutable

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

◆ cost_model_

ffi::Optional<CostModel> tvm::s_tir::meta_schedule::TaskSchedulerObj::cost_model_

The cost model used in tuning.

◆ database_

ffi::Optional<Database> tvm::s_tir::meta_schedule::TaskSchedulerObj::database_

The database used in tuning.

◆ logger

ffi::Function tvm::s_tir::meta_schedule::TaskSchedulerObj::logger

The tuning task's logging function.

◆ measure_callbacks_

ffi::Array<MeasureCallback> tvm::s_tir::meta_schedule::TaskSchedulerObj::measure_callbacks_

The list of measure callbacks of the scheduler.

◆ remaining_tasks_

int tvm::s_tir::meta_schedule::TaskSchedulerObj::remaining_tasks_

The number of remaining tasks to be tuned.

◆ tasks_

ffi::Array<TaskRecord> tvm::s_tir::meta_schedule::TaskSchedulerObj::tasks_

Records for each task.


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