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

Fix WandBLogger to allow resuming runs with updated config values #1081

Merged
merged 3 commits into from
Jun 12, 2024

Conversation

parthsarthi03
Copy link
Contributor

Context

This PR aims to:

  • fix a bug

It addresses the issue #1080 where the WandBLogger fails to resume a run with an updated config file when allow_val_change is set to True in the config.

Changelog

The changes made in this PR are:

  1. Added self.config_allow_val_change = kwargs.get('allow_val_change', False) in the __init__ method of the WandBLogger class to retrieve the value of allow_val_change from the kwargs dictionary and store it as an instance variable.
  2. Modified the line self._wandb.config.update(resolved) to self._wandb.config.update(resolved, allow_val_change=self.config_allow_val_change) in the log_config method to pass the allow_val_change option to the update method based on the value provided during the initialization of the WandBLogger.

Test plan

Tested the modified WandBLogger by resuming a run with an updated config file where allow_val_change was set to True. The run resumed successfully without any errors, and the config values were updated as expected.

Copy link

pytorch-bot bot commented Jun 12, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/torchtune/1081

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 8063ffc with merge base 74fb5e4 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot
Copy link

Hi @parthsarthi03!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@parthsarthi03 parthsarthi03 changed the title fix wandb config update resume error Fix WandBLogger to allow resuming runs with updated config values Jun 12, 2024
@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 12, 2024
@ebsmothers
Copy link
Contributor

Thanks @parthsarthi03 for the PR! The change looks fine to me, but lint is failing. Mind fixing locally? Once CI is green I can merge this

@parthsarthi03
Copy link
Contributor Author

Thanks @parthsarthi03 for the PR! The change looks fine to me, but lint is failing. Mind fixing locally? Once CI is green I can merge this

Done!

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.

Project coverage is 26.65%. Comparing base (74fb5e4) to head (8063ffc).
Report is 1 commits behind head on main.

Files Patch % Lines
torchtune/utils/metric_logging.py 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1081      +/-   ##
==========================================
- Coverage   26.66%   26.65%   -0.01%     
==========================================
  Files         183      183              
  Lines        8326     8329       +3     
==========================================
  Hits         2220     2220              
- Misses       6106     6109       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@RdoubleA RdoubleA left a comment

Choose a reason for hiding this comment

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

Thanks for the fix! CI is green, so will merge this in

@RdoubleA RdoubleA merged commit 0e0aff0 into pytorch:main Jun 12, 2024
25 checks passed
maximegmd pushed a commit to maximegmd/torchtune that referenced this pull request Jul 13, 2024
@parthsarthi03 parthsarthi03 deleted the fix/config_allow_val_change branch November 17, 2024 01:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants