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

Remove .nemo instead of renaming #9281

Merged
merged 10 commits into from
May 23, 2024
Merged

Remove .nemo instead of renaming #9281

merged 10 commits into from
May 23, 2024

Conversation

mikolajblaz
Copy link
Collaborator

What does this PR do ?

This is a fix to #9015 which resulted in creating too many .nemo files.

Collection: [Note which collection this PR will affect]

Changelog

  • Add specific line by line info of high level changes in this PR.

Usage

  • You can potentially add a usage example below
# Add a code snippet demonstrating how to use this 

GitHub Actions CI

The Jenkins CI system has been replaced by GitHub Actions self-hosted runners.

The GitHub Actions CI will run automatically when the "Run CICD" label is added to the PR.
To re-run CI remove and add the label again.
To run CI on an untrusted fork, a NeMo user with write access must first click "Approve and run".

Before your PR is "Ready for review"

Pre checks:

  • Make sure you read and followed Contributor guidelines
  • Did you write any new necessary tests?
  • Did you add or update any necessary documentation?
  • Does the PR affect components that are optional to install? (Ex: Numba, Pynini, Apex etc)
    • Reviewer: Does the PR have correct import guards for all optional libraries?

PR Type:

  • New Feature
  • Bugfix
  • Documentation

If you haven't finished some of the above items you can still open "Draft" PR.

Who can review?

Anyone in the community is free to review the PR once the checks have passed.
Contributor guidelines contains specific people who can review PRs to various areas.

Additional Information

  • Related to # (issue)

Signed-off-by: Mikołaj Błaż <[email protected]>
@mikolajblaz mikolajblaz added bug Something isn't working Run CICD labels May 22, 2024
@anteju anteju linked an issue May 22, 2024 that may be closed by this pull request
@titu1994
Copy link
Collaborator

Docstring needs to be updated but overall ok

titu1994
titu1994 previously approved these changes May 22, 2024
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.

Docstring needs update

titu1994
titu1994 previously approved these changes May 22, 2024
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.

Thanks !

This reverts commit b836410.

Signed-off-by: Mikołaj Błaż <[email protected]>
Copy link
Collaborator

@artbataev artbataev left a comment

Choose a reason for hiding this comment

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

Please also add checks for the behavior in tests (tests/core/test_exp_manager.py) to avoid such a bug in future, as suggested in #9232

def test_nemo_checkpoint_always_save_nemo(self, tmp_path):
    ...
    assert len(list((tmp_path / "test/checkpoints").glob("default*.nemo"))) == 1  # check number of `.nemo` checkpoints

