24 #ifndef TVM_RELAX_TRANSFORM_H_
25 #define TVM_RELAX_TRANSFORM_H_
27 #include <tvm/ffi/reflection/registry.h>
57 int opt_level, String name, tvm::Array<String> required,
58 bool traceable =
false);
73 String name, tvm::Array<String> required,
bool traceable =
false);
217 Optional<String> func_name = std::nullopt);
251 TVM_DLL
Pass LegalizeOps(Optional<Map<String, ffi::Function>> cmap,
bool enable_warning =
false);
400 refl::ObjectDef<FusionPatternNode>()
408 static constexpr
const char*
_type_key =
"relax.transform.FusionPattern";
415 Optional<ffi::Function> check, Optional<ffi::Function> attrs_getter);
418 :
FusionPattern(name, pattern, {}, std::nullopt, std::nullopt) {}
459 refl::ObjectDef<PatternCheckContextNode>()
467 static constexpr
const char*
_type_key =
"relax.transform.PatternCheckContext";
474 Map<Var, Expr> matched_bindings, Map<
Var, Array<Var>> var_usages,
475 Map<Expr, Var> value_to_bound_var);
506 TVM_DLL
Pass Gradient(String func_name, Optional<Array<Var>> require_grads = std::nullopt,
507 int target_index = 0);
530 bool annotate_codegen =
false,
531 const tvm::Array<String>& entry_function_names = {});
556 TVM_DLL
Pass RunCodegen(Optional<Map<String, Map<String, ffi::Any>>> target_options,
557 Array<String> entry_functions);
594 const Map<String, Array<tir::IndexMap>>& op_buffer_transforms,
596 const Map<String, Optional<Array<Array<IntImm>>>>& input_axis_separators);
655 Optional<Array<String>> fp16_input_names = std::nullopt);
Boolean constant.
Definition: expr.h:577
Managed reference class to IRModuleNode.
Definition: module.h:257
Reference to PrimExprNode.
Definition: expr.h:129
Managed reference to RelaxExprNode.
Definition: expr.h:446
Managed reference to VDeviceNode.
Definition: global_info.h:90
Managed reference to dataflow patterns.
Definition: dataflow_pattern.h:102
The input of FusionPattern::check.
Definition: transform.h:426
Map< Expr, Var > value_to_bound_var
Map from value to its bound variable. It doesn't have variables after the matched expression.
Definition: transform.h:455
Map< Var, Expr > matched_bindings
Map from variable to its value. It contains variables from bindings that is being fused by FuseOpsByP...
Definition: transform.h:443
Map< String, Expr > annotated_expr
A map which contains all expressions matched by the sub patterns in FusionPattern::annotation_pattern...
Definition: transform.h:437
TVM_DECLARE_FINAL_OBJECT_INFO(PatternCheckContextNode, Object)
static constexpr const char * _type_key
Definition: transform.h:467
static void RegisterReflection()
Definition: transform.h:457
Map< Var, Array< Var > > var_usages
A map mapping variable definitions to a set of uses. It has all variables used in the function.
Definition: transform.h:449
Expr matched_expr
The expression that's matched with the FusionPattern::pattern.
Definition: transform.h:431
Definition: transform.h:471
PatternCheckContext(Expr matched_expr, Map< String, Expr > annotated_expr, Map< Var, Expr > matched_bindings, Map< Var, Array< Var >> var_usages, Map< Expr, Var > value_to_bound_var)
TVM_DEFINE_NOTNULLABLE_OBJECT_REF_METHODS(PatternCheckContext, ObjectRef, PatternCheckContextNode)
Runtime primitive data type.
Definition: data_type.h:47
PassContext that is used to configure the pass behavior.
Definition: transform.h:156
A pattern language for matching dataflow properties.
Defines a remapping of buffer indices.
Definition: repr_printer.h:91
constexpr const char * axis_separators
Marks the physical axis separators.
Definition: stmt.h:1123
Performance counters for profiling via the PAPI library.
Definition: analyzer.h:37