[Paper Review] Tensor Program Optimization with Probabilistic Programs
MetaSchedule introduces a domain-specific probabilistic programming language to modularly construct rich search spaces for tensor program optimization, enabling domain experts to easily extend optimization techniques. It achieves 48% faster inference on end-to-end deep learning workloads compared to TVM by composing hardware-specific transformation modules with learning-driven search.
Automatic optimization for tensor programs becomes increasingly important as we deploy deep learning in various environments, and efficient optimization relies on a rich search space and effective search. Most existing efforts adopt a search space which lacks the ability to efficiently enable domain experts to grow the search space. This paper introduces MetaSchedule, a domain-specific probabilistic programming language abstraction to construct a rich search space of tensor programs. Our abstraction allows domain experts to analyze the program, and easily propose stochastic choices in a modular way to compose program transformation accordingly. We also build an end-to-end learning-driven framework to find an optimized program for a given search space. Experimental results show that MetaSchedule can cover the search space used in the state-of-the-art tensor program optimization frameworks in a modular way. Additionally, it empowers domain experts to conveniently grow the search space and modularly enhance the system, which brings 48% speedup on end-to-end deep learning workloads.
Motivation & Objective
- To decouple search space construction from search algorithms in automatic tensor program optimization.
- To enable domain experts to incrementally grow and customize optimization search spaces without modifying core frameworks.
- To develop a learning-driven framework that finds optimized tensor programs using the constructed search space.
- To achieve competitive or superior performance compared to state-of-the-art systems like TVM and PyTorch on diverse hardware backends.
- To demonstrate that modular, composable search space construction leads to measurable performance gains in real-world deep learning workloads.
Proposed method
- Represent the search space as a probabilistic program that models stochastic choices in program transformations.
- Allow domain experts to define modular transformation rules as probabilistic programs that can be composed.
- Use a differentiable search algorithm to explore the probabilistic search space and find low-latency tensor programs.
- Compose multiple transformation modules (e.g., loop tiling, vectorization, tensorization) into a unified search space.
- Integrate hardware-specific modules (e.g., Use-Tensor-Core) to exploit specialized hardware primitives like GPU tensor cores.
- Build an end-to-end system that supports automatic tuning across CPU and GPU platforms with minimal framework-level changes.
Experimental results
Research questions
- RQ1Can a probabilistic programming abstraction effectively decouple search space construction from search in tensor program optimization?
- RQ2How expressive is the proposed abstraction in covering optimization techniques used in state-of-the-art frameworks like TVM and PyTorch?
- RQ3To what extent can modular composition of transformation rules improve optimization performance?
- RQ4Can the framework achieve competitive or better performance than existing systems on end-to-end deep learning models?
- RQ5How efficiently can domain experts extend the search space with hardware-specific optimizations?
Key findings
- MetaSchedule achieves performance on par with or better than TVM (Ansor) across a diverse set of operators on both CPU and GPU.
- On end-to-end deep learning models, MetaSchedule matches or exceeds TVM and PyTorch performance, with 48% speedup on BERT-Large when using a hardware-specific module.
- The introduction of a 82-line hardware-specific module, crafted in two days, delivered a 48% performance gain over TVM (AutoTVM), demonstrating high practicality of customization.
- Gradual composition of transformation modules leads to consistent performance improvements, showing that modularity enables scalable search space growth.
- MetaSchedule’s search space is expressive enough to cover the optimization space of existing frameworks without requiring surgical changes to the underlying system.
- The framework enables efficient collaboration between domain experts and learning-based search, significantly reducing the effort to incorporate new optimization techniques.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.