Fast Forced Aligner
A CUDA library that turns CTC emissions and known transcripts into batched GPU forced alignments with per-frame token labels and scores.
At a Glance
Fast Forced Aligner core code and documentation are MIT licensed; free to use, modify and distribute. Requires user's own NVIDIA GPU, CUDA toolkit and CTC model.
Engagement
Available On
Alternatives
Listed Nov 2026
About Fast Forced Aligner
Fast Forced Aligner is an open-source Python package by Bryan Thornbury (brthor) that performs forced alignment from existing CTC model outputs on NVIDIA GPUs. It takes log-probability emissions and transcript token IDs, then returns a token label and score for every audio frame. The package is pre-release at version 0.1.0 and is installed directly from GitHub.
What It Is
The library handles the alignment step only: acoustic inference stays with the caller's own CTC model, and the examples use stock Hugging Face Transformers models such as facebook/wav2vec2-base-960h to produce emissions. Recordings of different lengths are batched without padding, and results stay on the GPU as CUDA tensors. Two modes sit behind the same Python API: an optimized kernel (the default) and a conventional full-record CTC Viterbi DP kernel.
How the alignment modes work
Optimized mode solves relaxed 128-frame chunks in parallel, uses greedy shortcuts, repairs chunk boundaries, and falls back to full-record DP when needed. Conventional mode runs the full recurrence with specialized CUDA kernels and parallel traceback. The README notes that optimized mode is not universally bitwise equivalent to conventional DP, that adversarial near-tie inputs can differ, and that it can lose to conventional DP on some long recordings.
Inputs, outputs, and validation
Inputs are contiguous CUDA FP32 emissions and CUDA int64 target IDs on one device. Outputs keep blanks and repeats, and each result exposes paths, labels, scores, lengths, and a status code. Default GPU-side target validation avoids host waits, and an optional emission-validity scan can exclude invalid records. The docs also explain converting frame labels to timestamps using the model's frame stride, and include a comparison guide for users coming from TorchAudio's forced_align.
Setup path
It requires Linux, Python 3.11+, PyTorch 2.8.0, CUDA 12.8, an NVIDIA GPU and driver, and the CUDA toolkit with nvcc and a C++ compiler, because CUDA source is compiled on first use. A Docker example and a pinned benchmark subproject are included. The author reports benchmark results on an RTX 3090 against TorchAudio, k2, NeMo, and ctc-forced-aligner.
Community Discussions
Be the first to start a conversation about Fast Forced Aligner
Share your experience with Fast Forced Aligner, ask questions, or help others learn from your insights.
Pricing
Open Source (MIT)
Fast Forced Aligner core code and documentation are MIT licensed; free to use, modify and distribute. Requires user's own NVIDIA GPU, CUDA toolkit and CTC model.
- MIT License for original code and documentation
- Optimized CUDA alignment kernel and conventional CTC dynamic programming behind the same Python API
- Batched GPU alignment of recordings of different lengths without padding
- Installed from GitHub (not on PyPI); requires nvcc and a C++ compiler
- Bundled C++ benchmark comparator retains BSD-2-Clause license
Capabilities
Key Features
- Batched GPU forced alignment from CTC emissions
- Per-frame token labels and scores
- Variable-length recordings without padding
- Optimized and conventional DP modes behind one API
- GPU-side input validation and optional emission-validity masking
- Asynchronous status checking for high-throughput loops
- TorchAudio-style migration path
- Reproducible benchmark suite with Docker
