-
Notifications
You must be signed in to change notification settings - Fork 33
Reduce duplicated logging code, standardize logs #777
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
base: main
Are you sure you want to change the base?
Conversation
jpdunc23
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the nice cleanup. I noticed a couple of minor inconsistencies and an unused arg. Otherwise, LGTM.
| config=config, env_vars=env_vars, resumable=resumable, **kwargs | ||
| config = to_flat_dict(dataclasses.asdict(self)) | ||
| self.logging.configure_logging( | ||
| self.experiment_dir, log_filename, config=config, resumable=True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| self.experiment_dir, log_filename, config=config, resumable=True | |
| self.experiment_dir, log_filename, config=config, resumable=False |
| self.logging.configure_wandb( | ||
| config=config, env_vars=env_vars, resumable=resumable, **kwargs | ||
| self.logging.configure_logging( | ||
| self.experiment_dir, log_filename, config=config, resumable=True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| self.experiment_dir, log_filename, config=config, resumable=True | |
| self.experiment_dir, log_filename, config=config, resumable=False |
| experiment_dir: str, | ||
| log_filename: str, | ||
| config: Mapping[str, Any], | ||
| resumable: bool = False, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default value for resumable was changed from True to False. Please double check that resumable=True is explicitly passed everywhere configure_wandb was previously called without the resumable argument.
| def configure_wandb( | ||
| self, env_vars: dict | None = None, resumable: bool = False, **kwargs | ||
| ): | ||
| config = to_flat_dict(dataclasses.asdict(self)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should remove to_flat_dict here (and other inference entrypoints) as was done in the training scripts?
| experiment_dir=experiment_dir, | ||
| resumable=resumable, | ||
| dir=wandb_dir, | ||
| **kwargs, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
**kwargs is not longer used. Do we need it?
This PR moves low-level logging logic into the configure_logging helper, which now configures all types of logging including wandb.
All entrypoints now log all of the information we log at the start of runs.
Changes:
LoggingConfig.configure_loggingnow takes inconfigandresumablearguments for configuring WandB.Reduced duplicated logging code in train and inference entrypoints.
Tests added
Resolves #536