Skip to main content
QUICK REVIEW

[论文解读] Hardware-Guided Symbiotic Training for Compact, Accurate, yet Execution-Efficient LSTM

Hongxu Yin, Guoyang Chen|arXiv (Cornell University)|Jan 30, 2019
Advanced Neural Network Applications参考文献 32被引用 8
一句话总结

本文提出了一种硬件引导的共生训练方法,用于长短期记忆(LSTM)网络,通过利用现代硬件上的延迟滞留效应(LHE)——即模型大小与推理延迟之间非单调的关系——联合优化模型紧凑性、准确性和推理效率。通过结合多粒度的生长-剪枝算法与硬件感知的架构搜索,该方法在不损失准确率的前提下,使CPU上的参数量减少高达30.5倍、延迟降低5.2倍,同时在语音识别任务中提升了准确率。

ABSTRACT

Many long short-term memory (LSTM) applications need fast yet compact models. Neural network compression approaches, such as the grow-and-prune paradigm, have proved to be promising for cutting down network complexity by skipping insignificant weights. However, current compression strategies are mostly hardware-agnostic and network complexity reduction does not always translate into execution efficiency. In this work, we propose a hardware-guided symbiotic training methodology for compact, accurate, yet execution-efficient inference models. It is based on our observation that hardware may introduce substantial non-monotonic behavior, which we call the latency hysteresis effect, when evaluating network size vs. inference latency. This observation raises question about the mainstream smaller-dimension-is-better compression strategy, which often leads to a sub-optimal model architecture. By leveraging the hardware-impacted hysteresis effect and sparsity, we are able to achieve the symbiosis of model compactness and accuracy with execution efficiency, thus reducing LSTM latency while increasing its accuracy. We have evaluated our algorithms on language modeling and speech recognition applications. Relative to the traditional stacked LSTM architecture obtained for the Penn Treebank dataset, we reduce the number of parameters by 18.0x (30.5x) and measured run-time latency by up to 2.4x (5.2x) on Nvidia GPUs (Intel Xeon CPUs) without any accuracy degradation. For the DeepSpeech2 architecture obtained for the AN4 dataset, we reduce the number of parameters by 7.0x (19.4x), word error rate from 12.9% to 9.9% (10.4%), and measured run-time latency by up to 1.7x (2.4x) on Nvidia GPUs (Intel Xeon CPUs). Thus, our method yields compact, accurate, yet execution-efficient inference models.

研究动机与目标

  • 解决当前神经网络压缩方法缺乏硬件感知的问题,这些方法虽减少了模型大小,但往往无法提升执行效率。
  • 探究硬件特定的非单调行为——特别是延迟滞留效应(LHE)——对模型大小、准确率与推理延迟之间权衡的影响。
  • 开发一种训练方法,通过利用受硬件影响的LHE和结构化稀疏性,共生优化模型紧凑性、推理准确率与执行效率。
  • 在真实世界的自然语言处理与语音识别工作负载中,在GPU和CPU上均优于现有方法,在参数量、准确率与运行时延迟三个维度上实现全面超越。

提出的方法

  • 该方法从一个稀疏的初始架构开始,应用结构化的生长-剪枝过程,通过硬件特定的延迟测量进行迭代优化。
  • 引入一种硬件引导的架构搜索,以识别不同硬件平台下的最优隐藏层维度(LHPs),避免次优设计点。
  • 在权重和层两个粒度上应用多粒度剪枝,剪枝比率根据硬件反馈动态调整,以在保持准确率的同时最大化效率。
  • 利用延迟滞留效应(LHE)——即由于低效的内存访问或内核启动开销,更小的模型反而可能更慢——来规避此类性能陷阱。
  • 在GPU推理中,通过维度缩减以适配硬件优化的矩阵大小(如626/626),在各类GPU上实现2%至30%的延迟降低。
  • 在CPU推理中,最大化权重稀疏性(最高达94.2%),而不进行维度缩减,以充分利用Intel MKL的稀疏内核加速,实现额外1.4倍的延迟降低。

实验结果

研究问题

  • RQ1硬件影响下的延迟滞留效应(LHE)如何影响LSTM中模型大小与推理延迟之间的关系?
  • RQ2硬件引导的训练策略能否避免那些尺寸小但执行效率低下的次优模型架构?
  • RQ3在真实硬件延迟反馈的引导下,多粒度的生长-剪枝算法在多大程度上能改善LSTM中紧凑性、准确率与执行效率的共生关系?
  • RQ4结构化剪枝与硬件感知的维度调优相结合,如何影响GPU和CPU上的推理速度与模型准确率?
  • RQ5在CPU上能否有效利用高权重稀疏性,借助Intel MKL等优化库实现性能提升?其带来的性能增益如何?

主要发现

  • 在Penn Treebank语言建模任务中,该方法在Nvidia GPU上使参数量减少18.0倍、延迟降低最多2.4倍;在Intel Xeon CPU上分别实现30.5倍和5.2倍的减少,且无准确率下降。
  • 在AN4语音识别任务中,该方法在GPU上使参数量减少7.0倍、延迟降低最多1.7倍;在CPU上分别实现19.4倍和2.4倍的减少,同时将词错误率(WER)从12.9%降低至9.9%(GPU)和10.4%(CPU)。
  • 语音识别任务的最终CPU推理模型仅含260万个参数(压缩19.4倍),在Intel Broadwell CPU上实现54.8%的延迟降低(2.2倍加速),WER为10.37%,比基线模型提升2.53%。
  • 在语言建模任务中,该方法在CPU上实现最高5.2倍的延迟降低,在GPU上实现2.4倍的延迟降低,表明硬件感知设计可带来远超单纯参数压缩的效率增益。
  • 通过在CPU上避免维度缩减并最大化稀疏性至94.2%,该方法充分挖掘了Intel MKL稀疏内核加速的优势,贡献了约2倍的加速,其余1.1倍加速来自H-LSTM单元的优化。
  • 该方法成功避开了次优设计点,将有效模型架构搜索空间缩小高达90%,并在紧凑性、准确率与执行效率三个指标上全面超越先前工作。

更好的研究,从现在开始

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

无需绑定信用卡

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