arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2301.01048cs.DCcs.LG
收藏

一种I/O有效的稀疏神经网络推理理论

A Theory of I/O-Efficient Sparse Neural Network Inference

ETH Zürich(苏黎世联邦理工学院)

Niels Gleinig, Tal Ben-Nun, Torsten Hoefler

摘要:

随着机器学习模型的准确性快速提高,它们对能源和计算资源的需求也在快速增长。在低级别上,这些资源的主要部分被不同存储器单元之间的数据移动消耗。现代硬件体系结构包含一种形式的快速存储器(例如,高速缓冲存储器,寄存器),其较小,以及慢速存储器(例如,DRAM),其更大但访问昂贵。我们只能处理存储在快速内存中的数据,这会导致两个单元之间的数据移动(输入/输出操作,或I/O)。本文对稀疏前馈神经网络(FFNN)推理所需的I/O进行了严格的理论分析。我们建立的界限,确定的最佳数量的I/O的一个因素为2,并提出了一种方法,使用的I/O的数量在该范围内。大部分I/O复杂度是由FFNN的一些高级属性(输入、输出、神经元和连接的数量)决定的,但是如果我们想更接近精确的下限,就需要考虑特定于实例的稀疏模式。从2-最优计算策略出发,我们展示了如何使用模拟退火进一步减少I/O的数量。补充这一结果,我们提供了一个算法,建设性地生成网络的最大I/O推理效率。我们测试的算法和经验验证我们的理论和算法的贡献。在我们对真实硬件的实验中,我们观察到相对于执行推理的标准方式,加速高达45 $\times$。

英文摘要:

As the accuracy of machine learning models increases at a fast rate, so does their demand for energy and compute resources. On a low level, the major part of these resources is consumed by data movement between different memory units. Modern hardware architectures contain a form of fast memory (e.g., cache, registers), which is small, and a slow memory (e.g., DRAM), which is larger but expensive to access. We can only process data that is stored in fast memory, which incurs data movement (input/output-operations, or I/Os) between the two units. In this paper, we provide a rigorous theoretical analysis of the I/Os needed in sparse feedforward neural network (FFNN) inference. We establish bounds that determine the optimal number of I/Os up to a factor of 2 and present a method that uses a number of I/Os within that range. Much of the I/O-complexity is determined by a few high-level properties of the FFNN (number of inputs, outputs, neurons, and connections), but if we want to get closer to the exact lower bound, the instance-specific sparsity patterns need to be considered. Departing from the 2-optimal computation strategy, we show how to reduce the number of I/Os further with simulated annealing. Complementing this result, we provide an algorithm that constructively generates networks with maximum I/O-efficiency for inference. We test the algorithms and empirically verify our theoretical and algorithmic contributions. In our experiments on real hardware we observe speedups of up to 45$\times$ relative to the standard way of performing inference.

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

↑