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.

@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

@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 <[email protected]>
@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.

@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

Signed-off-by: Tomasz Kornuta <[email protected]>
Signed-off-by: Tomasz Kornuta <[email protected]>
Signed-off-by: Tomasz Kornuta <[email protected]>
@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 <[email protected]>
@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 <[email protected]>
@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 <[email protected]>
@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 <[email protected]>
Signed-off-by: Tomasz Kornuta <[email protected]>
Signed-off-by: Tomasz Kornuta <[email protected]>
@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 <[email protected]>
Signed-off-by: Tomasz Kornuta <[email protected]>
Signed-off-by: Tomasz Kornuta <[email protected]>
@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 <[email protected]>
@tkornuta-nvidia
Copy link
Contributor Author

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

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"

# 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"

Signed-off-by: Oleksii Kuchaiev <[email protected]>
@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 <[email protected]>
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