24#ifndef TVM_RELAX_TRANSFORM_H_
25#define TVM_RELAX_TRANSFORM_H_
28#include <tvm/ffi/reflection/registry.h>
45using LayoutCb = ffi::TypedFunction<ffi::Map<ffi::String, ffi::Array<ffi::String>>(
Call)>;
57 int opt_level, ffi::String name);
197TVM_DLL
Pass BindParams(ffi::String func_name, ffi::Map<Any, ffi::ObjectRef> params);
215 ffi::Optional<ffi::String> func_name = std::nullopt);
252 ffi::Optional<ffi::Array<ffi::String>> skip_ops,
253 bool enable_warning =
false, ffi::Optional<Target> target = std::nullopt);
405 namespace refl = tvm::ffi::reflection;
406 refl::ObjectDef<FusionPatternObj>()
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) {}
466 namespace refl = tvm::ffi::reflection;
467 refl::ObjectDef<PatternCheckContextObj>()
481 ffi::Map<Var, Expr> matched_bindings,
482 ffi::Map<
Var, ffi::Array<Var>> var_usages,
483 ffi::Map<Expr, Var> value_to_bound_var);
515 ffi::Optional<ffi::Array<Var>> require_grads = std::nullopt,
516 int target_index = 0);
539 bool bind_constants =
true,
bool annotate_codegen =
false,
540 const tvm::ffi::Array<ffi::String>& entry_function_names = {});
566RunCodegen(ffi::Optional<ffi::Map<ffi::String, ffi::Map<ffi::String, ffi::Any>>> target_options,
567 ffi::Array<ffi::String> entry_functions);
602 const ffi::Map<ffi::String, tirx::Function>& op_impl_map,
603 const ffi::Map<ffi::String, ffi::Array<ffi::Optional<tirx::IndexMap>>>& op_tensor_transforms);
664 DLDataType out_dtype, ffi::Optional<ffi::Array<ffi::String>> fp16_input_names = std::nullopt);
Managed reference to CallObj.
Definition expr.h:825
Managed reference to ExprObj.
Definition expr.h:101
Managed reference class to IRModuleObj.
Definition module.h:292
Typed reference/view over any Expr whose ExprObj::ty is PrimType.
Definition expr.h:187
Managed reference to VarObj.
Definition expr.h:571
Managed reference to dataflow patterns.
Definition dataflow_pattern.h:103
Managed reference to VDeviceObj.
Definition global_info.h:68
The input of FusionPattern::check.
Definition transform.h:431
static void RegisterReflection()
Definition transform.h:465
PatternCheckContextObj(ffi::UnsafeInit)
Definition transform.h:434
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:457
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("relax.transform.PatternCheckContext", PatternCheckContextObj, ffi::Object)
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:463
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:445
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:451
PatternCheckContextObj(Expr matched_expr)
Definition transform.h:433
Expr matched_expr
The expression that's matched with the FusionPattern::pattern.
Definition transform.h:439
Definition transform.h:478
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, ffi::ObjectRef, PatternCheckContextObj)
PassContext that is used to configure the pass behavior.
Definition transform.h:64
A pattern language for matching dataflow properties.
Parent compiler symbol visibility.
Defines a remapping of tensor indices.
An object that builds and maintains block scope and StmtSref mapping for Dependence analysis.
Definition analysis.h:41