24 #ifndef TVM_RELAX_TRANSFORM_H_
25 #define TVM_RELAX_TRANSFORM_H_
27 #include <tvm/ffi/reflection/registry.h>
44 using LayoutCb = ffi::TypedFunction<ffi::Map<ffi::String, ffi::Array<ffi::String>>(
Call)>;
58 int opt_level, ffi::String name,
59 tvm::ffi::Array<ffi::String> required,
bool traceable =
false);
74 ffi::String name, tvm::ffi::Array<ffi::String> required,
bool traceable =
false);
219 ffi::Optional<ffi::String> func_name = std::nullopt);
255 ffi::Optional<ffi::Array<ffi::String>> skip_ops,
256 bool enable_warning =
false);
406 refl::ObjectDef<FusionPatternNode>()
419 ffi::Map<ffi::String, DFPattern> annotation_patterns,
420 ffi::Optional<ffi::Function> check, ffi::Optional<ffi::Function> attrs_getter);
423 :
FusionPattern(name, pattern, {}, std::nullopt, std::nullopt) {}
464 refl::ObjectDef<PatternCheckContextNode>()
478 ffi::Map<Var, Expr> matched_bindings,
479 ffi::Map<
Var, ffi::Array<Var>> var_usages,
480 ffi::Map<Expr, Var> value_to_bound_var);
512 ffi::Optional<ffi::Array<Var>> require_grads = std::nullopt,
513 int target_index = 0);
536 bool bind_constants =
true,
bool annotate_codegen =
false,
537 const tvm::ffi::Array<ffi::String>& entry_function_names = {});
563 RunCodegen(ffi::Optional<ffi::Map<ffi::String, ffi::Map<ffi::String, ffi::Any>>> target_options,
564 ffi::Array<ffi::String> entry_functions);
601 const ffi::Map<ffi::String, tir::PrimFunc>& op_impl_map,
602 const ffi::Map<ffi::String, ffi::Array<tir::IndexMap>>& op_buffer_transforms,
603 const ffi::Map<ffi::String, ffi::Optional<ffi::Array<ffi::Array<IntImm>>>>&
axis_separators,
604 const ffi::Map<ffi::String, ffi::Optional<ffi::Array<ffi::Array<IntImm>>>>&
605 input_axis_separators);
667 ffi::Optional<ffi::Array<ffi::String>> fp16_input_names = std::nullopt);
Boolean constant.
Definition: expr.h:564
Managed reference class to IRModuleNode.
Definition: module.h:256
Reference to PrimExprNode.
Definition: expr.h:124
Managed reference to RelaxExprNode.
Definition: expr.h:439
Managed reference to VDeviceNode.
Definition: global_info.h:87
Managed reference to dataflow patterns.
Definition: dataflow_pattern.h:101
The input of FusionPattern::check.
Definition: transform.h:431
ffi::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:460
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("relax.transform.PatternCheckContext", PatternCheckContextNode, Object)
ffi::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:448
static void RegisterReflection()
Definition: transform.h:462
ffi::Map< ffi::String, Expr > annotated_expr
A map which contains all expressions matched by the sub patterns in FusionPattern::annotation_pattern...
Definition: transform.h:442
Expr matched_expr
The expression that's matched with the FusionPattern::pattern.
Definition: transform.h:436
ffi::Map< Var, ffi::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:454
Definition: transform.h:475
PatternCheckContext(Expr matched_expr, ffi::Map< ffi::String, Expr > annotated_expr, ffi::Map< Var, Expr > matched_bindings, ffi::Map< Var, ffi::Array< Var >> var_usages, ffi::Map< Expr, Var > value_to_bound_var)
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(PatternCheckContext, ObjectRef, PatternCheckContextNode)
Runtime primitive data type.
Definition: data_type.h:47
PassContext that is used to configure the pass behavior.
Definition: transform.h:153
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:1103
Performance counters for profiling via the PAPI library.
Definition: analyzer.h:37