@github-actions github-actions bot added the core Changes to NeMo Core label May 23, 2024
@@ -681,8 +705,7 @@
"""
tmp_path = tmp_path / "test_3"

class CustomLoop(_TrainingEpochLoop):
...
class CustomLoop(_TrainingEpochLoop): ...

Check notice

Code scanning / CodeQL

Statement has no effect Note test

This statement has no effect.
@mikolajblaz
Copy link
Collaborator Author

added the test from repro: https://github.com/NVIDIA/NeMo/pull/9281/files#diff-b1e596fcfe12238f95a6145a309dfbcdcee6bd67f68505aa42f8865d759f377bR461
also added removing existing .nemo checkpoints in safe way (rename existing, save new, remove old)

@github-actions github-actions bot added the ASR label May 23, 2024
@mikolajblaz
Copy link
Collaborator Author

@titu1994 CI on main branch is failing so I added a fix which is unrelated to this PR so that CI passes:
https://github.com/NVIDIA/NeMo/pull/9281/files#diff-efe139cc50f2253e4a5f2b5a268dff86f1094531de824da4067590243be7f928R25

@mikolajblaz
Copy link
Collaborator Author

There are some issues with the CI, @pablo-garay can you take a look?

@titu1994 I assume it needs to go to 2.0.0.rc as well?

@pablo-garay pablo-garay merged commit 9d6e472 into main May 23, 2024
133 checks passed
@pablo-garay pablo-garay deleted the mblaz/fix-duplicated-nemo branch May 23, 2024 16:06
pablo-garay pushed a commit that referenced this pull request May 23, 2024
* Remove .nemo instead of renaming

Signed-off-by: Mikołaj Błaż <[email protected]>

* add ignore_errors=True flag

Signed-off-by: dimapihtar <[email protected]>

* Revert "Remove .nemo instead of renaming"

This reverts commit b836410.

Signed-off-by: Mikołaj Błaż <[email protected]>

* Remove backup .nemo after success

Signed-off-by: Mikołaj Błaż <[email protected]>

* Update tests

Signed-off-by: Mikołaj Błaż <[email protected]>

* Backup .nemo imediately before save_to

Signed-off-by: Mikołaj Błaż <[email protected]>

* Apply isort and black reformatting

Signed-off-by: mikolajblaz <[email protected]>

* Fix CTC import

Signed-off-by: Mikołaj Błaż <[email protected]>

---------

Signed-off-by: Mikołaj Błaż <[email protected]>
Signed-off-by: dimapihtar <[email protected]>
Signed-off-by: mikolajblaz <[email protected]>
Co-authored-by: dimapihtar <[email protected]>
@titu1994
Copy link
Collaborator

Yup needs to be cherry picked into 2.0 as well

BoxiangW pushed a commit to BoxiangW/NeMo that referenced this pull request Jun 5, 2024
* Remove .nemo instead of renaming

Signed-off-by: Mikołaj Błaż <[email protected]>

* add ignore_errors=True flag

Signed-off-by: dimapihtar <[email protected]>

* Revert "Remove .nemo instead of renaming"

This reverts commit b836410.

Signed-off-by: Mikołaj Błaż <[email protected]>

* Remove backup .nemo after success

Signed-off-by: Mikołaj Błaż <[email protected]>

* Update tests

Signed-off-by: Mikołaj Błaż <[email protected]>

* Backup .nemo imediately before save_to

Signed-off-by: Mikołaj Błaż <[email protected]>

* Apply isort and black reformatting

Signed-off-by: mikolajblaz <[email protected]>

* Fix CTC import

Signed-off-by: Mikołaj Błaż <[email protected]>

---------

Signed-off-by: Mikołaj Błaż <[email protected]>
Signed-off-by: dimapihtar <[email protected]>
Signed-off-by: mikolajblaz <[email protected]>
Co-authored-by: dimapihtar <[email protected]>
Signed-off-by: Boxiang Wang <[email protected]>
janekl pushed a commit that referenced this pull request Jun 12, 2024
* Remove .nemo instead of renaming

Signed-off-by: Mikołaj Błaż <[email protected]>

* add ignore_errors=True flag

Signed-off-by: dimapihtar <[email protected]>

* Revert "Remove .nemo instead of renaming"

This reverts commit b836410.

Signed-off-by: Mikołaj Błaż <[email protected]>

* Remove backup .nemo after success

Signed-off-by: Mikołaj Błaż <[email protected]>

* Update tests

Signed-off-by: Mikołaj Błaż <[email protected]>

* Backup .nemo imediately before save_to

Signed-off-by: Mikołaj Błaż <[email protected]>

* Apply isort and black reformatting

Signed-off-by: mikolajblaz <[email protected]>

* Fix CTC import

Signed-off-by: Mikołaj Błaż <[email protected]>

---------

Signed-off-by: Mikołaj Błaż <[email protected]>
Signed-off-by: dimapihtar <[email protected]>
Signed-off-by: mikolajblaz <[email protected]>
Co-authored-by: dimapihtar <[email protected]>
Signed-off-by: Jan Lasek <[email protected]>
rohitrango pushed a commit to rohitrango/NeMo that referenced this pull request Jun 25, 2024
* Remove .nemo instead of renaming

Signed-off-by: Mikołaj Błaż <[email protected]>

* add ignore_errors=True flag

Signed-off-by: dimapihtar <[email protected]>

* Revert "Remove .nemo instead of renaming"

This reverts commit b836410.

Signed-off-by: Mikołaj Błaż <[email protected]>

* Remove backup .nemo after success

Signed-off-by: Mikołaj Błaż <[email protected]>

* Update tests

Signed-off-by: Mikołaj Błaż <[email protected]>

* Backup .nemo imediately before save_to

Signed-off-by: Mikołaj Błaż <[email protected]>

* Apply isort and black reformatting

Signed-off-by: mikolajblaz <[email protected]>

* Fix CTC import

Signed-off-by: Mikołaj Błaż <[email protected]>

---------

Signed-off-by: Mikołaj Błaż <[email protected]>
Signed-off-by: dimapihtar <[email protected]>
Signed-off-by: mikolajblaz <[email protected]>
Co-authored-by: dimapihtar <[email protected]>
@ko3n1g ko3n1g mentioned this pull request Jul 18, 2024
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ASR bug Something isn't working core Changes to NeMo Core Run CICD
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enormous number of .nemo checkpoints produced in training
5 participants