New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable RNNT ONNX Export #2510
Enable RNNT ONNX Export #2510
Conversation
Signed-off-by: smajumdar <titu1994@gmail.com>
Signed-off-by: smajumdar <titu1994@gmail.com>
Signed-off-by: smajumdar <titu1994@gmail.com>
Signed-off-by: smajumdar <titu1994@gmail.com>
Signed-off-by: smajumdar <titu1994@gmail.com>
Signed-off-by: smajumdar <titu1994@gmail.com>
Signed-off-by: smajumdar <titu1994@gmail.com>
Signed-off-by: smajumdar <titu1994@gmail.com>
Signed-off-by: smajumdar <titu1994@gmail.com>
Signed-off-by: smajumdar <titu1994@gmail.com>
Signed-off-by: smajumdar <titu1994@gmail.com>
Signed-off-by: smajumdar <titu1994@gmail.com>
Signed-off-by: smajumdar <titu1994@gmail.com>
Signed-off-by: smajumdar <titu1994@gmail.com>
Signed-off-by: smajumdar <titu1994@gmail.com>
Signed-off-by: smajumdar <titu1994@gmail.com>
Signed-off-by: smajumdar <titu1994@gmail.com>
Signed-off-by: smajumdar <titu1994@gmail.com>
Signed-off-by: smajumdar <titu1994@gmail.com>
Signed-off-by: smajumdar <titu1994@gmail.com>
Signed-off-by: smajumdar <titu1994@gmail.com>
Signed-off-by: smajumdar <titu1994@gmail.com>
Signed-off-by: smajumdar <titu1994@gmail.com>
Signed-off-by: smajumdar <titu1994@gmail.com>
Signed-off-by: smajumdar <titu1994@gmail.com>
Signed-off-by: smajumdar <titu1994@gmail.com>
Signed-off-by: smajumdar <titu1994@gmail.com>
* Add parallel block that supports Jasper-like blocks. Signed-off-by: Aleksei Kalinov <alekseia@nvidia.com> * Add Encoder with parallel blocks. Signed-off-by: Aleksei Kalinov <alekseia@nvidia.com> * Mark test as unit test. Signed-off-by: Aleksei Kalinov <alekseia@nvidia.com> * Support pointwise residual connections to connect layers with different fitlers. Signed-off-by: Aleksei Kalinov <alekseia@nvidia.com> * Format source code Signed-off-by: Aleksei Kalinov <alekseia@nvidia.com> * Switch to 1D tensor for dropout weights. Signed-off-by: Aleksei Kalinov <alekseia@nvidia.com> * Format source code. Signed-off-by: Aleksei Kalinov <alekseia@nvidia.com> Co-authored-by: Somshubra Majumdar <titu1994@gmail.com>
Signed-off-by: smajumdar <titu1994@gmail.com>
Signed-off-by: smajumdar <titu1994@gmail.com>
Signed-off-by: smajumdar <titu1994@gmail.com>
Signed-off-by: smajumdar <titu1994@gmail.com>
Signed-off-by: smajumdar <titu1994@gmail.com>
Signed-off-by: smajumdar <titu1994@gmail.com>
This pull request introduces 2 alerts and fixes 1 when merging 9d626b0 into d08c7a7 - view on LGTM.com new alerts:
fixed alerts:
|
This pull request introduces 2 alerts and fixes 1 when merging 2ebd5dd into d08c7a7 - view on LGTM.com new alerts:
fixed alerts:
|
Signed-off-by: smajumdar <titu1994@gmail.com>
This pull request introduces 2 alerts and fixes 1 when merging 1abfbea into d08c7a7 - view on LGTM.com new alerts:
fixed alerts:
|
@@ -62,8 +63,14 @@ def _prepare_for_export(self, **kwargs): | |||
m_count = 0 | |||
for m in self.modules(): | |||
if isinstance(m, MaskedConv1d): | |||
m.use_mask = False | |||
m_count += 1 | |||
if hasattr(self, '_rnnt_export') and self._rnnt_export: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not overriding whole _prepare_for_export for RNNT nets?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's an option, but that would make framework dependent on what type of encoder was used. This way the Conformer and Citrinet can chose to supply seperate input-output types for CTC and RNNT exports while CTC and RNNT export framework remains unaware of what encoder type it is
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I do not see any changes in this PR (nor in main) that would set _rnnt_export attribute - are those part of another PR ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Part of this PR Inside the asr_model.py file (needs to be expanded)
format = self.get_format(output) | ||
|
||
# Assign special flag for RNNT export of encoder | ||
self.input_module._rnnt_export = True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@borisfom here is where we set it explicitly to the modules. Needs to be before prepare_for_export
since samples are already extracted by the time prepare_for_extract
is called. (could do with better design but necessary flag to switch from ctc-rnnt onnx export).
Signed-off-by: smajumdar <titu1994@gmail.com>
This pull request introduces 2 alerts and fixes 1 when merging 6dff9b0 into c8f9427 - view on LGTM.com new alerts:
fixed alerts:
|
Signed-off-by: smajumdar <titu1994@gmail.com>
Signed-off-by: smajumdar <titu1994@gmail.com>
This pull request introduces 2 alerts and fixes 1 when merging f6aa380 into c8f9427 - view on LGTM.com new alerts:
fixed alerts:
|
* Begin export of RNNT models Signed-off-by: smajumdar <titu1994@gmail.com> * Prepare export Signed-off-by: smajumdar <titu1994@gmail.com> * Refactor Exportable Signed-off-by: smajumdar <titu1994@gmail.com> * Enable RNNT export to onnx Signed-off-by: smajumdar <titu1994@gmail.com> * RNNT export Signed-off-by: smajumdar <titu1994@gmail.com> * Attempt to get stateful inference Signed-off-by: smajumdar <titu1994@gmail.com> * Revert changes attempt state fix Signed-off-by: smajumdar <titu1994@gmail.com> * Hack together forward pass <FIX LATER> Signed-off-by: smajumdar <titu1994@gmail.com> * Return length Signed-off-by: smajumdar <titu1994@gmail.com> * Correct signature Signed-off-by: smajumdar <titu1994@gmail.com> * Prepare stateful Signed-off-by: smajumdar <titu1994@gmail.com> * Continie checks for states Signed-off-by: smajumdar <titu1994@gmail.com> * Correct naming Signed-off-by: smajumdar <titu1994@gmail.com> * Correct names Signed-off-by: smajumdar <titu1994@gmail.com> * Pass trace checks Signed-off-by: smajumdar <titu1994@gmail.com> * Update test to be dynamic Signed-off-by: smajumdar <titu1994@gmail.com> * Update naming semantic Signed-off-by: smajumdar <titu1994@gmail.com> * Initial prototype of RNNT greedy decoding Signed-off-by: smajumdar <titu1994@gmail.com> * Fix tracer warnings Signed-off-by: smajumdar <titu1994@gmail.com> * Corrected names of outputs for RNNT encoder Signed-off-by: smajumdar <titu1994@gmail.com> * Fix export rnnt script Signed-off-by: smajumdar <titu1994@gmail.com> * Prototype RNNT forward inference Signed-off-by: smajumdar <titu1994@gmail.com> * Update asr export Signed-off-by: smajumdar <titu1994@gmail.com> * Runnable inference Signed-off-by: smajumdar <titu1994@gmail.com> * Correct log softmax for joint Signed-off-by: smajumdar <titu1994@gmail.com> * Finish RNNT export to onnx Signed-off-by: smajumdar <titu1994@gmail.com> * Fix onnx export Signed-off-by: smajumdar <titu1994@gmail.com> * Create parallel version of ConvASREncoder (NVIDIA#2456) * Add parallel block that supports Jasper-like blocks. Signed-off-by: Aleksei Kalinov <alekseia@nvidia.com> * Add Encoder with parallel blocks. Signed-off-by: Aleksei Kalinov <alekseia@nvidia.com> * Mark test as unit test. Signed-off-by: Aleksei Kalinov <alekseia@nvidia.com> * Support pointwise residual connections to connect layers with different fitlers. Signed-off-by: Aleksei Kalinov <alekseia@nvidia.com> * Format source code Signed-off-by: Aleksei Kalinov <alekseia@nvidia.com> * Switch to 1D tensor for dropout weights. Signed-off-by: Aleksei Kalinov <alekseia@nvidia.com> * Format source code. Signed-off-by: Aleksei Kalinov <alekseia@nvidia.com> Co-authored-by: Somshubra Majumdar <titu1994@gmail.com> * Fix style Signed-off-by: smajumdar <titu1994@gmail.com> * Update comments Signed-off-by: smajumdar <titu1994@gmail.com> * Freeze the nemo model Signed-off-by: smajumdar <titu1994@gmail.com> * Update transcribe script to support RNNT and rnnt model transcriptions Signed-off-by: smajumdar <titu1994@gmail.com> * Add threshold Signed-off-by: smajumdar <titu1994@gmail.com> * Add warning Signed-off-by: smajumdar <titu1994@gmail.com> * Minor fixes Signed-off-by: smajumdar <titu1994@gmail.com> * Style fix Signed-off-by: smajumdar <titu1994@gmail.com> * Correctly replace forward step Signed-off-by: smajumdar <titu1994@gmail.com> * Reset RNNT flag after export is done Signed-off-by: smajumdar <titu1994@gmail.com> * Generalize _rnnt_export flag Signed-off-by: smajumdar <titu1994@gmail.com> * Generalize _rnnt_export flag Signed-off-by: smajumdar <titu1994@gmail.com> Co-authored-by: Aleksei Kalinov <alekseia@nvidia.com>
* Begin export of RNNT models Signed-off-by: smajumdar <titu1994@gmail.com> * Prepare export Signed-off-by: smajumdar <titu1994@gmail.com> * Refactor Exportable Signed-off-by: smajumdar <titu1994@gmail.com> * Enable RNNT export to onnx Signed-off-by: smajumdar <titu1994@gmail.com> * RNNT export Signed-off-by: smajumdar <titu1994@gmail.com> * Attempt to get stateful inference Signed-off-by: smajumdar <titu1994@gmail.com> * Revert changes attempt state fix Signed-off-by: smajumdar <titu1994@gmail.com> * Hack together forward pass <FIX LATER> Signed-off-by: smajumdar <titu1994@gmail.com> * Return length Signed-off-by: smajumdar <titu1994@gmail.com> * Correct signature Signed-off-by: smajumdar <titu1994@gmail.com> * Prepare stateful Signed-off-by: smajumdar <titu1994@gmail.com> * Continie checks for states Signed-off-by: smajumdar <titu1994@gmail.com> * Correct naming Signed-off-by: smajumdar <titu1994@gmail.com> * Correct names Signed-off-by: smajumdar <titu1994@gmail.com> * Pass trace checks Signed-off-by: smajumdar <titu1994@gmail.com> * Update test to be dynamic Signed-off-by: smajumdar <titu1994@gmail.com> * Update naming semantic Signed-off-by: smajumdar <titu1994@gmail.com> * Initial prototype of RNNT greedy decoding Signed-off-by: smajumdar <titu1994@gmail.com> * Fix tracer warnings Signed-off-by: smajumdar <titu1994@gmail.com> * Corrected names of outputs for RNNT encoder Signed-off-by: smajumdar <titu1994@gmail.com> * Fix export rnnt script Signed-off-by: smajumdar <titu1994@gmail.com> * Prototype RNNT forward inference Signed-off-by: smajumdar <titu1994@gmail.com> * Update asr export Signed-off-by: smajumdar <titu1994@gmail.com> * Runnable inference Signed-off-by: smajumdar <titu1994@gmail.com> * Correct log softmax for joint Signed-off-by: smajumdar <titu1994@gmail.com> * Finish RNNT export to onnx Signed-off-by: smajumdar <titu1994@gmail.com> * Fix onnx export Signed-off-by: smajumdar <titu1994@gmail.com> * Create parallel version of ConvASREncoder (NVIDIA#2456) * Add parallel block that supports Jasper-like blocks. Signed-off-by: Aleksei Kalinov <alekseia@nvidia.com> * Add Encoder with parallel blocks. Signed-off-by: Aleksei Kalinov <alekseia@nvidia.com> * Mark test as unit test. Signed-off-by: Aleksei Kalinov <alekseia@nvidia.com> * Support pointwise residual connections to connect layers with different fitlers. Signed-off-by: Aleksei Kalinov <alekseia@nvidia.com> * Format source code Signed-off-by: Aleksei Kalinov <alekseia@nvidia.com> * Switch to 1D tensor for dropout weights. Signed-off-by: Aleksei Kalinov <alekseia@nvidia.com> * Format source code. Signed-off-by: Aleksei Kalinov <alekseia@nvidia.com> Co-authored-by: Somshubra Majumdar <titu1994@gmail.com> * Fix style Signed-off-by: smajumdar <titu1994@gmail.com> * Update comments Signed-off-by: smajumdar <titu1994@gmail.com> * Freeze the nemo model Signed-off-by: smajumdar <titu1994@gmail.com> * Update transcribe script to support RNNT and rnnt model transcriptions Signed-off-by: smajumdar <titu1994@gmail.com> * Add threshold Signed-off-by: smajumdar <titu1994@gmail.com> * Add warning Signed-off-by: smajumdar <titu1994@gmail.com> * Minor fixes Signed-off-by: smajumdar <titu1994@gmail.com> * Style fix Signed-off-by: smajumdar <titu1994@gmail.com> * Correctly replace forward step Signed-off-by: smajumdar <titu1994@gmail.com> * Reset RNNT flag after export is done Signed-off-by: smajumdar <titu1994@gmail.com> * Generalize _rnnt_export flag Signed-off-by: smajumdar <titu1994@gmail.com> * Generalize _rnnt_export flag Signed-off-by: smajumdar <titu1994@gmail.com> Co-authored-by: Aleksei Kalinov <alekseia@nvidia.com> Signed-off-by: Paarth Neekhara <paarth.n@gmail.com>
Changelog
ExportableEncDecJointModel
that is subclass of Exportable