一句话:提出 Relax 编译器抽象,以跨层表示与一等符号形状标注优化端到端动态形状机器学习负载。
现代机器学习负载(尤其是大语言模型)广泛依赖动态形状计算,但其在多样后端上的通用部署仍缺乏有效的端到端编译支持。本文提出 Relax——一种面向端到端动态机器学习优化的编译器抽象。Relax 引入跨层抽象,将计算图、循环级张量程序与外部库调用统一在单一表示中,并引入一等符号形状标注,使动态形状计算能够被全局追踪,从而支持形状感知的跨层优化。作者基于该方案构建了端到端编译框架。在 LLM 上的实验表明,Relax 在多种 GPU 上性能与最先进系统相当,并可将新兴模型部署到手机、嵌入式设备与浏览器等更广泛的环境。
Dynamic shape computations have become critical in modern machine learning workloads, especially in emerging large language models. The success of these models has driven the demand for their universal deployment across a diverse set of backend environments. In this paper, we present Relax, a compiler abstraction for optimizing end-to-end dynamic machine learning workloads. Relax introduces a cross-level abstraction that encapsulates computational graphs, loop-level tensor programs, and external library calls in a single representation. Relax also introduces first-class symbolic shape annotations to track dynamic shape computations globally across the program, enabling dynamic shape-aware cross-level optimizations. We build an end-to-end compilation framework using the proposed approach to optimize dynamic shape models. Experimental results on LLMs show that Relax delivers performance competitive with state-of-the-art systems across various GPUs and enables deployment of emerging models to a broader set of emerging environments, including mobile phones, embedded devices, and web browsers.
DOI 原文 · arXiv · PDF(开放获取) · DBLP
@inproceedings{LaiSFLHL0JJ0JCJ25,
title = {Relax: Composable Abstractions for End-to-End Dynamic Machine Learning},
author = {Ruihang Lai and Junru Shao and Siyuan Feng and Steven Lyubomirsky and Bohan Hou and Wuwei Lin and Zihao Ye and Hongyi Jin and Yuchen Jin and Jiawei Liu and Lesheng Jin and Yaxing Cai and Ziheng Jiang and Yong Wu and Sunghyun Park and Prakalp Srivastava and Jared Roesch and Todd C. Mowry and Tianqi Chen},
booktitle = {ASPLOS},
year = {2025},
doi = {10.1145/3676641.3716249}
}