The Four Core Abstractions Powering TVM Unity's IR

TVM Unity's unified IR is built upon four key components: Relax for computational graphs, TensorIR for loop-level tensor programs, FFI for external interfaces, and MetaSchedule for automated tuning, all integrated within a single IRModule.

The top 3

  1. Relax vs. TensorIR: TVM Unity's Dual IR Powerhouses: Relax functions as the high-level computational graph IR, crucial for symbolic shape support and whole-graph optimizations, while TensorIR is the low-level tensor program IR, detailing loops and hardware acceleration. This dual approach in TVM Unity enables fluid cross-layer interactions for comprehensive optimization.
  2. Relax's Evolution: Overcoming Relay's Limitations: Relax, as the successor to Relay, was developed to tackle critical challenges like dynamic shape support and rigid compilation pipelines in machine learning workloads. It introduces first-class symbolic shape capabilities and integrates seamlessly with Tensor Expression (TE) for efficient operator lowering, enabling more adaptable and performant ML compilation.
  3. The IRModule: TVM Unity's Central Abstraction Integrator: The `IRModule` serves as the central abstraction in TVM Unity, uniquely capable of encapsulating both high-level computational graph IR (Relax) and low-level tensor program IR (TensorIR). This unified container is key to enabling cross-layer transformations and optimizations, making the entire compilation flow more customizable and accessible for diverse ML workloads.

Sources

Open the full topic