TVM Unity's Three Core Optimization Layers Revealed

TVM Unity achieves its optimization goals through a multi-level IR design, fundamentally comprising Graph-Level IR for model structure, Tensor-Level IR for core tensor computations, and Hardware-Level IR for device-specific adaptations.

The top 3

  1. Relax IR's Dynamic Shape Optimization Lead: Relax, TVM Unity's high-level graph IR, natively supports symbolic shapes, allowing global dynamic shape tracking and optimization across tensor operations and function calls, a significant advancement over prior IRs like Relay.
  2. TensorIR: Fine-Grained Hardware Optimization: TensorIR, TVM Unity's tensor-level IR, focuses on precise loop and hardware acceleration mapping, replacing legacy Tensor Expression schedules. It uses computational blocks for fine-grained optimization, contributing to performance gains up to 2x over Ansor and PyTorch.
  3. Unified IRModule: Cross-Layer Co-Optimization: TVM Unity's core strength is its unified `IRModule`, which seamlessly integrates high-level Relax graphs, low-level TensorIR functions, and external hardware libraries like NVIDIA's CUTLASS. This enables automated, cross-layer co-optimization across the entire ML compilation stack.

Sources

Open the full topic