logo
  • Community
  • Download
  • Docs
  • GitHub
  • Apache Homepage
  • License
  • Sponsorship
  • Security
  • Thanks
  • Events
  • Apache Homepage
  • License
  • Sponsorship
  • Security
  • Thanks
  • Events
tvm

Getting Started

  • Overview
  • Installing TVM
  • Quick Start
  • IRModule

How To

  • Importing Models from ML Frameworks
  • End-to-End Optimize Model
  • Customize Optimization
  • Optimize Large Language Model
  • Cross Compilation and RPC
  • Export and Load Relax Executables
  • Development Guides

Deep Dive

  • Design and Architecture
  • TensorIR
  • Relax
    • Graph Abstraction for ML Models
    • Understand Relax Abstraction
    • Dataflow Pattern Language (DPL)
    • Relax Creation
    • Transformation

API Reference

  • Python API
  • Other APIs

About

  • Contributor Guide
  • Publications
  • Security Guide

Index

  • Index
Table of Contents
  • Docs >
  • Relax
  • Edit on GitHub

Relax

Relax is a high-level abstraction for graph optimization and transformation in Apache TVM stack. Additionally, Apache TVM combines Relax and TensorIR together for cross-level optimization. Hence, Relax is usually working closely with TensorIR for representing and optimizing the whole IRModule

  • Graph Abstraction for ML Models
    • What is Graph Abstraction?
    • Key Features of Relax
  • Understand Relax Abstraction
    • End to End Model Execution
    • Key Elements of Relax
  • Dataflow Pattern Language (DPL)
    • Building Patterns
    • Matching Without Rewriting
    • Rewriting Matched Patterns
    • Using DPL in Compiler Passes
    • Quick Reference
  • Relax Creation
    • Create Relax programs using TVMScript
    • Create Relax programs using NNModule API
    • Create Relax programs using Block Builder API
    • Summary
  • Transformation
    • Apply transformations
    • Custom Passes
    • Summary
Next Previous
backtop
© 2026 Apache Software Foundation | All rights reserved
Copyright © 2026 The Apache Software Foundation. Apache TVM, Apache, the Apache feather, and the Apache TVM project logo are either trademarks or registered trademarks of the Apache Software Foundation.