Abstract
We describe initial work on an extension of the Kaldi toolkit that supports weighted finite-state transducer (WFST) decoding on Graphics Processing Units (GPUs). We implement token recombination as an atomic GPU operation in order to fully parallelize the Viterbi beam search and propose a dynamic load balancing strategy for more efficient token passing scheduling among GPU threads. We also redesign the exact lattice generation and lattice pruning algorithms for better utilization of the GPUs. Experiments on the Switchboard corpus show that the proposed method achieves identical 1-best results and lattice quality in recognition and confidence measure tasks, while running 3 to 15 times faster than the single process Kaldi decoder. The above results are reported on different GPU architectures. Additionally we obtain a 46-fold speedup with sequence parallelism and multi-process service (MPS) in GPU.
Introduction
Automatic Speech Recognition (ASR) systems typically consist of an Acoustic Model (AM) and a Weighted Finite-State Transducer (WFST) decoder. While GPUs have significantly accelerated AM inference, the decoding stage—which involves searching through a massive, irregular graph—has remained a primary bottleneck. Previous attempts at GPU-based decoding often sacrificed accuracy, lacked support for large language models, or could not generate exact lattices required for high-quality re-scoring. This work introduces a general-purpose GPU decoder for the Kaldi toolkit that bridges these gaps, providing high-speed decoding without compromising precision.
Methodology
The proposed decoder addresses the irregular nature of WFST decoding through three primary innovations:
Atomic Token Recombination
In Viterbi search, multiple paths reaching the same state must be recombined by keeping only the best path. To parallelize this, we utilize a 64-bit atomic operation (atomicMin). By packing the path cost into the high bits and the arc index into the low bits of a single uint64 integer, the GPU can perform comparison and updates in a single clock cycle. This ensures numerical precision and prevents race conditions without the overhead of traditional locking mechanisms.
Dynamic Load Balancing
WFST states vary significantly in their number of outgoing arcs. A static thread-to-state assignment leads to poor hardware utilization. We implemented a dynamic load balancing strategy using a dispatcher and cooperative groups. This system dynamically assigns arcs to threads, ensuring that the GPU's massive parallel compute resources remain consistently utilized.
Parallel Lattice Generation and Pruning
To avoid the latency of CPU-GPU data transfers, the entire lattice generation and pruning process is moved to the GPU. We redesigned these algorithms to use pre-allocated GPU vectors and parallelized the pruning of unlikely paths.
Experimental Setup
The system was evaluated on the Switchboard 300-hour corpus. We tested two acoustic models: a TDNN-LSTM-C model trained with LF-MMI and a stacked bidirectional LSTM. Decoding was performed using a 30k-vocabulary tri-gram model, followed by 4-gram rescoring. Performance was measured across several NVIDIA GPU generations, including Kepler (K20), Maxwell (M40), Pascal (P100), and Volta (V100).
Results
The GPU decoder achieved identical Word Error Rates (WER) to the CPU baseline: 15.5% for the 1-best result and 14.3% after rescoring. This confirms that the GPU implementation provides "exact" results.
In terms of speed, the single-sequence GPU decoder outperformed the single-process Kaldi CPU decoder by 3 to 15 times. When utilizing sequence parallelism and NVIDIA’s Multi-Process Service (MPS) to process multiple audio streams simultaneously, the system achieved a 46-fold speedup.
Discussion and Conclusion
This work demonstrates that GPU-based WFST decoding can be both fast and exact. By leveraging hardware-specific features like 64-bit atomics and dynamic load balancing, we achieved significant speedups while maintaining the full feature set of the industry-standard Kaldi decoder.
Future work will address memory constraints for extremely large language models (e.g., those exceeding 12GB) and explore deeper integration between AM inference and the decoder to minimize data movement. While currently optimized for offline batch processing, the architecture provides a foundation for high-throughput, low-latency ASR services.
Summary updated