We introduce Mirage Persistent Kernel (MPK), the first compiler and runtime system that automatically transforms multi-GPU model inference into a single high-performance megakernel. MPK introduces an SM-level graph representation that captures data dependencies at the granularity of individual streaming multiprocessors (SMs), enabling cross-operator software pipelining, fine-grained kernel overlap, and other previously infeasible GPU optimizations. The MPK compiler lowers tensor programs into highly optimized SM-level task graphs and generates optimized CUDA implementations for all tasks, while the MPK in-kernel parallel runtime executes these tasks within a single mega-kernel using decentralized scheduling across SMs. Together, these components provide end-to-end kernel fusion with minimal developer effort, while preserving the flexibility of existing programming models. Our evaluation shows that MPK significantly outperforms existing kernel-per-operator LLM serving systems by reducing end-to-end inference latency by up to 1.7x, pushing LLM inference performance close to hardware limits. MPK is publicly available at https://github.com/mirage-project/mirage.


翻译:本文提出幻影持久内核(MPK),这是首个能够将多GPU模型推理自动转换为单一高性能巨型内核的编译器与运行时系统。MPK引入了一种SM级图表示方法,该表示以单个流式多处理器(SM)为粒度捕获数据依赖关系,从而实现了跨算子软件流水线、细粒度内核重叠以及其他先前难以实现的GPU优化。MPK编译器将张量程序降级为高度优化的SM级任务图,并为所有任务生成优化的CUDA实现;同时,MPK内核内并行运行时通过跨SM的分布式调度,在单个巨型内核内执行这些任务。这些组件共同提供了端到端的内核融合,且对开发者工作量要求极低,同时保留了现有编程模型的灵活性。我们的评估表明,MPK显著优于现有的按算子内核化LLM服务系统,端到端推理延迟最高可降低1.7倍,将LLM推理性能推向硬件极限。MPK已在https://github.com/mirage-project/mirage 公开提供。

0
下载
关闭预览

相关内容

编译器(Compiler),是一种计算机程序,它会将用某种编程语言写成的源代码(原始语言),转换成另一种编程语言(目标语言)。
AAAI 2022 | ProtGNN:自解释图神经网络
专知
10+阅读 · 2022年2月28日
【NeurIPS2019】图变换网络:Graph Transformer Network
RNN | RNN实践指南(2)
KingsGarden
19+阅读 · 2017年5月4日
国家自然科学基金
1+阅读 · 2016年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
46+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
VIP会员
相关资讯
AAAI 2022 | ProtGNN:自解释图神经网络
专知
10+阅读 · 2022年2月28日
【NeurIPS2019】图变换网络:Graph Transformer Network
RNN | RNN实践指南(2)
KingsGarden
19+阅读 · 2017年5月4日
相关基金
国家自然科学基金
1+阅读 · 2016年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
46+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员