Lune

PLDI2022Top-tier venue

FreeTensor: a free-form DSL with holistic optimizations for irregular tensor programs

Shizhi Tang, Jidong Zhai, Haojie Wang, Lin Jiang, Liyan Zheng, Zhenhao Yuan, Chen Zhang

Abstract

Tensor programs are of critical use in many domains. Existing frameworks, such as PyTorch, TensorFlow, and JAX, adopt operator-based programming to ease programming, increase performance, and perform automatic differentiation. However, as the rapid development of tensor programs, operator-based programming shows significant limitations for irregular patterns since a large amount of redundant computation or memory access is introduced.

In this work, we propose FreeTensor, a free-form domain specific language which supports redundancy-avoid programming by introducing fine-grained control flow. With optimizations including partial evaluation, dependence-aware transformations, and fine-grained automatic differentiation, FreeTensor is able to generate high performance tensor programs on both CPU and GPU. Experiments show a speedup over existing tensor programming frameworks up to 5.10× (2.08× on average) without differentiation, and up to 127.74× (36.26× on average) after differentiation, for typical irregular tensor programs.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

8 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • MAGPY: Compiling Eager Mode DNN Programs by Monitoring Execution States cites Ansor: Generating High-Performance Tensor Programs for Deep Learning
  • MAGPY: Compiling Eager Mode DNN Programs by Monitoring Execution States cites Rammer: Enabling Holistic Deep Learning Compiler Optimizations with rTasks
  • MAGPY: Compiling Eager Mode DNN Programs by Monitoring Execution States cites Hidet: Task-Mapping Programming Paradigm for Deep Learning Tensor Programs
  • MAGPY: Compiling Eager Mode DNN Programs by Monitoring Execution States cites PET: Optimizing Tensor Programs with Partially Equivalent Transformations and Automated Corrections
  • SparseTIR: Composable Abstractions for Sparse Compilation in Deep Learning cites Ansor: Generating High-Performance Tensor Programs for Deep Learning
  • autoGEMM: Pushing the Limits of Irregular Matrix Multiplication on Arm Architectures cites Ansor: Generating High-Performance Tensor Programs for Deep Learning
  • Hidet: Task-Mapping Programming Paradigm for Deep Learning Tensor Programs cites Ansor: Generating High-Performance Tensor Programs for Deep Learning
  • Hidet: Task-Mapping Programming Paradigm for Deep Learning Tensor Programs cites Rammer: Enabling Holistic Deep Learning Compiler Optimizations with rTasks
  • Hidet: Task-Mapping Programming Paradigm for Deep Learning Tensor Programs cites PET: Optimizing Tensor Programs with Partially Equivalent Transformations and Automated Corrections
  • PET: Optimizing Tensor Programs with Partially Equivalent Transformations and Automated Corrections cites Ansor: Generating High-Performance Tensor Programs for Deep Learning
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers8

  1. SparseTIR: Composable Abstractions for Sparse Compilation in Deep LearningZihao Ye, Ruihang Lai, Junru Shao, Tianqi Chen et al.ASPLOS 2023 · 86 citations
  2. Hidet: Task-Mapping Programming Paradigm for Deep Learning Tensor ProgramsYaoyao Ding, Cody Hao Yu, Bojian Zheng, Yizhi Liu et al.ASPLOS 2023 · 27 citations
  3. autoGEMM: Pushing the Limits of Irregular Matrix Multiplication on Arm ArchitecturesDu Wu, Jintao Meng, Wenxi Zhu, Minwen Deng et al.SC 2024 · 14 citations
  4. MAGPY: Compiling Eager Mode DNN Programs by Monitoring Execution StatesChen Zhang, Rongchao Dong, Haojie Wang, Runxin Zhong et al.USENIX ATC 2024 · 5 citations
  5. Mat2Stencil: A Modular Matrix-Based DSL for Explicit and Implicit Matrix-Free PDE Solvers on Structured GridHuanqi Cao, Shizhi Tang, Qianchao Zhu, Bowen Yu et al.OOPSLA 2023 · 4 citations

Builds on4

  1. Soft Rasterizer: A Differentiable Renderer for Image-Based 3D ReasoningShichen Liu, Weikai Chen, Tianye Li, Hao LiICCV 2019 · 789 citations
  2. Ansor: Generating High-Performance Tensor Programs for Deep LearningLianmin Zheng, Chengfan Jia, Minmin Sun, Zhao Wu et al.OSDI 2020 · 551 citations
  3. Rammer: Enabling Holistic Deep Learning Compiler Optimizations with rTasksLingxiao Ma, Zhiqiang Xie, Zhi Yang, Jilong Xue et al.OSDI 2020 · 192 citations
  4. PET: Optimizing Tensor Programs with Partially Equivalent Transformations and Automated CorrectionsHaojie Wang, Jidong Zhai, Mingyu Gao, Zixuan Ma et al.OSDI 2021 · 77 citations

Related papers

  1. Uncovering Nested Data Parallelism and Data Reuse in DNN Computation with FractalTensorSiran Liu, Chengxiang Qi, Ying Cao, Chao Yang et al.SOSP 2024 · 1 citation
  2. Compiling Structured Tensor AlgebraMahdi Ghorbani, Mathieu Huot, Shideh Hashemian, Amir ShaikhhaOOPSLA 2023 · 10 citations
  3. Tensor Program Optimization with Probabilistic ProgramsJunru Shao, Xiyou Zhou, Siyuan Feng, Bohan Hou et al.NeurIPS 2022 · 85 citations
  4. FlexTensor: An Automatic Schedule Exploration and Optimization Framework for Tensor Computation on Heterogeneous SystemSize Zheng, Yun Liang, Shuo Wang, Renze Chen et al.ASPLOS 2020 · 171 citations
  5. A Holistic Functionalization Approach to Optimizing Imperative Tensor Programs in Deep LearningJinming Ma, Xiuhong Li, Zihan Wang, Xingcheng Zhang et al.DAC 2024 · 1 citation
Dusk over the sea between two cliffs drawn in fine vertical lines