arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2209.09130cs.LGcs.CL
收藏

SAMP:通过自适应混合精度实现文本处理训练后量化的模型推理工具包

SAMP: A Model Inference Toolkit of Post-Training Quantization for Text Processing via Self-Adaptive Mixed-Precision

Kuaishou Technology(快手科技);Peking University(北京大学);Tencent AI Lab(腾讯人工智能实验室);Institute of Dataspace, Hefei Comprehensive National Science Center(合肥综合性国家科学中心数据空间研究院)

Rong Tian, Zijing Zhao, Weijie Liu, Haoyan Liu, Weiquan Mao, Zhe Zhao, Kan Zhou

AI总结:

本文提出 SAMP 自适应混合精度训练后量化工具包,可自动平衡文本模型的精度与推理效率,并以模块化方式无缝集成 PyTorch。

摘要:

最新的工业推理引擎(如 FasterTransformer 和 TurboTransformers)已经验证,半精度浮点(FP16)和 8 位整数(INT8)量化能够大幅提升模型推理速度。然而,现有 INT8 量化方法过于复杂,使用不当会导致模型性能显著受损。本文开发了一个工具包,使用户能够方便地量化其模型以进行推理,其中提出了 Self-Adaptive Mixed-Precision(SAMP,自适应混合精度),通过混合精度架构自动控制量化率,以平衡模型精度与效率。实验结果表明,我们的 SAMP 工具包在保证所需精度的同时,相比 PyTorch 和 FasterTransformer 具有更高的加速比。此外,SAMP 基于模块化设计,将 tokenizer、embedding、encoder 和 target layers 解耦,使用户能够处理各种下游任务,并可无缝集成到 PyTorch 中。

英文摘要:

The latest industrial inference engines, such as FasterTransformer and TurboTransformers, have verified that half-precision floating point (FP16) and 8-bit integer (INT8) quantization can greatly improve model inference speed. However, the existing INT8 quantization methods are too complicated, and improper usage will lead to model performance damage greatly. In this paper, we develop a toolkit for users to easily quantize their models for inference, in which Self-Adaptive Mixed-Precision (SAMP) is proposed to automatically control quantization rate by a mixed-precision architecture to balance model accuracy and efficiency. Experimental results show that our SAMP toolkit has a higher speedup than PyTorch and FasterTransformer while ensuring the required accuracy. In addition, SAMP is based on a modular design, decoupling the tokenizer, embedding, encoder and target layers, which allows users to handle various downstream tasks and can be seamlessly integrated into PyTorch.

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

↑