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

Neural Modules Configuration - stage 1: init parameters cleanup #309

Merged
merged 40 commits into from
Feb 3, 2020

Conversation

tkornuta-nvidia
Copy link
Contributor

@tkornuta-nvidia tkornuta-nvidia commented Jan 29, 2020

The goal of this PR is to prepare the ground for MNs configuration import-export.
The core idea is described in the Design Doc:
https://docs.google.com/document/d/1HhRzdsLO1hfiMBnR8v2_QIEeNe9m7qjERo4pgCpKhpk/edit#

The current PR is:

  • introduces function that extract init parameters in NeuralModule
  • introduces function that validates whether init parameters are of valid type
  • cleans all unnamed params that are passed to Neural Modules (kwargs) that enables to store in the init parameters only the ones that are required to instantiate the object.

Please note the changes are consistent with our contribution guidelines:
https://github.com/NVIDIA/NeMo/blob/master/CONTRIBUTING.md
in particular with the point:
*Minimize the use of *kwargs.

…KHTIAR

Signed-off-by: Tomasz Kornuta <tkornuta@nvidia.com>
…y, unit tests NOT working

Signed-off-by: Tomasz Kornuta <tkornuta@nvidia.com>
Signed-off-by: Tomasz Kornuta <tkornuta@nvidia.com>
…alization

Signed-off-by: Tomasz Kornuta <tkornuta@nvidia.com>
Signed-off-by: Tomasz Kornuta <tkornuta@nvidia.com>
@lgtm-com
Copy link

lgtm-com bot commented Jan 29, 2020

This pull request introduces 2 alerts when merging 44406e1 into 1fddca2 - view on LGTM.com

new alerts:

  • 1 for Wrong name for an argument in a call
  • 1 for Unused import

Signed-off-by: Tomasz Kornuta <tkornuta@nvidia.com>
Signed-off-by: Tomasz Kornuta <tkornuta@nvidia.com>
Signed-off-by: Tomasz Kornuta <tkornuta@nvidia.com>
@lgtm-com
Copy link

lgtm-com bot commented Jan 30, 2020

This pull request introduces 16 alerts when merging 439c938 into 1fddca2 - view on LGTM.com

new alerts:

  • 15 for Wrong name for an argument in a class instantiation
  • 1 for Unused import

…gested by an old comment)

Signed-off-by: Tomasz Kornuta <tkornuta@nvidia.com>
@lgtm-com
Copy link

lgtm-com bot commented Jan 30, 2020

This pull request introduces 16 alerts when merging 7460430 into 1fddca2 - view on LGTM.com

new alerts:

  • 15 for Wrong name for an argument in a class instantiation
  • 1 for Unused import

@stasbel
Copy link
Contributor

stasbel commented Jan 30, 2020

  1. I think removing all **kwargs invocation everywhere is not valid. You have to rather "expand" them.
  2. Maybe it is just me, but I dont get what you trying to accomplish here and why. Can you just briefly describe it in top-level PR message? Besides, you will need it anywhere for changelog link.

Signed-off-by: Tomasz Kornuta <tkornuta@nvidia.com>
Signed-off-by: Tomasz Kornuta <tkornuta@nvidia.com>
Signed-off-by: Tomasz Kornuta <tkornuta@nvidia.com>
…DataLayer

Signed-off-by: Tomasz Kornuta <tkornuta@nvidia.com>
…to DL

Signed-off-by: Tomasz Kornuta <tkornuta@nvidia.com>
…ssing invalid parameters to init()

Signed-off-by: Tomasz Kornuta <tkornuta@nvidia.com>
@lgtm-com
Copy link

lgtm-com bot commented Jan 31, 2020

This pull request introduces 8 alerts when merging c2f1db8 into 1fddca2 - view on LGTM.com

new alerts:

  • 7 for Wrong name for an argument in a class instantiation
  • 1 for Unused import

Copy link
Member

@okuchaiev okuchaiev left a comment

Choose a reason for hiding this comment

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

  1. Please do not check in "examples/start_here/movie_data.txt file
  2. See some comments inline

CONTRIBUTING.md Show resolved Hide resolved
nemo/backends/pytorch/actions.py Show resolved Hide resolved
nemo/backends/pytorch/actions.py Outdated Show resolved Hide resolved
nemo/backends/pytorch/actions.py Outdated Show resolved Hide resolved
nemo/core/neural_modules.py Outdated Show resolved Hide resolved
nemo/core/neural_modules.py Outdated Show resolved Hide resolved
nemo/core/neural_modules.py Outdated Show resolved Hide resolved
nemo/core/neural_modules.py Outdated Show resolved Hide resolved
tests/common_setup.py Outdated Show resolved Hide resolved
Signed-off-by: Tomasz Kornuta <tkornuta@nvidia.com>
Signed-off-by: Tomasz Kornuta <tkornuta@nvidia.com>
Signed-off-by: Tomasz Kornuta <tkornuta@nvidia.com>
@lgtm-com
Copy link

lgtm-com bot commented Jan 31, 2020

This pull request introduces 8 alerts when merging 066a423 into 1fddca2 - view on LGTM.com

