arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1904.07404cs.LGcs.PLstat.ML
收藏

swTVM:在双威众核处理器上实现用于深度学习的优化张量代码生成

swTVM: Towards Optimized Tensor Code Generation for Deep Learning on Sunway Many-Core Processor

Beihang University(北京航空航天大学);National University of Singapore(新加坡国立大学);Tsinghua University(清华大学)

Mingzhen Li, Changxi Liu, Jianjin Liao, Xuegui Zheng, Hailong Yang, Rujun Sun, Jun Xu, Lin Gan, Guangwen Yang, Zhongzhi Luan, Depei Qian

摘要:

深度学习框架和硬件平台的蓬勃发展一直要求高效的编译器能够屏蔽软件和硬件的多样性,以提供应用程序的可移植性。在现有的深度学习编译器中,TVM以其在不同硬件设备上的代码生成和优化效率而闻名。与此同时,Sunway众核处理器凭借其在科学计算和深度学习工作负载方面的诱人计算能力,成为一个有竞争力的候选者。本文结合这两个方向的趋势。具体来说,我们提出了swTVM,扩展了原来的TVM,以支持提前编译的架构,需要交叉编译,如Sunway。此外,我们在编译过程中利用了架构特性,例如用于大规模并行的核心组,用于高带宽内存传输的DMA和用于数据局部性的本地设备内存,以便为Sunway上的深度学习工作负载生成高效的代码。实验结果表明,在六个有代表性的基准测试中,与Sunway上最先进的深度学习框架相比,swTVM生成的代码平均达到1.79倍。这项工作是第一次尝试从编译器的角度来弥合深度学习和Sunway处理器的差距,特别是考虑到生产力和效率。我们相信这项工作将鼓励更多的人接受深度学习和神威众核处理器的力量。

英文摘要:

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 existing 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 computing and deep learning workloads. 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 codes for deep learning workloads on Sunway. The experiment results show that the codes generated by swTVM achieves 1.79x on average compared to the state-of-the-art deep learning framework on Sunway, across six representative benchmarks. This work is the first attempt from the compiler perspective to bridge the gap of deep learning and Sunway processor particularly with productivity and efficiency in mind. We believe this work will encourage more people to embrace the power of deep learning and Sunway many-core processor.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