神经网络架构设计

 2022-07-12 09:07

论文总字数:43341字

摘 要

深度卷积神经网络(CNN)目前是许多现代人工智能应用的基础。传统的神经网络加速器迭代地处理深度卷积神经网络的每一层。然而,这样不但会产生大量的中间数据,而且还必须储存在芯片外的内存中。为了提高神经网络加速器的运算效率,一个优化的调度算法是必要的。

本课题研究并得到了一种面向Thinker2处理器实现任意神经网络的优化调度的通用化算法。在这项工作中,我观察到在CNN加速器的设计空间中存在一个跨卷积层的数据流。通过修改输入数据在芯片上的顺序,可以实现连续CNN层的部分处理,从而在相邻的CNN层之间缓存中间数据。该算法的最优化处理包含两个方面:分块方式最优化和运行模式最优化。分块方式最优化是指该算法可以针对Thinker2处理器的硬件空间自动化地实现神经网络数据量大的层结构的最优分块处理,使得总处理批次最少,效率最优;运行模式最优化是指该算法针对Thinker2处理器的写入读出时间和卷积计算时间自动生成最优运行模式,在该运行模式下运算整个网络用时最少。该算法的优势在于可以自动化地生成除了附带Inception结构的任意神经网络的优化调度方案。

在Visual Studio平台上生成的软件仿真,以运行速度作为核心指标,以机械式不加修整地调度神经网络的速度为基准,采用该优化的调度方案的速度提高13.52%~40.19%。

关键词:深度卷积神经网络,调度算法,Thinker2处理器,通用化

Abstract

Deep convolution neural networks (CNNs) are the foundation of many modern artificial intelligence applications. The traditional neural network accelerator processes each layer of the CNN iteratively. However, this not only produces a lot of intermediate data, but must also be stored in memory outside the chip. In order to improve the efficiency of neural network accelerator, an optimized mapping algorithm is necessary.

The author studies and obtains a generalization algorithm for the optimal mapping of any neural network for Thinker2 Processor. It’s observed that there is a dataflow across the convolutional layers in the design space of the CNN accelerators. By modifying the order of input data on the chip, it can realize the partial processing of the continuous CNN layers, thus caching intermediate data between adjacent CNN layers. The optimization of the algorithm consists of two aspects: block mode optimization and operation mode optimization. Block mode optimization refers that the algorithm automatically realizes the optimal block processing of the layer structure with large amount of neural network data concerning the hardware space of Thinker2 Processor, so that it makes the total processing batch minimum and the efficiency optimal; Operation mode optimization refers that the algorithm automatically generates the optimal operation mode concerning Thinker2 Processor's write period, read period and convolution computation period, where the whole network runs the fastest. The advantage of the algorithm is that it can automatically generate a optimized mapping scheme for any neural network without the Inception structure.

Generated by software simulation on Visual Studio platform, using running speed as the core index, the speed of the neural network with mechanical undressing as the benchmark, the speed of the optimized mapping scheme is increased by 13.52%~40.19%.

KEY WORDS: Deep convolution neural network, mapping algorithm, Thinker2 Processor, generalization

目 录

摘要 I

Abstract II

第一章 绪论 1

1.1 研究背景及意义 1

1.2 深度神经网络 2

1.2.1 深度神经网络概览 2

1.2.2 卷积神经网络(CNN) 3

1.3 主流深度神经网络模型 5

1.4 深度神经网络的硬件实现 13

1.4.1 深度神经网络的硬件瓶颈 13

1.4.2 数据访问模式的改进可能 13

1.4.3 硬件平台:thinker2 14

1.5 映射调度算法的主要问题 15

1.5.1 深度神经网络分块的连续运算 15

1.5.2 映射调度算法的优化点 18

第二章 优化映射调度算法的组成 19

2.1 分块方式优化算法 19

2.1.1 分块方式优化算法原则 19

2.1.2 分块层面与实际输入层面 20

2.1.3 分块输入参数的修正 23

2.1.4 分块方式优化算法原理 26

2.2 运行模式优化算法 28

2.2.1 可连续运行层的判定 28

2.2.2 连续运行时间的计算 29

2.2.3 网络整体运行模式的优化 31

2.3 特殊网络结构的处理 34

2.3.1 分支网络(多输出网络) 34

2.3.2 补白(Padding) 35

2.3.3 ResNet结构 36

2.3.4 小型网络 37

第三章 算法实验结果与分析 38

3.1 软件(算法)的功能验证 38

3.2 小型神经网络测试与分析(Centerface为例) 38

3.3 主流深度神经网络的测试(VGG16为例) 40

3.4 通用大型网络测试与分析 40

3.5 总结 42

致谢 43

参考文献 44

附录 47

绪论

研究背景及意义

深层神经网络(DNN)目前是许多现代人工智能(AI)应用[1]的基础。自从在语音识别[2]和图像识别[3]上的突破应用以来,使用DNN的应用程序的数量激增。这些DNN被用于从自动驾驶汽车[4]中,到检测癌症[5]再到复杂游戏[6]的各种应用。在许多这样的领域中,DNN现在能够超越人类的准确性。DNN的优越性来自于它从原始的感觉数据中提取高级特征的能力,这是通过对大量数据进行统计学习来获得对输入空间进行有效表示的能力。这与早期专家设计的使用手工制作的特性或规则所得来的神经网络不同。然而,DNN的高精确度是以高计算复杂度为代价的。虽然通用计算引擎,特别是图形处理单元(GPU),已经成为许多DNN处理的主要工具,但越来越多的人对DNN专用处理器感兴趣。

由于DNN的流行,许多最近的硬件平台都有针对DNN处理的特殊功能。例如,Intel Knights Landing CPU的特点是专门用于深度学习的矢量指令;NVidia PASCAL GP100 GPU特性为16位浮点(FP16)的算术支持,用于在单个精度核心上执行两个FP16操作,以获得更快的深度学习计算。系统还专门为处理DNN而建立,比如NVidia DGX-1和Facebook’s Big Basin定制DNN服务器[7]。在各种嵌入式系统-芯片(SoC)中,如NVidia Tegra和Samsung Exynos以及FPGA,也演示了DNN的推导。因此,理解特定应用的加速器是如何为DNN设计的是至关重要的,这可以再进一步提高吞吐量和提高能源效率。

剩余内容已隐藏,请支付后下载全文,论文总字数:43341字

您需要先支付 80元 才能查看全部内容!立即支付

该课题毕业论文、开题报告、外文翻译、程序设计、图纸设计等资料可联系客服协助查找;