tvm
Loading...
Searching...
No Matches
Variables
tvm::relax::op_attr Namespace Reference

Variables

constexpr ffi::reflection::AttrKey< bool > kPurity {"FPurity"}
 
constexpr ffi::reflection::AttrKey< ffi::String > kCallPacked {"FCallPacked"}
 Packed function implementation for operators. The relax operator will be lowered to this packed function call during codegen.
 
constexpr ffi::reflection::AttrKey< ffi::TypedFunction< Expr(const BlockBuilder &bb, Call call)> > kNormalize {"FNormalize"}
 The function type of a normalization function.
 
constexpr ffi::reflection::AttrKey< ffi::TypedFunction< Expr(const BlockBuilder &bb, const Call &call)> > kLegalize {"FLegalize"}
 The function type of a legalization function.
 
constexpr ffi::reflection::AttrKey< ffi::TypedFunction< Expr(const BlockBuilder &bb, const Call &call)> > kLowerBuiltin {"FLowerBuiltin"}
 The function type of a function to lower the runtime builtin.
 
constexpr ffi::reflection::AttrKey< ffi::TypedFunction< tvm::ffi::Array< Expr >(const Var &orig_var, const Call &orig_call, const Var &output_grad, const BlockBuilder &ctx)> > kPrimalGradient {"FPrimalGradient"}
 Gradient for a specific op.
 
constexpr ffi::reflection::AttrKey< ffi::TypedFunction< Type(const Call &call, const BlockBuilder &ctx)> > kInferTypeWithBuilder {"relax.FInferTypeWithBuilder"}
 Infer output type given the call.
 
constexpr ffi::reflection::AttrKey< bool > kDataDependent {"FDataDependent"}
 
constexpr ffi::reflection::AttrKey< bool > kRequiresArgumentShapes {"RequiresArgumentShapes"}
 
constexpr ffi::reflection::AttrKey< bool > kAllocator {"TAllocator"}
 
constexpr ffi::reflection::AttrKey< ffi::TypedFunction< Call(const Call &call_node, DLDataType out_dtype)> > kInferMixedPrecision {"FInferMixedPrecision"}
 
constexpr ffi::reflection::AttrKey< int > kMixedPrecisionPolicy {"TMixedPrecisionPolicy"}
 the operator pattern
 
constexpr ffi::reflection::AttrKey< ffi::TypedFunction< InferLayoutOutput(const Call &call, const ffi::Map< ffi::String, ffi::Array< ffi::String > > &desired_layouts, const ffi::Map< Var, NestedMsg< LayoutDecision > > &var_layout_map)> > kInferLayout {"FRelaxInferLayout"}
 SLayout conversion interface.
 

Variable Documentation

◆ kAllocator

constexpr ffi::reflection::AttrKey<bool> tvm::relax::op_attr::kAllocator {"TAllocator"}
inlineconstexpr

◆ kCallPacked

constexpr ffi::reflection::AttrKey<ffi::String> tvm::relax::op_attr::kCallPacked {"FCallPacked"}
inlineconstexpr

Packed function implementation for operators. The relax operator will be lowered to this packed function call during codegen.

◆ kDataDependent

constexpr ffi::reflection::AttrKey<bool> tvm::relax::op_attr::kDataDependent {"FDataDependent"}
inlineconstexpr

◆ kInferLayout

constexpr ffi::reflection::AttrKey<ffi::TypedFunction<InferLayoutOutput( const Call& call, const ffi::Map<ffi::String, ffi::Array<ffi::String>>& desired_layouts, const ffi::Map<Var, NestedMsg<LayoutDecision>>& var_layout_map)> > tvm::relax::op_attr::kInferLayout {"FRelaxInferLayout"}
inlineconstexpr

SLayout conversion interface.

Parameters
callThe call node.
desired_layoutsThe desired layouts of the operator.
var_layout_mapThe layout of the variables.

◆ kInferMixedPrecision

constexpr ffi::reflection::AttrKey< ffi::TypedFunction<Call(const Call& call_node, DLDataType out_dtype)> > tvm::relax::op_attr::kInferMixedPrecision {"FInferMixedPrecision"}
inlineconstexpr

◆ kInferTypeWithBuilder

constexpr ffi::reflection::AttrKey< ffi::TypedFunction<Type(const Call& call, const BlockBuilder& ctx)> > tvm::relax::op_attr::kInferTypeWithBuilder {"relax.FInferTypeWithBuilder"}
inlineconstexpr

Infer output type given the call.

Parameters
callThe call expression to be derived.
ctxThe builder context.

◆ kLegalize

constexpr ffi::reflection::AttrKey< ffi::TypedFunction<Expr(const BlockBuilder& bb, const Call& call)> > tvm::relax::op_attr::kLegalize {"FLegalize"}
inlineconstexpr

The function type of a legalization function.

A legalization function is used to replace a relax::Call with more concrete implementations. For example, the operation relax.op.add may be replaced with a call to a TIR function implementing addition of two tensors.

The purpose of FLegalize is to remove calls to the operator while lowering. Therefore, unlike FNormalize, the resulting expression may not contain the original operator.

Parameters
bbThe BlockBuilder context.
callThe call to be legalized.

◆ kLowerBuiltin

constexpr ffi::reflection::AttrKey< ffi::TypedFunction<Expr(const BlockBuilder& bb, const Call& call)> > tvm::relax::op_attr::kLowerBuiltin {"FLowerBuiltin"}
inlineconstexpr

The function type of a function to lower the runtime builtin.

A builtin function may be lowered to a lowered form in LowerRuntimeBuiltin.

Parameters
bbThe BlockBuilder context.
callThe call to be lowered.

◆ kMixedPrecisionPolicy

constexpr ffi::reflection::AttrKey<int> tvm::relax::op_attr::kMixedPrecisionPolicy {"TMixedPrecisionPolicy"}
inlineconstexpr

the operator pattern

◆ kNormalize

constexpr ffi::reflection::AttrKey< ffi::TypedFunction<Expr(const BlockBuilder& bb, Call call)> > tvm::relax::op_attr::kNormalize {"FNormalize"}
inlineconstexpr

The function type of a normalization function.

A normalization function is used when a relax::Call may be expressed in multiple syntactically valid and semantically equivalent forms, to normalize to a single representation.

Note: FNormalize is applied for each expression as part of the relax::BlockBuilder. Operator-specific validation belongs in OpDef::set_validator and runs after normalization.

Parameters
bbThe BlockBuilder context.
callThe call to be normalized. It is provided by-value, to avoid copies for the common case where the call is already normalized.

◆ kPrimalGradient

constexpr ffi::reflection::AttrKey<ffi::TypedFunction<tvm::ffi::Array<Expr>( const Var& orig_var, const Call& orig_call, const Var& output_grad, const BlockBuilder& ctx)> > tvm::relax::op_attr::kPrimalGradient {"FPrimalGradient"}
inlineconstexpr

Gradient for a specific op.

Parameters
orig_varthe original var corresponding to orig_call.
orig_callthe original Call(op) expr.
output_gradthe gradient of the Expr.
ctxthe current block builder context.
Returns
the gradient for each parameter.

◆ kPurity

constexpr ffi::reflection::AttrKey<bool> tvm::relax::op_attr::kPurity {"FPurity"}
inlineconstexpr

◆ kRequiresArgumentShapes

constexpr ffi::reflection::AttrKey<bool> tvm::relax::op_attr::kRequiresArgumentShapes {"RequiresArgumentShapes"}
inlineconstexpr