Mirage: A Multi-Level Superoptimizer for Tensor Programs

Mengdi Wu and Xinhao Cheng, Carnegie Mellon University; Shengyu Liu and Chunan Shi, Peking University; Jianan Ji and Man Kit Ao, Carnegie Mellon University; Praveen Velliengiri, Pennsylvania State University; Xupeng Miao, Purdue University; Oded Padon, Weizmann Institute of Science; Zhihao Jia, Carnegie Mellon University

We introduce Mirage, the first multi-level superoptimizer for tensor programs. A key idea in Mirage is µGraphs, a uniform representation of tensor programs at the kernel, thread block, and thread levels of the GPU compute hierarchy. µGraphs enable Mirage to discover novel optimizations that combine algebraic transformations, schedule transformations, and generation of new custom kernels. To navigate the large search space, Mirage introduces a pruning technique based on abstraction that significantly reduces the search space and provides a certain optimality guarantee. To ensure that the optimized µGraph is equivalent to the input program, Mirage introduces a probabilistic equivalence verification procedure with strong theoretical guarantees. Our evaluation shows that Mirage significantly outperforms existing approaches even for DNNs that are widely used and heavily optimized. Mirage is publicly available at https://github.com/mirage-project/mirage.

OSDI '25 Open Access Sponsored by
King Abdullah University of Science and Technology (KAUST)

Open Access Media

USENIX is committed to Open Access to the research presented at our events. Papers and proceedings are freely available to everyone once the event begins. Any video, audio, and/or slides that are posted after the event are also free and open to everyone. Support USENIX and our commitment to Open Access.

BibTeX
@inproceedings {308722,
author = {Mengdi Wu and Xinhao Cheng and Shengyu Liu and Chunan Shi and Jianan Ji and Man Kit Ao and Praveen Velliengiri and Xupeng Miao and Oded Padon and Zhihao Jia},
title = {Mirage: A {Multi-Level} Superoptimizer for Tensor Programs},
booktitle = {19th USENIX Symposium on Operating Systems Design and Implementation (OSDI 25)},
year = {2025},
isbn = {978-1-939133-47-2},
address = {Boston, MA},
pages = {21--38},
url = {https://www.usenix.org/conference/osdi25/presentation/wu-mengdi},
publisher = {USENIX Association},
month = jul
}

Presentation Video