Tensor accelerators now represent a growing share of compute resources in modern CPUs and GPUs. However, they are hard to program, leading developers to use vendor-provided kernel libraries that support tensor accelerators. As a result, the usage of tensor accelerators is limited to the provided interface, mainly designed for traditional ML and scientific computing workloads. In this paper, we show that tensor accelerators can improve the performance of applications beyond simple variants of MatMul. For example, many image processing pipelines are linear transformations over matrices in disguise and can therefore utilize such specialized hardware. This is nonetheless hindered by the difficulties in programming tensor accelerators. We tackle this problem with compiler-based techniques. We use the Halide user-schedulable language and express operations as Halide algorithms succinctly. To this end, we implement a flexible tensor instruction selector based on equality saturation. The tensor instruction selector supports both CPU- and GPU-attached tensor accelerators and works with existing scheduling operations (e.g., producer-consumer fusion). Together, this enables developers to write diverse accelerator-leveraging applications in a few dozen lines. Using our system, we demonstrate the potential of tensor accelerators beyond their traditional domains. We implement several image processing pipelines (e.g., filtering, resampling, and denoising) in our system and evaluate them against non-accelerator-leveraging baselines. We show that these pipelines can achieve significant speedups. For example, a downsampling routine is sped up by $6.1\times$ by utilizing Tensor Cores on an Nvidia RTX 4070 GPU.


翻译:张量加速器在现代CPU和GPU中正占据日益增长的计算资源份额。然而,其编程难度较高,导致开发者通常依赖厂商提供的支持张量加速器的核函数库。因此,张量加速器的使用被限制在预设的接口范围内,这些接口主要针对传统机器学习和科学计算工作负载设计。本文论证了张量加速器能够提升超越矩阵乘法简单变体的应用性能。例如,许多图像处理流水线实质上是矩阵的线性变换,因而可以利用此类专用硬件。但编程张量加速器的困难阻碍了这种应用拓展。我们通过基于编译器的技术解决该问题:采用Halide用户可调度语言,将运算简洁地表达为Halide算法;并实现基于等式饱和的灵活张量指令选择器。该指令选择器同时支持CPU与GPU附属张量加速器,且能与现有调度操作(如生产者-消费者融合)协同工作。由此,开发者可用数十行代码编写多样化的加速器赋能应用。基于本系统,我们展示了张量加速器在传统领域之外的潜力:实现了多个图像处理流水线(如滤波、重采样和去噪),并与未使用加速器的基线方案进行对比评估。实验表明这些流水线能获得显著的加速效果,例如在Nvidia RTX 4070 GPU上利用Tensor Cores使下采样例程实现了$6.1\times$的加速。

0
下载
关闭预览

相关内容

面向向量的机器学习系统:跨栈方法
专知会员服务
11+阅读 · 2025年8月13日
【CMU博士论文】长度可外推的Transformer,149页pdf
专知会员服务
27+阅读 · 2024年6月30日
【博士论文】基于冲量的加速优化算法
专知会员服务
28+阅读 · 2021年11月29日
专知会员服务
13+阅读 · 2019年11月23日
通过集成 XNNPACK 实现推理速度飞跃
TensorFlow
26+阅读 · 2020年7月30日
【边缘智能】边缘计算驱动的深度学习加速技术
产业智能官
20+阅读 · 2019年2月8日
硬件加速神经网络综述
计算机研究与发展
26+阅读 · 2019年2月1日
【优青论文】深度神经网络压缩与加速综述
计算机研究与发展
17+阅读 · 2018年9月20日
谷歌推出新型数据增强算法:AutoAugment
论智
20+阅读 · 2018年6月6日
超全总结:神经网络加速之量化模型 | 附带代码
干货| PyTorch相比TensorFlow,存在哪些自身优势?
全球人工智能
15+阅读 · 2017年10月4日
国家自然科学基金
1+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
VIP会员
相关VIP内容
面向向量的机器学习系统:跨栈方法
专知会员服务
11+阅读 · 2025年8月13日
【CMU博士论文】长度可外推的Transformer,149页pdf
专知会员服务
27+阅读 · 2024年6月30日
【博士论文】基于冲量的加速优化算法
专知会员服务
28+阅读 · 2021年11月29日
专知会员服务
13+阅读 · 2019年11月23日
相关资讯
通过集成 XNNPACK 实现推理速度飞跃
TensorFlow
26+阅读 · 2020年7月30日
【边缘智能】边缘计算驱动的深度学习加速技术
产业智能官
20+阅读 · 2019年2月8日
硬件加速神经网络综述
计算机研究与发展
26+阅读 · 2019年2月1日
【优青论文】深度神经网络压缩与加速综述
计算机研究与发展
17+阅读 · 2018年9月20日
谷歌推出新型数据增强算法:AutoAugment
论智
20+阅读 · 2018年6月6日
超全总结:神经网络加速之量化模型 | 附带代码
干货| PyTorch相比TensorFlow,存在哪些自身优势?
全球人工智能
15+阅读 · 2017年10月4日
相关基金
国家自然科学基金
1+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员