tvm
Classes | Namespaces
search_policy.h File Reference

The base class of search policies, including the abstract definition of search policy and other supporting data structures. More...

#include <tvm/auto_scheduler/measure.h>
#include <tvm/auto_scheduler/search_task.h>
#include <tvm/node/node.h>
#include <string>
#include <unordered_set>
#include <utility>
#include <vector>
Include dependency graph for search_policy.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::SearchCallbackNode
 Callback function to be called by the search process. This interface allows to do extra initializations before schedule search or extra check during/after the schedule search. More...
 
class  tvm::auto_scheduler::SearchCallback
 Managed reference to SearchCallbackNode. More...
 
class  tvm::auto_scheduler::PreloadMeasuredStatesNode
 Preload measured states from a log file. This can resume the state of the search policy. More...
 
class  tvm::auto_scheduler::PreloadMeasuredStates
 Managed reference to PreloadMeasuredStatesNode. More...
 
struct  tvm::auto_scheduler::SearchPolicyKey
 Attribute keys of ops used for SearchPolicy. More...
 
class  tvm::auto_scheduler::SearchPolicyNode
 The base class of search policies. More...
 
class  tvm::auto_scheduler::SearchPolicy
 Managed reference to SearchPolicyNode. More...
 

Namespaces

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

Detailed Description

The base class of search policies, including the abstract definition of search policy and other supporting data structures.

Note
How to add a new search policy. In design, there's no need for users to implement their own search policy, our formal search policy(will be brought later) should be enough to cover most use cases. Meanwhile, a custom rule mechanism will be provided to enable user-defined template search to serve the same functionality as the current AutoTVM template.

This guide is for advanced uses who have special requirements.

  1. The only function that must be implemented is Search(), which takes a task as input and returns the best states found.
  2. Information about the compute declaration of ops/subgraphs can be acquired from SearchTask. This structure also contains some information about the target device. (e.g. knowing the width of the device vector unit, we can limit the max vectorize size during schedule search)
  3. SearchCallback provides more flexibility to do extra affairs before/after the search process.
  4. ProgramMeasurer provides a simple but useful api to help check the performance of states got during the search process.