DISC: A Dynamic Shape Compiler for Machine Learning Workloads
Kai Zhu, Wenyi Zhao, Zhen Zheng et al. · arXiv (Cornell University) · 2021
Many recent machine learning models show dynamic shape characteristics. However, existing AI compiler optimization systems suffer a lot from problems brought by dynamic shape models, including compilation overhead, memory usage, optimization pipeline and deployment complexity. This paper provides a compiler system to natively support optimization for dynamic shape workloads, named DISC. DISC enriches a set of IR to form a fully dynamic shape representation. It generates the runtime flow at compile time to support processing dynamic shape based logic, which avoids the interpretation overhead at runtime and enlarges the opportunity of host-device co-optimization. It addresses the kernel fusion problem of dynamic shapes with shape propagation and constraints collecting methods. This is the first work to demonstrate how to build an end-to-end dynamic shape compiler based on MLIR infrastructure. Experiments show that DISC achieves up to 3.3x speedup than TensorFlow/PyTorch, and 1.8x than Nimble.
Cited by 4 works. doi:10.48550/arxiv.2103.05288 Open-access PDF
Authors
- Kai Zhu
- Wenyi Zhao
- Zhen Zheng
- Tianyou Guo
- Pengzhan Zhao
- Junjie Bai
- Jun Yang
- Xiaoyong Liu
- Lansong Diao
- Wei Lin
References
- PyTorch: An Imperative Style, High-Performance Deep Learning Library
- MXNet: A Flexible and Efficient Machine Learning Library for Heterogeneous Distributed Systems
- TVM: An Automated End-to-End Optimizing Compiler for Deep Learning
- Tensor Comprehensions: Framework-Agnostic High-Performance Machine Learning Abstractions
- MLIR: A Compiler Infrastructure for the End of Moore's Law
- Ansor: Generating High-Performance Tensor Programs for Deep Learning
- Tiramisu: a polyhedral compiler for expressing fast and portable code
- Nimble: Efficiently Compiling Dynamic Neural Networks for Model Inference
- FusionStitching: Boosting Memory Intensive Computations for Deep Learning Workloads