tvm
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Classes | Namespaces | Enumerations
measure.h File Reference

Distributed measurement infrastructure to measure the runtime costs of tensor programs. These functions are responsible for building the tvm module, uploading it to remote devices, recording the running time costs, and checking the correctness of the output. More...

#include <tvm/auto_scheduler/loop_state.h>
#include <tvm/auto_scheduler/search_task.h>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
Include dependency graph for measure.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  tvm::auto_scheduler::MeasureInputNode
 Store the input of a measurement. More...
 
class  tvm::auto_scheduler::MeasureInput
 Managed reference to MeasureInputNode. More...
 
class  tvm::auto_scheduler::BuildResultNode
 Store the result of a build. More...
 
class  tvm::auto_scheduler::BuildResult
 Managed reference to BuildResultNode. More...
 
class  tvm::auto_scheduler::MeasureResultNode
 Store the results of a measurement. More...
 
class  tvm::auto_scheduler::MeasureResult
 Managed reference to MeasureResultNode. More...
 
class  tvm::auto_scheduler::MeasureCallbackNode
 Bass class of measurement callbacks. More...
 
class  tvm::auto_scheduler::MeasureCallback
 Managed reference to MeasureCallbackNode. More...
 
class  tvm::auto_scheduler::PythonBasedMeasureCallbackNode
 A wrapper for measure callback defined by python code This class will call functions defined in the python. More...
 
class  tvm::auto_scheduler::PythonBasedMeasureCallback
 Managed reference to PythonBasedMeasureCallbackNode. More...
 
class  tvm::auto_scheduler::ProgramBuilderNode
 ProgramBuilder that builds the programs. More...
 
class  tvm::auto_scheduler::ProgramBuilder
 Managed reference to ProgramBuilderNode. More...
 
class  tvm::auto_scheduler::ProgramRunnerNode
 ProgramRunner that runs the built programs and measure the time cost. More...
 
class  tvm::auto_scheduler::ProgramRunner
 Managed reference to ProgramRunnerNode. More...
 
class  tvm::auto_scheduler::LocalBuilderNode
 LocalBuilder use local CPU cores to build programs in parallel. More...
 
class  tvm::auto_scheduler::LocalBuilder
 Managed reference to LocalBuilderNode. More...
 
class  tvm::auto_scheduler::LocalRunnerNode
 LocalRunner that uses local CPU/GPU to measure the time cost of programs. More...
 
class  tvm::auto_scheduler::LocalRunner
 Managed reference to LocalRunnerNode. More...
 
class  tvm::auto_scheduler::RPCRunnerNode
 RPCRunner that uses RPC call to measures the time cost of programs on remote devices. Or sometime we may need to use RPC even in local running to insulate the thread environment. (e.g. running CUDA programs) More...
 
class  tvm::auto_scheduler::RPCRunner
 Managed reference to RPCRunnerNode. More...
 
class  tvm::auto_scheduler::ProgramMeasurerNode
 Measurer that measures the time costs of tvm programs This class combines ProgramBuilder and ProgramRunner, and provides a simpler API. More...
 
class  tvm::auto_scheduler::ProgramMeasurer
 Managed reference to ProgramMeasurerNode. More...
 

Namespaces

 tvm
 runtime implementation for LibTorch/TorchScript.
 
 tvm::auto_scheduler
 

Enumerations

enum class  tvm::auto_scheduler::MeasureErrorNO : int {
  tvm::auto_scheduler::kNoError = 0 , tvm::auto_scheduler::kInstantiationError = 1 , tvm::auto_scheduler::kCompileHostError = 2 , tvm::auto_scheduler::kCompileDeviceError = 3 ,
  tvm::auto_scheduler::kRuntimeDeviceError = 4 , tvm::auto_scheduler::kWrongAnswerError = 5 , tvm::auto_scheduler::kBuildTimeoutError = 6 , tvm::auto_scheduler::kRunTimeoutError = 7 ,
  tvm::auto_scheduler::kUnknownError = 8
}
 The error code of one measurement. More...
 

Detailed Description

Distributed measurement infrastructure to measure the runtime costs of tensor programs. These functions are responsible for building the tvm module, uploading it to remote devices, recording the running time costs, and checking the correctness of the output.

The measurement is separated into two steps: build and run. A builder builds the executable binary files and a runner runs the binary files to get the measurement results. The flow of data structures is

            `ProgramBuilder`                 `ProgramRunner`

MeasureInput --------------—> BuildResult -------------—> MeasureResult

The core functions is implemented in python to utilize python's multiprocessing and error handling (see also python/tvm/auto_scheduler/measure.py). This c++ file is just a wrapper for the python functions.