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

基于硬件设计和模型压缩协同优化的Transformer加速框架

Accelerating Framework of Transformer by Hardware Design and Model Compression Co-Optimization

East China Normal University(华东师范大学);University of Connecticut(康涅狄格大学);Northeastern University(东北大学)

Panjie Qi, Edwin Hsing-Mean Sha, Qingfeng Zhuge, Hongwu Peng, Shaoyi Huang, Zhenglun Kong, Yuhong Song, Bingbing Li

摘要:

现有的基于Transformer的模型参数庞大,难以在资源受限的嵌入式设备上实现。而且,随着技术的发展,越来越多的嵌入式设备可以运行Transformer模型。对于具有不同约束(紧或松)的Transformer模型,可以将其部署到具有不同计算能力的设备上。然而,在以前的工作中,设计人员没有在多个设备中选择最佳设备。相反,他们只是使用现有的设备来部署模型,这不一定是最适合的,并且可能导致资源利用不足。为了解决Transformer的部署挑战和选择最佳设备的问题,我们提出了一种算法和硬件闭环加速框架。给定一个数据集,一个模型,延迟约束LC和精度约束AC,我们的框架可以提供一个最好的设备满足这两个约束。为了生成具有高稀疏率的压缩模型,我们提出了一种新的剪枝技术,层次剪枝(HP)。我们优化了HP矩阵的稀疏矩阵存储格式,以进一步减少FPGA实现的内存使用。我们设计了一个加速器,利用惠普解决并发随机访问的问题。在Transformer和TinyBert模型上的实验表明,该框架可以为各种LC和AC找到不同的设备,覆盖从低端设备到高端设备。我们的HP可以实现更高的稀疏率,比其他稀疏模式更灵活。与CPU、GPU和FPGA相比,我们的框架可以分别实现37倍、1.9倍和1.7倍的加速比。

英文摘要:

State-of-the-art Transformer-based models, with gigantic parameters, are difficult to be accommodated on resource constrained embedded devices. Moreover, with the development of technology, more and more embedded devices are available to run a Transformer model. For a Transformer model with different constraints (tight or loose), it can be deployed onto devices with different computing power. However, in previous work, designers did not choose the best device among multiple devices. Instead, they just used an existing device to deploy model, which was not necessarily the best fit and may lead to underutilization of resources. To address the deployment challenge of Transformer and the problem to select the best device, we propose an algorithm & hardware closed-loop acceleration framework. Given a dataset, a model, latency constraint LC and accuracy constraint AC, our framework can provide a best device satisfying both constraints. In order to generate a compressed model with high sparsity ratio, we propose a novel pruning technique, hierarchical pruning (HP). We optimize the sparse matrix storage format for HP matrix to further reduce memory usage for FPGA implementation. We design a accelerator that takes advantage of HP to solve the problem of concurrent random access. Experiments on Transformer and TinyBert model show that our framework can find different devices for various LC and AC, covering from low-end devices to high-end devices. Our HP can achieve higher sparsity ratio and is more flexible than other sparsity pattern. Our framework can achieve 37x, 1.9x, 1.7x speedup compared to CPU, GPU and FPGA, respectively.

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

↑