Skip to main content
QUICK REVIEW

[论文解读] swTVM: Exploring the Automated Compilation for Deep Learning on Sunway Architecture

Changxi Liu, Hailong Yang|arXiv (Cornell University)|Apr 16, 2019
Advanced Neural Network Applications参考文献 27被引用 4
一句话总结

swTVM 是对 TVM 的编译器扩展,支持 Sunway 多核架构的提前编译,通过核心组、DMA 和本地内存实现高性能深度学习推理。它在 AlexNet 上相比手写优化的 OpenACC 代码实现了 6.71 倍的加速,在 VGG-19 上实现了 2.45 倍的加速,标志着首个面向 Sunway 的自动化深度学习编译解决方案,兼具高生产力与高效率。

ABSTRACT

The flourish of deep learning frameworks and hardware platforms has been demanding an efficient compiler that can shield the diversity in both software and hardware in order to provide application portability. Among the exiting deep learning compilers, TVM is well known for its efficiency in code generation and optimization across diverse hardware devices. In the meanwhile, the Sunway many-core processor renders itself as a competitive candidate for its attractive computational power in both scientific and deep learning applications. This paper combines the trends in these two directions. Specifically, we propose swTVM that extends the original TVM to support ahead-of-time compilation for architecture requiring cross-compilation such as Sunway. In addition, we leverage the architecture features during the compilation such as core group for massive parallelism, DMA for high bandwidth memory transfer and local device memory for data locality, in order to generate efficient code for deep learning application on Sunway. The experimental results show the ability of swTVM to automatically generate code for various deep neural network models on Sunway. The performance of automatically generated code for AlexNet and VGG-19 by swTVM achieves 6.71x and 2.45x speedup on average than hand-optimized OpenACC implementations on convolution and fully connected layers respectively. This work is the first attempt from the compiler perspective to bridge the gap of deep learning and high performance architecture particularly with productivity and efficiency in mind. We would like to open source the implementation so that more people can embrace the power of deep learning compiler and Sunway many-core processor.

研究动机与目标

  • 为应对在多样化软硬件栈中对可移植、高效深度学习编译日益增长的需求。
  • 弥合深度学习框架与 Sunway 等高性能架构(如其多核处理器)之间的鸿沟。
  • 实现面向 Sunway 的自动化提前编译,该过程需要交叉编译和专用优化。
  • 通过利用核心组、DMA 和本地内存等架构特性,提升 Sunway 上深度学习工作负载的生产力与性能。
  • 提供一个可重用的开源编译器解决方案,支持在 Sunway 系统上高效部署 DNN 模型。

提出的方法

  • 扩展 TVM,增加对 Sunway 多核架构目标的提前编译支持。
  • 引入针对 Sunway 独特编译工作流量身定制的交叉编译能力。
  • 利用核心组抽象,充分挖掘 Sunway 处理单元之间的大规模并行性。
  • 利用 DMA 机制,优化全局内存与本地内存之间的高带宽数据传输。
  • 通过使用本地设备内存实现数据局部性优化,降低延迟并提升带宽利用率。
  • 将架构特定的优化集成到 TVM 的代码生成流水线中,生成高效的底层代码。

实验结果

研究问题

  • RQ1如何扩展深度学习编译器以支持 Sunway 多核架构的特殊编译与执行模型?
  • RQ2在深度神经网络内核中,哪些优化最能有效利用 Sunway 的核心组、DMA 和本地内存?
  • RQ3通过扩展的 TVM 实现的自动化代码生成,能否在性能上达到或超越 Sunway 上的手动优化实现?
  • RQ4自动生成的代码在标准 DNN 模型上的性能与手写调优的 OpenACC 实现相比如何?
  • RQ5统一的编译器栈(如 TVM)在多大程度上能够实现面向新兴高性能架构(如 Sunway)的可移植且高效的深度学习部署?

主要发现

  • swTVM 可成功为 Sunway 架构上的各类深度神经网络模型生成优化代码。
  • 在 AlexNet 上,自动生成的代码在卷积层上相比手写优化的 OpenACC 实现平均实现了 6.71 倍的加速。
  • 在 VGG-19 上,自动生成的代码在全连接层上相比 OpenACC 平均实现了 2.45 倍的加速。
  • 性能提升表明,自动化编译能够有效利用 Sunway 的架构特性,如核心组和 DMA。
  • 结果验证了 swTVM 为 Sunway 上高性能深度学习提供了一条切实可行、高效率的路径,且在关键层上超越了手写优化代码。
  • swTVM 的开源发布促进了更广泛社区的采用,并推动了在 Sunway 多核平台上的深度学习进一步探索。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。