|
tvm
|
Namespaces | |
| namespace | attr |
| namespace | backend |
| namespace | meta_schedule |
| namespace | transform |
Classes | |
| class | Instruction |
| Managed reference to InstructionNode. More... | |
| class | InstructionKind |
| Managed reference to InstructionKindNode. More... | |
| class | InstructionKindNode |
| Kind of an instruction, e.g. Split, Reorder, etc. Besides the name, every kind of instruction has its own properties, including: 1) A boolean indicating if the instruction is pure, i.e. change nothing in the schedule state 2) A functor that applies the instruction to a TensorIR schedule 3) A functor that converts the instruction to a statement in python syntax 4) A functor that serialize its attributes to JSON 5) A functor that deserialize its attributes from JSON. More... | |
| class | InstructionKindRegEntry |
| An entry in the registry of InstructionKind. More... | |
| class | InstructionNode |
| Schedule instructions each corresponds to a schedule primitive. More... | |
| class | LinearCongruentialEngine |
| This linear congruential engine is a drop-in replacement for std::minstd_rand. It strictly corresponds to std::minstd_rand and is designed to be platform-independent. More... | |
| class | LoopRV |
| Managed reference to LoopRVNode. More... | |
| class | LoopRVNode |
| A random variable that evaluates to a TensorIR for loop. More... | |
| struct | MemCpyDetails |
| Helper struct for return value of IdentifyMemCpy. More... | |
| struct | SBlockInfo |
| The information about a TensorIR block, it contains two categories of information 1) Info on the block scope rooted at a specific block, including dependency tracking, flags indicating if the scope is a stage pipeline, etc. 2) Info on the block itself, including if the block has a quasi-affine binding, if the regions it reads are completely covered by their producers, etc. More... | |
| class | SBlockRV |
| Managed reference to SBlockRVNode. More... | |
| class | SBlockRVNode |
| A random variable that evaluates to a TensorIR block. More... | |
| class | Schedule |
| Managed reference to ScheduleNode. More... | |
| class | ScheduleNode |
| The user-facing schedule class. More... | |
| class | ScheduleState |
| Managed reference to ScheduleStateNode. More... | |
| class | ScheduleStateNode |
The state of scheduling, which exposes a Replace method as the primary interface for all the scheduling primitives to manipulate the TensorIR. More... | |
| class | Trace |
| Managed reference to TraceNode. More... | |
| class | TraceNode |
| An execution trace of a scheduling program. More... | |
Typedefs | |
| using | FInstructionApply = ffi::TypedFunction< ffi::Array< Any >(Schedule sch, const ffi::Array< Any > &inputs, const ffi::Array< Any > &attrs, const Any &decision)> |
| Type of the functor that applies the instruction to a TensorIR schedule. | |
| using | FInstructionAsPython = ffi::TypedFunction< ffi::String(const ffi::Array< Any > &inputs, const ffi::Array< Any > &attrs, const Any &decision, const ffi::Array< ffi::String > &outputs)> |
| Type of the functor that converts the instruction to a statement in python syntax. | |
| using | FInstructionAttrsAsJSON = ffi::TypedFunction< ffi::ObjectRef(ffi::Array< Any > attrs)> |
| Type of the functor that serialize its attributes to JSON. | |
| using | FInstructionAttrsFromJSON = ffi::TypedFunction< ffi::Array< Any >(ffi::ObjectRef json_attrs)> |
| Type of the functor that deserialize its attributes from JSON. | |
| using | ExprRV = PrimExpr |
| An expr random variable. | |
| using | ExprRVNode = ExprNode |
| using | FTraceDecisionProvider = ffi::TypedFunction< Any(const Instruction &inst, const ffi::Array< Any > &inputs, const ffi::Array< Any > &attrs, const Any &decision)> |
| A callback that allows users to mutate decisions on the fly when applying instructions. The signature of the callback is: | |
Enumerations | |
| enum class | ScheduleErrorRenderLevel : int32_t { kDetail = 0 , kFast = 1 , kNone = 2 } |
| The level of detailed error message rendering. More... | |
| enum class | BufferIndexType : int32_t { kRead = 0 , kWrite = 1 } |
| Type of buffer index. More... | |
| enum | ScheduleDebugMask : uint32_t { kVerifySRefTree = 1 , kVerifyCachedFlags = 2 } |
| The bitmask of the debug flag in the ScheduleStateNode. More... | |
Functions | |
| double | EstimateTIRFlops (const Stmt &stmt) |
| Estimate the FLOPs of a TIR fragment. | |
| double | EstimateTIRFlops (const IRModule &mod) |
| Estimate the FLOPs of TIRs in an IRModule. | |
| bool | IsPureFunction (const PrimFunc &func, bool assert_on_error=false) |
| Analyze the side effect of a function. | |
| bool | VerifyGPUCode (const PrimFunc &func, ffi::Map< ffi::String, PrimExpr > constraints) |
| Verify the correctness of a GPU code. | |
| std::optional< MemCpyDetails > | IdentifyMemCpy (const For &loop, const arith::Analyzer &analyzer) |
| Identify whether a For loop is semantically equivalent to MemCpy. | |
| ffi::Map< ffi::String, ffi::Map< ffi::String, int64_t > > | CalculateAllocatedBytes (const PrimFunc &func) |
| Calculate the allocated memory per scope in bytes needed inside the TIR PrimFunc. | |
| ffi::Map< ffi::String, ffi::Map< ffi::String, int64_t > > | CalculateAllocatedBytes (const IRModule &mod) |
| Calculate the allocated memory per scope in bytes for each function inside the module. | |
| ffi::Array< tvm::transform::Pass > | GetVTCMCompactionPasses () |
| Get the list of lowering passes to calculate the compacted VTCM allocation size. | |
| bool | VerifyVTCMLimit (const IRModule &mod, int64_t limit) |
| Verifies that the VTCM usage for all prim_funcs in the given IRModule. | |
| bool | VerifyVTCMLimit (const PrimFunc &func, int64_t limit) |
| Verifies that the VTCM usage of the given prim_func is within the provided limit. | |
| tirx::PrimFunc | RenewDefs (const tirx::PrimFunc &func) |
| Renew the definition nodes for a TIR, including Var, Buffer and IterVar. This pass works as a simple DeepCopy to duplicate a function with different Vars and Buffers but the same behavior. | |
An expr random variable.
| using tvm::s_tir::FInstructionApply = typedef ffi::TypedFunction<ffi::Array<Any>(Schedule sch, const ffi::Array<Any>& inputs, const ffi::Array<Any>& attrs, const Any& decision)> |
Type of the functor that applies the instruction to a TensorIR schedule.
| sch | The schedule to be applied on |
| inputs | The input random variables |
| attrs | Instruction attributes |
| decision | Decisions made on the instruction |
| using tvm::s_tir::FInstructionAsPython = typedef ffi::TypedFunction<ffi::String(const ffi::Array<Any>& inputs, const ffi::Array<Any>& attrs, const Any& decision, const ffi::Array<ffi::String>& outputs)> |
Type of the functor that converts the instruction to a statement in python syntax.
| inputs | Names of the input random variables |
| attrs | Instruction attributes |
| decisions | Decisions made on the instruction |
| outputs | Names of the output random variables |
| using tvm::s_tir::FInstructionAttrsAsJSON = typedef ffi::TypedFunction<ffi::ObjectRef(ffi::Array<Any> attrs)> |
Type of the functor that serialize its attributes to JSON.
| attrs | The attributes to be serialized |
| using tvm::s_tir::FInstructionAttrsFromJSON = typedef ffi::TypedFunction<ffi::Array<Any>(ffi::ObjectRef json_attrs)> |
Type of the functor that deserialize its attributes from JSON.
| json_attrs | The attributes to be serialized |
| using tvm::s_tir::FTraceDecisionProvider = typedef ffi::TypedFunction<Any(const Instruction& inst, const ffi::Array<Any>& inputs, const ffi::Array<Any>& attrs, const Any& decision)> |
A callback that allows users to mutate decisions on the fly when applying instructions. The signature of the callback is:
| inst | The instruction |
| inputs | The input random variables |
| attrs | The attributes |
| decision | The original decision |
|
strong |
Type of buffer index.
| Enumerator | |
|---|---|
| kRead | Index of a read buffer. |
| kWrite | Index of a written buffer. |
The bitmask of the debug flag in the ScheduleStateNode.
| Enumerator | |
|---|---|
| kVerifySRefTree | Verify the correctness of the sref tree. |
| kVerifyCachedFlags | Verify the correctness of affine_binding, region_cover and stage_pipeline. |
| ffi::Map< ffi::String, ffi::Map< ffi::String, int64_t > > tvm::s_tir::CalculateAllocatedBytes | ( | const IRModule & | mod | ) |
Calculate the allocated memory per scope in bytes for each function inside the module.
| mod | The IRModule for which the allocated memory size has to be calculated |
| ffi::Map< ffi::String, ffi::Map< ffi::String, int64_t > > tvm::s_tir::CalculateAllocatedBytes | ( | const PrimFunc & | func | ) |
Calculate the allocated memory per scope in bytes needed inside the TIR PrimFunc.
| func | The TIR PrimFunc for which the allocated memory size to be calculated |
Estimate the FLOPs of a TIR fragment.
| stmt | The TIR fragment to be estimated. |
| ffi::Array< tvm::transform::Pass > tvm::s_tir::GetVTCMCompactionPasses | ( | ) |
Get the list of lowering passes to calculate the compacted VTCM allocation size.
| std::optional< MemCpyDetails > tvm::s_tir::IdentifyMemCpy | ( | const For & | loop, |
| const arith::Analyzer & | analyzer | ||
| ) |
Identify whether a For loop is semantically equivalent to MemCpy.
| loop | The loop to be checked |
| analyzer | The analyzer with which to check any algebraic expressions |
Analyze the side effect of a function.
| func | The function to be checked. |
| assert_on_error | If true, an error will be thrown for an impure function. |
| tirx::PrimFunc tvm::s_tir::RenewDefs | ( | const tirx::PrimFunc & | func | ) |
Renew the definition nodes for a TIR, including Var, Buffer and IterVar. This pass works as a simple DeepCopy to duplicate a function with different Vars and Buffers but the same behavior.
| func | The input PrimFunc. |
| bool tvm::s_tir::VerifyGPUCode | ( | const PrimFunc & | func, |
| ffi::Map< ffi::String, PrimExpr > | constraints | ||
| ) |
Verify the correctness of a GPU code.
| func | The function to be checked. |
| constraints | The dict to specify constraints to check. |
Verifies that the VTCM usage for all prim_funcs in the given IRModule.
| mod | The module to be checked. |
| limit | The limit to check. |