tvm_tirx.tirx#
Tensor-level IR nodes, layouts, operators, analysis, and compilation.
Namespaces#
Classes#
|
The shape, element type, and storage contract of a TIRx tensor expression. |
|
The type of a tensor-map descriptor used by backend memory operations. |
|
A TIRx function definition or declaration. |
|
Map input index variables to expressions for output indices. |
|
Ordered launch tags for an explicit FFI kernel call. |
|
A registered thread scope, queried by its qualified backend.scope name. |
|
Map logical indices to memory and ownership coordinates using strided factors. |
|
Base class for mappings from logical indices to named physical axes. |
|
Apply an XOR swizzle to the memory coordinate of a tile layout. |
Alias |
Canonical API |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Additional Structural Visit and Mutate APIs#
Traverse and transform TIRx with the facts available at each use.
Callbacks receive a tvm_tirx.sym.ConstraintContext: iterate it to read facts,
or use list(context) to retain an independent list. Bind/Assert add facts for
later statements; If/While/lazy calls add guards, For/thread launch add ranges,
and Let adds a body binding. Mutation uses the transformed values.
Call and RegionStmt use registered operator hooks; other calls follow ordinary
descent, and other regions isolate their body facts.
Callbacks control descent. Normal exits and interrupts restore outer facts; errors propagate without restoration, so discard the traversal after failure. The C++ structural visitor and mutator docs describe the full collection rules.
See also
tvm_ffi.structural, the TVM-FFI utilities these variants build on.
Visits values using their structural visit behavior while maintaining the constraint context relevant to each callback. |
|
Mutates values using their structural mutation behavior while maintaining the constraint context relevant to each callback. |
|
Walk a value structurally with its active symbolic facts. |
|
Visit a value structurally with a callback that owns child traversal. |
|
|
Structurally map a value with its active symbolic facts. |
Mutate a value with a callback that owns recursive mutation. |
Functions#
Use tvm_tirx.compile() as the public entry point for building programs.
tvm_tirx.tirx.compile remains available as its implementation entry point.
|
Project a tensor variable's physical pointer. |
|
Return whether |
|
Renew variable definitions and remap their uses in a function. |
|
Lowered version of call packed. |
|
Lowered version of call c-packed. |
|
Register Op lowering function |
|
Build expression by call an external packed function. |
|
Build expression by call an external packed function. |
|
Build expression by calling an intrinsic function. |
|
Build expression by calling a pure extern function. |
|
Build expression by calling a extern function. |
|
Call a kernel with its symbol, kernel operands, then launch values. |
|
Build expression by calling a llvm intrinsic function |
|
Build expression by calling a pure llvm intrinsic function |
|
Return new on stack dtype[num] |
|
Allocate a shape tuple on stack, return the handle |
|
Allocate a Tensor(DLTensor) on stack, return the handle |
|
Add offset to handle |
|
Get struct field value in array |
|
Set value in struct field in array |
|
Returns the address of a tensor element or addressable variable. |
|
Assume the tensor's base address is aligned to |
|
Guarantee a predicate throughout its containing scope, including mutations. |
|
Returns an initialized but arbitrary value |
|
Perform an all-reduce inside a thread block. |
|
Return |
|
Throw TVMGetLastError() |
|
Synchronize all workers in the current CPU parallel launch. |
|
TVM intrinsic for tensor core load operators |
|
TVM intrinsic for tensor core store operators |
|
TVM intrinsic for tensor core mma_sync operators |
|
TVM intrinsic for tensor core fill_fragment operators |
|
Get the low level half of the vector |
|
Get the high level half of the vector |
|
Concat two vectors |
|
Reinterpret a value as an exact primitive or pointer type. |
|
Check if input value is nullptr. |
|
Compute the logaddexp of two expressions. |
|
Backend function to allocate temporal workspace |
|
Backend function to free temporal workspace. |
|
Calculate a predicate mask given an upper bound (limit) and a current value (base). |
|
Create a datatype dependent scalable expression. |
|
Dot product of two int8x4 vectors and add an optional accumulator |
|
Annotate a predicate not be considered as target condition of loop partition. |
|
Compile a function or module to an executable for the target. |
|
Construct a registered pipeline by name. |
|
Select the default pipeline for the input module and target. |
|
Register a factory returning lowering and host/device finalization stages. |
Alias |
Canonical API |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|