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 2: config import-export #339

Merged
merged 46 commits into from
Feb 19, 2020

Conversation

tkornuta-nvidia
Copy link
Contributor

@tkornuta-nvidia tkornuta-nvidia commented Feb 7, 2020

Functionality implemented in this PR:

  • Generic export of configuration (init_params) to configuration (yml) file
  • Generic import of configuration from configuration file
  • Unit tests for both import and export functionalities
  • An example script showing how to use import/export
  • A tutorial showing how to use import/export
  • A tutorial showing how to implement a custom import/export
  • Refactor of an existing ASR example to see whether the solution fits to our needs

The import distinguishes two cases: when importing from the root NeuralModule class and from the leaf neural module.

This PR have also "initializes" the module/config/checkpoint versioning. For now I am saving in config the only available information, i.e. version of the NeMo core plus collection name (collections do not have their own versioning, yet). I am also not performing any version checking during import. Generally I think this issue should be discussed in a separate "Problem brainstorming session".

Additionally, this PR cleans up:

  • utilization of get_module() from NeuralFactory (CV related examples, all relying on ResNet, are left for now - will clean them up along with the introduction of CV collection)

Signed-off-by: Tomasz Kornuta <tkornuta@nvidia.com>
Signed-off-by: Tomasz Kornuta <tkornuta@nvidia.com>
Signed-off-by: Tomasz Kornuta <tkornuta@nvidia.com>
Signed-off-by: Tomasz Kornuta <tkornuta@nvidia.com>
…ig file is compatible during 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>
Signed-off-by: Tomasz Kornuta <tkornuta@nvidia.com>
Signed-off-by: Tomasz Kornuta <tkornuta@nvidia.com>
@lgtm-com
Copy link

lgtm-com bot commented Feb 7, 2020

This pull request introduces 1 alert when merging d322c8b into 4f299f4 - view on LGTM.com

new alerts:

  • 1 for Module is imported with 'import' and 'import from'

Signed-off-by: Tomasz Kornuta <tkornuta@nvidia.com>
nemo/core/neural_modules.py Outdated Show resolved Hide resolved
nemo/core/neural_modules.py Show resolved Hide resolved
nemo/core/neural_modules.py Show resolved Hide resolved
requirements/requirements.txt 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>
Signed-off-by: Tomasz Kornuta <tkornuta@nvidia.com>
Signed-off-by: Tomasz Kornuta <tkornuta@nvidia.com>
Signed-off-by: Tomasz Kornuta <tkornuta@nvidia.com>
Signed-off-by: Tomasz Kornuta <tkornuta@nvidia.com>
Signed-off-by: Tomasz Kornuta <tkornuta@nvidia.com>
Signed-off-by: Tomasz Kornuta <tkornuta@nvidia.com>
Signed-off-by: Tomasz Kornuta <tkornuta@nvidia.com>
Signed-off-by: Tomasz Kornuta <tkornuta@nvidia.com>
Signed-off-by: Tomasz Kornuta <tkornuta@nvidia.com>
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 Feb 15, 2020

This pull request introduces 1 alert when merging bf1729e into 142bed9 - view on LGTM.com

new alerts:

  • 1 for Unused import

Signed-off-by: Tomasz Kornuta <tkornuta@nvidia.com>
Signed-off-by: nvidia <tkornuta@nvidia.com>
okuchaiev
okuchaiev previously approved these changes Feb 18, 2020
@okuchaiev
Copy link
Member

looks good to me, what's up with CI though?

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

lgtm-com bot commented Feb 19, 2020

This pull request introduces 6 alerts when merging dfc204d into abaac1b - view on LGTM.com

new alerts:

  • 4 for Unused import
  • 1 for Non-callable called
  • 1 for Module is imported with 'import' and 'import from'

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

lgtm-com bot commented Feb 19, 2020

This pull request introduces 2 alerts when merging 1d87187 into abaac1b - view on LGTM.com

new alerts:

  • 1 for Non-callable called
  • 1 for Module is imported with 'import' and 'import from'

@tkornuta-nvidia tkornuta-nvidia marked this pull request as ready for review February 19, 2020 03:52
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 Feb 19, 2020

This pull request introduces 2 alerts when merging bedb48a into abaac1b - view on LGTM.com

new alerts:

  • 1 for Non-callable called
  • 1 for Unused import

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

lgtm-com bot commented Feb 19, 2020

This pull request introduces 2 alerts when merging c87d2e2 into abaac1b - view on LGTM.com

new alerts:

  • 1 for Non-callable called
  • 1 for Unused import

@@ -0,0 +1,141 @@
# ! /usr/bin/python
Copy link
Collaborator

Choose a reason for hiding this comment

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

can you rename this file? you are not testing Neural Module export, you are testing configuration export

Copy link
Contributor Author

Choose a reason for hiding this comment

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

actually you are right, was thinking about that when renamed examples/tutorial

@@ -0,0 +1,114 @@
# ! /usr/bin/python
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you rename this file too? again configuration import

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, creating a separate PR

@tkornuta-nvidia tkornuta-nvidia merged commit 1b1b821 into master Feb 19, 2020
@tkornuta-nvidia tkornuta-nvidia deleted the dev-config-impoexpo branch February 19, 2020 19:41
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.

4 participants