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

利用学生并行性实现在线服务中类BERT模型的高效GPU推理

Exploiting Student Parallelism for Efficient GPU Inference of BERT-like Models in Online Services

Tencent(腾讯);Hong Kong University of Science and Technology(香港科技大学);Xiamen University(厦门大学);Macau University of Science and Technology(澳门科技大学);Zhongguancun Lab.(中关村实验室)

Weiyan Wang, Yilun Jin, Yiming Zhang, Victor Junqiu Wei, Han Tian, Li Chen, Jinbao Xue, Yangyu Tao, Di Wang, Kai Chen

AI总结:

本文提出\sys,通过堆叠蒸馏、提升集成与自适应学生剪枝,将深层类BERT模型转化为并行浅层学生模型,在保持精度的同时显著降低在线GPU推理延迟并提升突发负载吞吐量。

摘要:

由于高精度,类BERT模型已被文本挖掘和网络搜索广泛采用。然而,大型类BERT模型存在在线推理效率低下的问题,在GPU上面临以下两个问题:(1)其高精度依赖于较大的模型深度,这会线性增加GPU上的串行计算;(2)随机且动态的在线工作负载会带来批处理和填充造成的额外成本。因此,我们针对在线工作负载上GPU推理的真实场景提出了\sys。其核心是,\sys采用堆叠蒸馏和提升集成,将原始深度模型蒸馏为一组较浅但实际上堆叠起来的学生模型,并并行运行。这使\sys能够实现比其他方法更低的模型深度(例如两层)和最低的推理延迟,同时保持精度。此外,自适应学生剪枝可根据不断变化的在线工作负载实现动态学生数量。特别是对于偶发的工作负载突发,它可以以最小的精度损失临时减少学生数量,以提高系统吞吐量。我们进行了全面实验以验证其有效性,结果表明,\sys在保持精度的同时,延迟方面比基线优$4.1\times\sim1.6\times$,并在工作负载突发时实现最高$22.27\times$的吞吐量提升。

英文摘要:

Due to high accuracy, BERT-like models have been widely adopted by text mining and web searching. However, large BERT-like models suffer from inefficient online inference, facing the following two problems on GPUs: (1) their high accuracy relies on the large model depth, which linearly increases the sequential computation on GPUs; (2) stochastic and dynamic online workloads cause extra costs from batching and paddings. Therefore, we present \sys for the real-world setting of GPU inference on online workloads. At its core, \sys adopts stacking distillation and boosting ensemble, distilling the original deep model into a group of shallow but virtually stacked student models running in parallel. This enables \sys to achieve a lower model depth (e.g., two layers) than the others and the lowest inference latency while maintaining accuracy. In addition, adaptive student pruning realizes dynamic student numbers according to changing online workloads. Especially for occasional workload bursts, it can temporarily decrease the student number with minimal accuracy loss to improve system throughput. We conduct comprehensive experiments to verify the effectiveness, whose results show that \sys outperforms the baselines by $4.1\times\sim 1.6\times$ in latency while maintaining accuracy and achieves up to $22.27\times$ higher throughput for workload bursts.

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

↑