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

[Bugfix] Fix a bug in filtering checkpoints #6851

Merged
merged 4 commits into from
Aug 8, 2023

Conversation

yaox12
Copy link
Contributor

@yaox12 yaox12 commented Jun 12, 2023

What does this PR do ?

When we cannot find self.monitor in checkpoint, checkpoint.find(self.monitor) should be -1 so index should be len(self.monitor) according to L98.

With the current code, checkpoints such as mp_rank_00_model_weights.ckpt would go to the True condition and cause an error in Line 103 because it cannot find the correct value to be converted to float.

index = checkpoint.find(self.monitor) + len(self.monitor) + 1 # Find monitor in str + 1 for '='
if index != -1:
match = re.search('[A-z]', checkpoint[index:])
if match:
value = checkpoint[index : index + match.start() - 1] # -1 due to separator hypen
self.best_k_models[checkpoint] = float(value)
.

Collection: [Note which collection this PR will affect]

  • NeMo/nemo/utils/callbacks/nemo_model_checkpoint.py

Changelog

Usage

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

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

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 !

@github-actions
Copy link
Contributor

This PR is stale because it has been open for 14 days with no activity. Remove stale label or comment or update or this will be closed in 7 days.

@github-actions github-actions bot added the stale label Jun 27, 2023
@github-actions github-actions bot removed the stale label Jul 4, 2023
@yaox12
Copy link
Contributor Author

yaox12 commented Jul 5, 2023

@titu1994 Can I get this PR merged?

@github-actions
Copy link
Contributor

This PR is stale because it has been open for 14 days with no activity. Remove stale label or comment or update or this will be closed in 7 days.

@github-actions github-actions bot added the stale label Jul 20, 2023
@github-actions github-actions bot removed the stale label Jul 22, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Aug 6, 2023

This PR is stale because it has been open for 14 days with no activity. Remove stale label or comment or update or this will be closed in 7 days.

@github-actions github-actions bot added the stale label Aug 6, 2023
@github-actions github-actions bot removed the stale label Aug 8, 2023
@titu1994 titu1994 merged commit 13791d2 into NVIDIA:main Aug 8, 2023
@yaox12 yaox12 deleted the yaox12-patch-1 branch August 9, 2023 01:17
dorotat-nv pushed a commit to dorotat-nv/NeMo that referenced this pull request Aug 24, 2023
rohitrango pushed a commit to rohitrango/NeMo that referenced this pull request Jun 25, 2024
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.

[Bug] A bug in filtering checkpoints
2 participants