Nvidia Parakeet Tdt ASR support - #2150
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds end-to-end support for NVIDIA’s Parakeet TDT ASR model to onnxruntime-genai, integrating it into the existing Model/State/Generator pipeline and exposing a Python example and tests.
Changes:
- Introduces a new
parakeet_tdtmodel type with encoder/decoder/joiner sessions and a TDT decoding loop. - Adds a Parakeet processor that decodes audio and computes full-utterance normalized log-mel features.
- Extends config parsing to support Parakeet-specific parameters and adds C++/Python E2E tests plus a Python CLI example.
Reviewed changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| test/python/test_parakeet_tdt.py | New Python pytest E2E coverage for Parakeet transcription + optional WER checks. |
| test/python/test_onnxruntime_genai_e2e.py | Runs Parakeet E2E via the new examples/python/parakeet.py script. |
| test/python/conftest.py | Adds a pytest fixture for locating the Parakeet TDT test model directory. |
| test/c_api_tests.cpp | Adds C API smoke tests for model creation and non-empty transcription on sample audios. |
| src/models/parakeet.h | Declares Parakeet TDT model/state/config structures. |
| src/models/parakeet.cpp | Implements chunked encoder execution + TDT token/duration decoding and one-hot logits output. |
| src/models/parakeet_processor.h | Declares a processor to decode audio and produce mel features + SOS input_ids. |
| src/models/parakeet_processor.cpp | Implements audio decode + Nemo-style mel extraction + per-feature normalization. |
| src/models/model.h | Wires in Parakeet processor header for multimodal processor creation. |
| src/models/model.cpp | Registers parakeet_tdt model creation and processor factory mapping. |
| src/models/model_type.h | Adds ModelType::IsTDT() detection for parakeet_tdt. |
| src/config.h | Adds Parakeet config fields (durations, context samples, norm eps, decoder IO names). |
| src/config.cpp | Parses new Parakeet config fields from genai_config.json. |
| examples/python/parakeet.py | New CLI example to transcribe an audio file with Parakeet TDT. |
| cmake/deps.txt | Updates the onnxruntime-extensions dependency revision. |
Agent-Logs-Url: https://github.com/microsoft/onnxruntime-genai/sessions/d3022705-ac77-415b-86df-45448144fa37 Co-authored-by: nenad1002 <46795300+nenad1002@users.noreply.github.com>
This reverts commit d076a05.
Baiju Meswani (baijumeswani)
previously approved these changes
May 20, 2026
kunal-vaishnavi
previously approved these changes
May 21, 2026
kunal-vaishnavi
enabled auto-merge (squash)
May 21, 2026 08:50
Nenad Banfic (nenad1002)
dismissed stale reviews from kunal-vaishnavi and Baiju Meswani (baijumeswani)
via
May 21, 2026 13:54
81fb240
Baiju Meswani (baijumeswani)
approved these changes
May 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add Parakeet TDT speech recognition model support
Adds end-to-end support for NVIDIA's Parakeet TDT ASR model in onnxruntime-genai.
Code here will support both v2 (English-only) and v3 (multilingual) model - both CPU and CUDA.
Note: Only for batch inference - can support any length of the audio.
What's included
New model type parakeet_tdt with encoder / decoder / joint ONNX subgraphs wired through Model::Create.
TDT decoding loop in src/models/parakeet.cpp: joint network emits [token_logits | duration_logits]; per-frame argmax over tokens and durations with the standard TDT constraints:
Blank + duration 0 is forbidden (prevents single-frame loop-hang).
max_symbols_per_frame cap forces a one-frame skip if the model wants to stay on a frame indefinitely.
Processor (src/models/parakeet_processor.cpp / .h): full-audio log-mel computed up front via the audio extension op; encoder consumes the mel in chunked fashion.
Config plumbing (src/config.h, src/config.cpp): adds tdt_durations, blank_id, max_symbols_per_frame, etc., matching the genai_config.json
Sample: examples/python/parakeet.py - minimal CLI to transcribe an audio file.
Tests:
C++: test/c_api_tests.cpp - model creation + decode smoke test.
Python: test/python/test_parakeet_tdt.py - end-to-end transcription on jfk.flac (short) and tedlium_long_120s.flac fixture (~2 MB) for long-audio coverage.
Long-audio handling: encoder is run on overlapping up to 10 s chunks with both left and right context (configurable via chunk_samples / left_context_samples / right_context_samples in genai_config.json.
Only the chunk-proper region is decoded; context frames just provide receptive field at boundaries. This keeps per-step latency bounded while supporting arbitrary-length audio alongside with much higher RTFx than for native true streaming models.
The model is multilingual at just 0.6B.
The original model link:
https://huggingface.co/nvidia/parakeet-tdt-0.6b-v3