new alerts:

  • 7 for Wrong name for an argument in a class instantiation
  • 1 for Unused import

Signed-off-by: Tomasz Kornuta <tkornuta@nvidia.com>
@lgtm-com
Copy link

lgtm-com bot commented Jan 31, 2020

This pull request introduces 8 alerts when merging daf1e7a into 1fddca2 - view on LGTM.com

new alerts:

  • 7 for Wrong name for an argument in a class instantiation
  • 1 for Unused import

Signed-off-by: Tomasz Kornuta <tkornuta@nvidia.com>
Signed-off-by: Oleksii Kuchaiev <okuchaiev@nvidia.com>
@lgtm-com
Copy link

lgtm-com bot commented Jan 31, 2020

This pull request introduces 8 alerts when merging 62e2c64 into 1fddca2 - view on LGTM.com

new alerts:

  • 7 for Wrong name for an argument in a class instantiation
  • 1 for Unused import

@lgtm-com
Copy link

lgtm-com bot commented Jan 31, 2020

This pull request introduces 8 alerts when merging c8b0610 into 1fddca2 - view on LGTM.com

new alerts:

  • 7 for Wrong name for an argument in a class instantiation
  • 1 for Unused import

Signed-off-by: Tomasz Kornuta <tkornuta@nvidia.com>
@tkornuta-nvidia tkornuta-nvidia changed the title [WIP] Neural Modules Configuration [WIP] Neural Modules Configuration - stage 1: init parameters cleanup Jan 31, 2020
Signed-off-by: Tomasz Kornuta <tkornuta@nvidia.com>
Signed-off-by: Tomasz Kornuta <tkornuta@nvidia.com>
Signed-off-by: Tomasz Kornuta <tkornuta@nvidia.com>
@lgtm-com
Copy link

lgtm-com bot commented Jan 31, 2020

This pull request introduces 7 alerts when merging 90e9eef into 4137c2b - view on LGTM.com

new alerts:

  • 6 for Wrong name for an argument in a class instantiation
  • 1 for Unused import

Signed-off-by: Tomasz Kornuta <tkornuta@nvidia.com>
Signed-off-by: Tomasz Kornuta <tkornuta@nvidia.com>
Signed-off-by: Tomasz Kornuta <tkornuta@nvidia.com>
@lgtm-com
Copy link

lgtm-com bot commented Jan 31, 2020

This pull request introduces 6 alerts when merging 2d1a678 into 4137c2b - view on LGTM.com

new alerts:

  • 5 for Wrong name for an argument in a class instantiation
  • 1 for Unused import

@tkornuta-nvidia tkornuta-nvidia marked this pull request as ready for review January 31, 2020 23:56
@tkornuta-nvidia tkornuta-nvidia changed the title [WIP] Neural Modules Configuration - stage 1: init parameters cleanup Neural Modules Configuration - stage 1: init parameters cleanup Feb 1, 2020
Signed-off-by: Tomasz Kornuta <tkornuta@nvidia.com>
Signed-off-by: Tomasz Kornuta <tkornuta@nvidia.com>
@tkornuta-nvidia
Copy link
Contributor Author

@blisc will update the changelog in the next PR (when will finish NM configuration - stage 2 ;) )

tkornuta-nvidia and others added 2 commits January 31, 2020 17:59
Signed-off-by: Tomasz Kornuta <tkornuta@nvidia.com>
Copy link
Member

@okuchaiev okuchaiev left a comment

Choose a reason for hiding this comment

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

Please see comments inline

@@ -0,0 +1,47 @@
# ! /usr/bin/python
Copy link
Member

Choose a reason for hiding this comment

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

Why is this file needed? I don't see anything being imported or exported here

Copy link
Member

Choose a reason for hiding this comment

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

by "this" I mean the whole file "simplest_example_configuration_import.py"

examples/tts/configs/tacotron2.yaml Show resolved Hide resolved
examples/tts/tts_infer.py Show resolved Hide resolved
# Return parameters.
return init_params

def _validate_params(self, params):
Copy link
Member

Choose a reason for hiding this comment

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

this should start with 2 underscores like "__extract_init_params"

nemo/core/neural_modules.py Outdated Show resolved Hide resolved
tests/asr/test_asr.py Outdated Show resolved Hide resolved
tests/asr/test_asr.py Outdated Show resolved Hide resolved
tests/asr/test_asr.py Outdated Show resolved Hide resolved
tests/asr/test_asr.py Outdated Show resolved Hide resolved
tests/asr/test_weight_share.py Outdated Show resolved Hide resolved
Signed-off-by: Oleksii Kuchaiev <okuchaiev@nvidia.com>
@tkornuta-nvidia tkornuta-nvidia merged commit 08a4c0d into master Feb 3, 2020
@tkornuta-nvidia tkornuta-nvidia deleted the dev-config-nm branch February 3, 2020 22:35
dcurran90 pushed a commit to dcurran90/NeMo that referenced this pull request Oct 15, 2024
Update CODEOWNERS

Signed-off-by: Mark Sturdevant <mark.sturdevant@ibm.com>
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