Skip to content

Nvidia Parakeet Tdt ASR support - #2150

Merged
kunal-vaishnavi merged 36 commits into
mainfrom
nebanfic/parakeet-new-v3
May 22, 2026
Merged

Nvidia Parakeet Tdt ASR support#2150
kunal-vaishnavi merged 36 commits into
mainfrom
nebanfic/parakeet-new-v3

Conversation

@nenad1002

@nenad1002 Nenad Banfic (nenad1002) commented May 8, 2026

Copy link
Copy Markdown
Contributor

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

Copilot AI review requested due to automatic review settings May 8, 2026 20:53
@nenad1002
Nenad Banfic (nenad1002) requested a review from a team as a code owner May 8, 2026 20:53
Comment thread examples/python/parakeet.py Fixed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_tdt model 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.

Comment thread test/python/test_parakeet_tdt.py Outdated
Comment thread test/c_api_tests.cpp Outdated
Comment thread src/models/parakeet.cpp
Comment thread src/models/parakeet.cpp
Comment thread src/models/parakeet.cpp Outdated
Comment thread src/models/parakeet.cpp Outdated
Comment thread src/models/parakeet.h Outdated
Comment thread src/models/parakeet_processor.cpp
Comment thread src/models/parakeet.cpp Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 21 out of 22 changed files in this pull request and generated no new comments.

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>
Comment thread src/models/parakeet_processor.cpp Outdated
@kunal-vaishnavi
kunal-vaishnavi enabled auto-merge (squash) May 21, 2026 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants