优化语音模型训练与推理效率,显著降低资源消耗。
Training and Inference Efficiency of Encoder-Decoder Speech Models
- 改进序列数据批处理采样策略,减少50%以上冗余计算。
- 训练效率提升5倍,4倍少GPU或2倍快训练时间。
- 重构模型结构使推理速度提升3倍,适合部署场景。
注意力编码器-解码器架构是Whisper、Seamless、OWSM和Canary-1B等顶尖语音基础模型的核心。然而,其训练所需的数据与算力对多数研究者而言仍难以承受。本文聚焦效率问题,探讨当前语音模型训练是否高效,并提出优化方案。我们指出,序列数据的批处理采样策略是影响训练效率的关键因素,忽视该问题导致超过50%的计算被浪费在填充(padding)上。通过对Canary-1B进行采样分析与优化,实现GPU利用率逐步提升,平均批大小提升至原设置的5倍。这使得等效模型可在4倍更少的GPU下完成训练(同墙时),或使用原有资源将训练时间缩短至一半。此外,我们发现推理瓶颈主要来自自回归解码步骤。通过将解码器参数迁移至编码器,推理速度提升3倍(以逆实时因子RTFx衡量),同时保持准确率与收敛所需的计算量不变。训练代码与模型将开源。
原文摘要 · Abstract (English)
Attention encoder-decoder model architecture is the backbone of several recent top performing foundation speech models: Whisper, Seamless, OWSM, and Canary-1B. However, the reported data and compute requirements for their training are prohibitive for many in the research community. In this work, we focus on the efficiency angle and ask the questions of whether we are training these speech models efficiently, and what can we do to improve? We argue that a major, if not the most severe, detrimental factor for training efficiency is related to the sampling strategy of sequential data. We show that negligence in mini-batch sampling leads to more than 50% computation being spent on padding. To that end, we study, profile, and optimize Canary-1B training to show gradual improvement in GPU utilization leading up to 5x increase in average batch sizes versus its original training settings. This in turn allows us to train an equivalent model using 4x less GPUs in the same wall time, or leverage the original resources and train it in 2x shorter wall time. Finally, we observe that the major inference bottleneck lies in the autoregressive decoder steps. We find that adjusting the model architecture to transfer model parameters from the decoder to the encoder results in a 3x inference speedup as measured by inverse real-time factor (RTFx) while preserving the accuracy and compute requirements for convergence. The training code and models will be available as open-source.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。