Abstract
The intensive computation of Automatic Speech Recognition (ASR) models obstructs them from being deployed on mobile devices. In this paper, we present a novel quantized Winograd optimization pipeline, which combines quantization and fast convolution to achieve efficient inference acceleration on mobile devices for ASR models. To avoid information loss due to the combination of quantization and Winograd convolution, a Range-Scaled Quantization (RSQ) training method is proposed to expand the quantized numerical range and to distill knowledge from high-precision values. Moreover, an improved Conv1D equipped DFSMN (ConvDFSMN) model is designed for mobile deployment. Results demonstrate the models can be effectively optimized with the proposed pipeline. Especially, Wav2letter achieves 1.48x speedup with an approximate 0.07% WER decrease on ARMv7-based mobile devices.
Introduction
Automatic Speech Recognition (ASR) models are computationally heavy, making real-time execution on mobile devices a significant challenge. To address this, engineers typically employ two techniques: Quantization (converting FP32 to INT8) and Winograd Convolution (an algorithmic optimization reducing multiplications).
However, these techniques are often incompatible. Winograd transformations involve intermediate additions that can cause numerical overflow when using the full 8-bit integer range. Consequently, most mobile frameworks choose one or the other, missing out on the combined speedup. This paper introduces a specialized optimization pipeline that successfully bridges this gap.
Methodology
Range-Scaled Quantization (RSQ)
To prevent Winograd overflow, we propose Range-Scaled Quantization (RSQ). While standard 8-bit integers range from -127 to 127, RSQ "shrinks" the allowed range of quantized values (e.g., to -42 to 42). This provides the necessary "headroom" for the additions that occur during the Winograd transform, preventing garbage outputs caused by overflow.
Quantization Noise Loss
Shrinking the numerical range can hurt accuracy. To mitigate this, we add a Quantization Noise Loss (based on Mean Squared Error) during fine-tuning. This acts as a form of knowledge distillation, forcing the quantized model's outputs to remain as close as possible to the original high-precision values. This distillation also serves as a regularizer, sometimes improving final accuracy beyond the baseline.
ConvDFSMN Architecture
We designed a new model architecture called ConvDFSMN (Convolutional Deep Feed-forward Sequential Memory Network). Unlike Recurrent Neural Networks (RNNs), which are difficult to accelerate due to their sequential nature, this model is feed-forward and relies heavily on 1D convolutions, making it an ideal candidate for Winograd optimization.
Key Results
The optimization pipeline was tested on ARMv7-based mobile devices using the Aishell-1 Mandarin speech corpus.
- Wav2letter Model: Achieved a 1.48x speedup compared to standard GEMM implementations, with a 0.07% decrease in Word Error Rate (WER).
- ConvDFSMN-s: This "small" version of our custom model achieved a WER of 10.52% with a latency of only 48.6ms, outperforming the standard Wav2letter model in both accuracy and speed.
- Efficiency: The INT8 Winograd operator consistently outperformed standard INT8 GEMM across various kernel sizes, typically providing a 10% to 30% boost in raw operation speed.
Conclusion
The proposed pipeline demonstrates that combining INT8 quantization with Winograd convolution is not only possible but highly effective for mobile ASR. While the speedup is somewhat constrained by memory access for very large kernels, the RSQ method successfully prevents numerical overflow while maintaining, or even improving, model accuracy. Future work will explore "Winograd-aware" architecture searches to further optimize kernel sizes for mobile hardware.
Summary updated