Export Parakeet-TDT-CTC to QNN - #3692
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (14)
📝 WalkthroughWalkthroughAdds a complete Parakeet TDT CTC ONNX-to-QNN export pipeline: new model scripts ( ChangesParakeet TDT CTC QNN Export Pipeline
QNN Toolkit Download Retry
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested labels
Poem
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request introduces configuration generation and export scripts for the Parakeet TDT CTC models, alongside updates to the existing Parakeet CTC scripts to dynamically handle feature dimensions. Feedback on the changes highlights a critical NameError in scripts/nemo/qnn/parakeet-ctc/wrapper.py where feat_dim is used without being defined, redundant model loading in scripts/nemo/qnn/parakeet-tdt-ctc/wrapper.py, and a potential shell globbing issue with unquoted brackets in run.sh.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| print("feat_dim", feat_dim) | ||
| x = torch.rand(1, feat_dim, args.max_len, dtype=torch.float32) |
There was a problem hiding this comment.
The variable feat_dim is used here but it is not defined anywhere in this file, which will cause a NameError at runtime. You should retrieve feat_dim from the model configuration before using it, similar to how it is done in the TDT wrapper.
| print("feat_dim", feat_dim) | |
| x = torch.rand(1, feat_dim, args.max_len, dtype=torch.float32) | |
| feat_dim = asr_model.cfg["preprocessor"]["features"] | |
| print("feat_dim", feat_dim) | |
| x = torch.rand(1, feat_dim, args.max_len, dtype=torch.float32) |
| asr_model = nemo_asr.models.EncDecCTCModelBPE.from_pretrained( | ||
| model_name=args.model_id | ||
| ) | ||
| asr_model = nemo_asr.models.ASRModel.from_pretrained(model_name=args.model_id) |
There was a problem hiding this comment.
The model is loaded twice consecutively: first using EncDecCTCModelBPE.from_pretrained and then immediately overwritten using ASRModel.from_pretrained. This is redundant and wastes significant time and memory. You should remove the first redundant load.
asr_model = nemo_asr.models.ASRModel.from_pretrained(model_name=args.model_id)| set -ex | ||
|
|
||
| pip install \ | ||
| nemo_toolkit['asr'] \ |
There was a problem hiding this comment.
In bash, unquoted square brackets like nemo_toolkit['asr'] can be interpreted as globbing patterns by the shell, which might lead to unexpected behavior or installation failures depending on the files in the current directory. It is safer to quote the package name.
| nemo_toolkit['asr'] \ | |
| "nemo_toolkit[asr]" \ |
It adds two models
Note that only the CTC branch is exported in this PR. The transducer branch is handled in a separate PR.
https://huggingface.co/nvidia/parakeet-tdt_ctc-1.1b is not included since it throws OOM in GitHub Actions.
See
for the exported models.
Summary by CodeRabbit
New Features
Chores