TensorIR: TVM Unity's Core Tensor Program Optimizer
TensorIR represents TVM Unity's middle layer, providing a tensor expression language that enables fine-grained control and optimization of tensor computations. It extends concepts like Halide's compute/schedule separation to generate diverse, optimized program versions for various hardware targets.
The top 3
- TensorIR's 'Block' Redefines Optimization Units: TensorIR introduces the `T.sblock` construct, a fundamental computational unit that encapsulates more detail than traditional loop nests, allowing precise representation and isolation of tensorized computations for optimized scheduling on diverse hardware.
- TensorIR's Performance Edge: Auto-Tensorization for Modern Hardware: TensorIR significantly enhances performance by enabling automatic tensorization, transforming loop programs to efficiently utilize hardware primitives like Tensor Cores. This results in up to 2x faster tuning and superior execution compared to earlier TVM generations less optimized for tensorized hardware.
- TVMScript: The Preferred Way to Define TensorIR Programs: TensorIR programs are primarily authored using TVMScript, a Python dialect embedded in Python's Abstract Syntax Tree, offering a straightforward and compatible method. This modern approach has largely superseded the legacy scheduling methods of Tensor Expression (TE) for defining primitive tensor computations.
Sources
Open the full topic