Efficient GPU programming is crucial for achieving high performance in deep learning (DL) applications. The performance of GPU programs depends on how data is parallelized across threads and arranged within memory subsystems. The mapping functions describing tensors on GPUs are known as \emph{tensor layouts}. Low-level programming frameworks, such as CUTLASS and Hidet, provide expressive layout abstractions but often require \emph{considerable programming effort} to manually specify optimal layouts. High-level GPU programming languages, such as Triton, rely on compiler heuristics to generate dataflow, layouts, and pipelining strategies in GPU programs. However, the heuristics for dataflow and pipelining strategies are not generalizable to complex operators. To balance expressiveness and programmability, we propose Hexcute, a compiler framework that automates layout synthesis while providing explicit control over dataflow and pipelining. Hexcute formalizes layout synthesis as a constraint programming problem and solves it with a type-inference-based algorithm. This approach enables systematic exploration of optimal layouts and instructions. Our evaluation shows that Hexcute matches the performance of libraries like cuBLAS and FlashAttention on GEMM, Attention, and their variants, while reducing the amount of code by 1.27$\times$-7.94$\times$ compared to CUTLASS. For mixed-type mixture-of-experts (MoE) operators, Hexcute achieves an average speedup of 6.46$\times$ over Triton. In the end-to-end evaluations of vLLM, Hexcute delivers up to 2.60$\times$ speedup on DeepSeek-R1-AWQ and 2.04$\times$ on a Mamba-based model.


翻译:高效GPU编程对于实现深度学习应用的高性能至关重要。GPU程序的性能取决于数据在线程间的并行化方式以及在内存子系统中的组织方式。描述GPU上张量的映射函数被称为\emph{张量布局}。诸如CUTLASS和Hidet等底层编程框架提供了富有表达力的布局抽象,但通常需要\emph{大量的编程工作}来手动指定最优布局。诸如Triton等高级GPU编程语言则依赖编译器启发式方法来生成GPU程序中的数据流、布局和流水线策略。然而,针对数据流和流水线策略的启发式方法难以推广到复杂算子。为了在表达力和可编程性之间取得平衡,我们提出了Hexcute,一个自动化布局合成同时提供对数据流和流水线显式控制的编译器框架。Hexcute将布局合成形式化为一个约束编程问题,并通过基于类型推断的算法进行求解。该方法能够系统地探索最优布局和指令。我们的评估表明,Hexcute在GEMM、Attention及其变体上达到了与cuBLAS和FlashAttention等库相当的性能,同时与CUTLASS相比减少了1.27$\times$-7.94$\times$的代码量。对于混合类型专家混合(MoE)算子,Hexcute相比Triton实现了平均6.46$\times$的加速。在vLLM的端到端评估中,Hexcute在DeepSeek-R1-AWQ上实现了最高2.60$\times$的加速,在基于Mamba的模型上实现了2.04$\times$的加速。

0
下载
关闭预览

相关内容

TensorFlowLite:端侧机器学习框架
专知会员服务
33+阅读 · 2020年8月27日
盘点来自工业界的GPU共享方案
计算机视觉life
12+阅读 · 2021年9月2日
Github热门图深度学习(GraphDL)源码与框架
新智元
21+阅读 · 2019年3月19日
<好书推荐> -《Pro Deep Learning with TensorFlow》分享
深度学习与NLP
12+阅读 · 2018年9月13日
深度学习的GPU:深度学习中使用GPU的经验和建议
数据挖掘入门与实战
11+阅读 · 2018年1月3日
干货| PyTorch相比TensorFlow,存在哪些自身优势?
全球人工智能
15+阅读 · 2017年10月4日
Caffe 深度学习框架上手教程
黑龙江大学自然语言处理实验室
14+阅读 · 2016年6月12日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
VIP会员
相关VIP内容
TensorFlowLite:端侧机器学习框架
专知会员服务
33+阅读 · 2020年8月27日
相关资讯
盘点来自工业界的GPU共享方案
计算机视觉life
12+阅读 · 2021年9月2日
Github热门图深度学习(GraphDL)源码与框架
新智元
21+阅读 · 2019年3月19日
<好书推荐> -《Pro Deep Learning with TensorFlow》分享
深度学习与NLP
12+阅读 · 2018年9月13日
深度学习的GPU:深度学习中使用GPU的经验和建议
数据挖掘入门与实战
11+阅读 · 2018年1月3日
干货| PyTorch相比TensorFlow,存在哪些自身优势?
全球人工智能
15+阅读 · 2017年10月4日
Caffe 深度学习框架上手教程
黑龙江大学自然语言处理实验室
14+阅读 · 2016年6月12日
相关基金
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员