25 #ifndef TVM_RELAY_OP_STRATEGY_H_
26 #define TVM_RELAY_OP_STRATEGY_H_
54 v->Visit(
"name", &
name);
55 v->Visit(
"plevel", &
plevel);
58 static constexpr
const char*
_type_key =
"relay.OpImplementation";
75 const Type& out_type);
105 static constexpr
const char*
_type_key =
"relay.OpSpecialization";
137 static constexpr
const char*
_type_key =
"relay.OpStrategy";
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
Managed reference to BaseAttrsNode.
Definition: attrs.h:190
Base node of all non-primitive expressions.
Definition: expr.h:361
Managed reference class to TargetNode.
Definition: target.h:192
Managed reference to TypeNode.
Definition: type.h:93
Operator implementation that includes compute and schedule function.
Definition: op_strategy.h:42
void VisitAttrs(tvm::AttrVisitor *v)
Definition: op_strategy.h:53
FTVMSchedule fschedule
Schedule function.
Definition: op_strategy.h:47
static constexpr const char * _type_key
Definition: op_strategy.h:58
String name
Name of the implementation.
Definition: op_strategy.h:49
TVM_DECLARE_FINAL_OBJECT_INFO(OpImplementationNode, Object)
FTVMCompute fcompute
Compute function.
Definition: op_strategy.h:45
int plevel
Priority level.
Definition: op_strategy.h:51
Operator implementation class.
Definition: op_strategy.h:65
Array< te::Tensor > Compute(const Attrs &attrs, const Array< te::Tensor > &inputs, const Type &out_type)
Invoke the operator compute function.
te::Schedule Schedule(const Attrs &attrs, const Array< te::Tensor > &outs, const Target &target)
Build the computation schedule.
TVM_DEFINE_OBJECT_REF_METHODS(OpImplementation, ObjectRef, OpImplementationNode)
Specialized implementations for operators under certain conditions.
Definition: op_strategy.h:92
void VisitAttrs(tvm::AttrVisitor *v)
Definition: op_strategy.h:100
TVM_DECLARE_FINAL_OBJECT_INFO(OpSpecializationNode, ExprNode)
Array< OpImplementation > implementations
List of implementations.
Definition: op_strategy.h:95
te::SpecializedCondition condition
Condition to enable the specialization. Could be undefined to represent generic case.
Definition: op_strategy.h:98
static constexpr const char * _type_key
Definition: op_strategy.h:105
Operator specialization class.
Definition: op_strategy.h:112
TVM_DEFINE_MUTABLE_OBJECT_REF_METHODS(OpSpecialization, ObjectRef, OpSpecializationNode)
void AddImplementation(FTVMCompute fcompute, FTVMSchedule fschedule, String name, int plevel)
Add an implementation.
Operator strategy to choose implementation.
Definition: op_strategy.h:130
Array< OpSpecialization > specializations
List of operator specializations.
Definition: op_strategy.h:133
TVM_DECLARE_FINAL_OBJECT_INFO(OpStrategyNode, ExprNode)
static constexpr const char * _type_key
Definition: op_strategy.h:137
void VisitAttrs(tvm::AttrVisitor *v)
Definition: op_strategy.h:135
Operator strategy class.
Definition: op_strategy.h:144
TVM_DEFINE_MUTABLE_OBJECT_REF_METHODS(OpStrategy, ObjectRef, OpStrategyNode)
void AddImplementation(FTVMCompute fcompute, FTVMSchedule fschedule, String name, int plevel)
Add an implementation.
Array, container representing a contiguous sequence of ObjectRefs.
Definition: array.h:289
Base class of all object reference.
Definition: object.h:517
base class of all object containers.
Definition: object.h:169
Reference to string objects.
Definition: string.h:98
Global schedule container For operations and all the operations they depend on. The schedule per Oper...
Definition: schedule.h:318
Specialized condition to enable op specialization.
Definition: schedule.h:952
runtime implementation for LibTorch/TorchScript.
Definition: analyzer.h:36
Relay expression language.
The Expr and related elements in DataFlow construction.
Compilation target object.