Skip to content
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

Updates to conformer. #1898

Merged
merged 19 commits into from
Mar 18, 2021
Merged

Updates to conformer. #1898

merged 19 commits into from
Mar 18, 2021

Conversation

VahidooX
Copy link
Collaborator

@VahidooX VahidooX commented Mar 11, 2021

  • Made positional embedding more efficient.
  • Updated the rel_shift() method to avoid flipping which needs significant memory.
  • Fixed the onnx issue.
  • Added att_context_size feature to limit the context of attention with masking.

Signed-off-by: Vahid <vnoroozi@nvidia.com>
Signed-off-by: Vahid <vnoroozi@nvidia.com>
Signed-off-by: Vahid <vnoroozi@nvidia.com>
Signed-off-by: Vahid <vnoroozi@nvidia.com>
@VahidooX VahidooX marked this pull request as ready for review March 17, 2021 22:14
@VahidooX
Copy link
Collaborator Author

VahidooX commented Mar 17, 2021

@borisfom or @drnikolaev would you please checkout the asr_model.py?
I needed to make some changes to the export part. We did not pass the length to the encoder and it was fine for convolutional modules which do not use that input. But Conformer would use that input and export would not work on this model without passing lengths.

Copy link
Collaborator

@titu1994 titu1994 left a comment

Choose a reason for hiding this comment

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

Overall looks good, little bit improved docs is required.

nemo/collections/asr/modules/conformer_encoder.py Outdated Show resolved Hide resolved
nemo/collections/asr/parts/conformer_modules.py Outdated Show resolved Hide resolved
nemo/collections/asr/parts/conformer_modules.py Outdated Show resolved Hide resolved
nemo/collections/asr/parts/conformer_modules.py Outdated Show resolved Hide resolved
nemo/collections/asr/parts/conformer_modules.py Outdated Show resolved Hide resolved
nemo/collections/asr/parts/conformer_modules.py Outdated Show resolved Hide resolved
nemo/collections/asr/parts/multi_head_attention.py Outdated Show resolved Hide resolved
Signed-off-by: Vahid <vnoroozi@nvidia.com>
Signed-off-by: Vahid <vnoroozi@nvidia.com>
Signed-off-by: Vahid <vnoroozi@nvidia.com>
Signed-off-by: Vahid <vnoroozi@nvidia.com>
Signed-off-by: Vahid <vnoroozi@nvidia.com>
Signed-off-by: Vahid <vnoroozi@nvidia.com>
Signed-off-by: Vahid <vnoroozi@nvidia.com>
@VahidooX VahidooX changed the title refactor the positional encoding of conformer. Updates to conformer. Mar 18, 2021
Signed-off-by: Vahid <vnoroozi@nvidia.com>
Signed-off-by: Vahid <vnoroozi@nvidia.com>
Copy link
Collaborator

@titu1994 titu1994 left a comment

Choose a reason for hiding this comment

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

LGTM. If @borisfom gives the go ahead, merge.

Signed-off-by: Vahid <vnoroozi@nvidia.com>
Signed-off-by: Vahid <vnoroozi@nvidia.com>
Copy link
Collaborator

@titu1994 titu1994 left a comment

Choose a reason for hiding this comment

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

Minor patch, python has issues with lists inside functions

nemo/collections/asr/modules/conformer_encoder.py Outdated Show resolved Hide resolved
Signed-off-by: Vahid <vnoroozi@nvidia.com>
@VahidooX VahidooX requested a review from titu1994 March 18, 2021 23:35
Copy link
Collaborator

@titu1994 titu1994 left a comment

Choose a reason for hiding this comment

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

LGTM !

@VahidooX VahidooX merged commit 39b3646 into NVIDIA:r1.0.0rc1 Mar 18, 2021
vadam5 pushed a commit to vadam5/NeMo that referenced this pull request Apr 9, 2021
Signed-off-by: Virginia Adams <vadams@nvidia.com>
vadam5 pushed a commit to vadam5/NeMo that referenced this pull request Apr 12, 2021
Signed-off-by: Virginia Adams <vadams@nvidia.com>
michalivne pushed a commit to michalivne/NeMo that referenced this pull request Jun 23, 2021
Signed-off-by: Micha Livne <mlivne@nvidia.com>
mousebaiker pushed a commit to mousebaiker/NeMo that referenced this pull request Jul 8, 2021
@VahidooX VahidooX deleted the fix_conformer_main branch January 12, 2022 01:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants