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

Sanity checks for unfinished checkpoints removal #10228

Merged
merged 12 commits into from
Aug 29, 2024

Conversation

jbieniusiewi
Copy link
Collaborator

What does this PR do ?

The following scenario was recently observed:

  • Last checkpoint writing was interrupted due to an irrelevant issue
  • Hence last checkpoint was marked as "unfinished" (and there was no other last checkpoint)
  • Hence the following training silently skipped the last checkpoint and started from scratch
  • As a result, training was not making expected progress despite many training runs

This PR adds some sanity checks to ensure that when the last/end checkpoint is unfinished, it wont get silently skipped and deleted. Instead, user is supposed to remove them manually.

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: Jacek Bieniusiewicz <jbieniusiewi@nvidia.com>
@github-actions github-actions bot added the core Changes to NeMo Core label Aug 22, 2024
jbieniusiewi and others added 2 commits August 22, 2024 00:23
Signed-off-by: jbieniusiewi <jbieniusiewi@users.noreply.github.com>
Signed-off-by: Jacek Bieniusiewicz <jbieniusiewi@nvidia.com>
@jbieniusiewi jbieniusiewi marked this pull request as ready for review August 22, 2024 00:38
@jbieniusiewi jbieniusiewi self-assigned this Aug 22, 2024
maanug-nv
maanug-nv previously approved these changes Aug 22, 2024
Copy link
Collaborator

@maanug-nv maanug-nv left a comment

Choose a reason for hiding this comment

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

Thanks @jbieniusiewi . Very simple, and should consistently avoid that training restart we saw, even with auto relaunch.

@maanug-nv
Copy link
Collaborator

maanug-nv commented Aug 23, 2024

@jbieniusiewi could you also add the same check for 2.0. The unfinished checkpoint filtering is here in 2.0.

jbieniusiewi and others added 2 commits August 26, 2024 15:52
Signed-off-by: Jacek Bieniusiewicz <jbieniusiewi@nvidia.com>
@jbieniusiewi
Copy link
Collaborator Author

jbieniusiewi commented Aug 26, 2024

Thank you for the review @maanug-nv.
I've added checks for NeMo 2.0. One more approval is needed to merge it, so I re-requested a review.

@maanug-nv
Copy link
Collaborator

maanug-nv commented Aug 26, 2024

-@ashors1 Do we have/plan to have tests for AutoResume? Looks like they are in tests/lightning/test_nemo_logger.py. @jbieniusiewi final request, can we include the same test you added for exp manager to NeMoLogger/AutoResume as well?

Signed-off-by: Jacek Bieniusiewicz <jbieniusiewi@nvidia.com>
Signed-off-by: Jacek Bieniusiewicz <jbieniusiewi@nvidia.com>
@jbieniusiewi
Copy link
Collaborator Author

@maanug-nv Sure, I've added tests to tests/lightning/test_nemo_logger.py.

Copy link
Collaborator

@pzelasko pzelasko left a comment

Choose a reason for hiding this comment

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

Thanks! LGTM

@jbieniusiewi jbieniusiewi merged commit 006d65f into main Aug 29, 2024
131 checks passed
@jbieniusiewi jbieniusiewi deleted the fixed_last_chkpt_removal branch August 29, 2024 17:58
adityavavre pushed a commit to adityavavre/NeMo that referenced this pull request Sep 15, 2024
* Added sanity checks

Signed-off-by: Jacek Bieniusiewicz <jbieniusiewi@nvidia.com>

* Apply isort and black reformatting

Signed-off-by: jbieniusiewi <jbieniusiewi@users.noreply.github.com>

* Updated error msg

Signed-off-by: Jacek Bieniusiewicz <jbieniusiewi@nvidia.com>

* Added checks for NeMo 2.0

Signed-off-by: Jacek Bieniusiewicz <jbieniusiewi@nvidia.com>

* Updated NeMo 2.0 test

Signed-off-by: Jacek Bieniusiewicz <jbieniusiewi@nvidia.com>

* Apply isort and black reformatting

Signed-off-by: jbieniusiewi <jbieniusiewi@users.noreply.github.com>

* fixed test_nemo_logger.py

Signed-off-by: Jacek Bieniusiewicz <jbieniusiewi@nvidia.com>

---------

Signed-off-by: Jacek Bieniusiewicz <jbieniusiewi@nvidia.com>
Signed-off-by: jbieniusiewi <jbieniusiewi@users.noreply.github.com>
Co-authored-by: jbieniusiewi <jbieniusiewi@users.noreply.github.com>
Signed-off-by: adityavavre <aditya.vavre@gmail.com>
monica-sekoyan pushed a commit that referenced this pull request Oct 14, 2024
* Added sanity checks

Signed-off-by: Jacek Bieniusiewicz <jbieniusiewi@nvidia.com>

* Apply isort and black reformatting

Signed-off-by: jbieniusiewi <jbieniusiewi@users.noreply.github.com>

* Updated error msg

Signed-off-by: Jacek Bieniusiewicz <jbieniusiewi@nvidia.com>

* Added checks for NeMo 2.0

Signed-off-by: Jacek Bieniusiewicz <jbieniusiewi@nvidia.com>

* Updated NeMo 2.0 test

Signed-off-by: Jacek Bieniusiewicz <jbieniusiewi@nvidia.com>

* Apply isort and black reformatting

Signed-off-by: jbieniusiewi <jbieniusiewi@users.noreply.github.com>

* fixed test_nemo_logger.py

Signed-off-by: Jacek Bieniusiewicz <jbieniusiewi@nvidia.com>

---------

Signed-off-by: Jacek Bieniusiewicz <jbieniusiewi@nvidia.com>
Signed-off-by: jbieniusiewi <jbieniusiewi@users.noreply.github.com>
Co-authored-by: jbieniusiewi <jbieniusiewi@users.noreply.github.com>
tomlifu pushed a commit to tomlifu/NeMo that referenced this pull request Oct 25, 2024
* Added sanity checks

Signed-off-by: Jacek Bieniusiewicz <jbieniusiewi@nvidia.com>

* Apply isort and black reformatting

Signed-off-by: jbieniusiewi <jbieniusiewi@users.noreply.github.com>

* Updated error msg

Signed-off-by: Jacek Bieniusiewicz <jbieniusiewi@nvidia.com>

* Added checks for NeMo 2.0

Signed-off-by: Jacek Bieniusiewicz <jbieniusiewi@nvidia.com>

* Updated NeMo 2.0 test

Signed-off-by: Jacek Bieniusiewicz <jbieniusiewi@nvidia.com>

* Apply isort and black reformatting

Signed-off-by: jbieniusiewi <jbieniusiewi@users.noreply.github.com>

* fixed test_nemo_logger.py

Signed-off-by: Jacek Bieniusiewicz <jbieniusiewi@nvidia.com>

---------

Signed-off-by: Jacek Bieniusiewicz <jbieniusiewi@nvidia.com>
Signed-off-by: jbieniusiewi <jbieniusiewi@users.noreply.github.com>
Co-authored-by: jbieniusiewi <jbieniusiewi@users.noreply.github.com>
Signed-off-by: Lifu Zhang <tomzhanglf@gmail.com>
tomlifu pushed a commit to tomlifu/NeMo that referenced this pull request Oct 25, 2024
* Added sanity checks

Signed-off-by: Jacek Bieniusiewicz <jbieniusiewi@nvidia.com>

* Apply isort and black reformatting

Signed-off-by: jbieniusiewi <jbieniusiewi@users.noreply.github.com>

* Updated error msg

Signed-off-by: Jacek Bieniusiewicz <jbieniusiewi@nvidia.com>

* Added checks for NeMo 2.0

Signed-off-by: Jacek Bieniusiewicz <jbieniusiewi@nvidia.com>

* Updated NeMo 2.0 test

Signed-off-by: Jacek Bieniusiewicz <jbieniusiewi@nvidia.com>

* Apply isort and black reformatting

Signed-off-by: jbieniusiewi <jbieniusiewi@users.noreply.github.com>

* fixed test_nemo_logger.py

Signed-off-by: Jacek Bieniusiewicz <jbieniusiewi@nvidia.com>

---------

Signed-off-by: Jacek Bieniusiewicz <jbieniusiewi@nvidia.com>
Signed-off-by: jbieniusiewi <jbieniusiewi@users.noreply.github.com>
Co-authored-by: jbieniusiewi <jbieniusiewi@users.noreply.github.com>
Signed-off-by: Lifu Zhang <tomzhanglf@gmail.com>
hainan-xv pushed a commit to hainan-xv/NeMo that referenced this pull request Nov 5, 2024
* Added sanity checks

Signed-off-by: Jacek Bieniusiewicz <jbieniusiewi@nvidia.com>

* Apply isort and black reformatting

Signed-off-by: jbieniusiewi <jbieniusiewi@users.noreply.github.com>

* Updated error msg

Signed-off-by: Jacek Bieniusiewicz <jbieniusiewi@nvidia.com>

* Added checks for NeMo 2.0

Signed-off-by: Jacek Bieniusiewicz <jbieniusiewi@nvidia.com>

* Updated NeMo 2.0 test

Signed-off-by: Jacek Bieniusiewicz <jbieniusiewi@nvidia.com>

* Apply isort and black reformatting

Signed-off-by: jbieniusiewi <jbieniusiewi@users.noreply.github.com>

* fixed test_nemo_logger.py

Signed-off-by: Jacek Bieniusiewicz <jbieniusiewi@nvidia.com>

---------

Signed-off-by: Jacek Bieniusiewicz <jbieniusiewi@nvidia.com>
Signed-off-by: jbieniusiewi <jbieniusiewi@users.noreply.github.com>
Co-authored-by: jbieniusiewi <jbieniusiewi@users.noreply.github.com>
Signed-off-by: Hainan Xu <hainanx@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Changes to NeMo Core Run CICD
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants