-
Notifications
You must be signed in to change notification settings - Fork 16
Metric Logging #59
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
Metric Logging #59
Conversation
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.
A few more small comments, after that I think this is good!
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.
@calvinpelletier bumping this PR. Looks like there are some merge conflicts. Let's resolve those and address the remaining comments, then we should be good to land
@ebsmothers addressed the comments. I'll leave the config class for the next PR after adding metric logging for sft_v2 and toy_rl |
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.
Two more nits, otherwise looks good!
Example: | ||
>>> logger = get_logger("INFO") | ||
>>> logger.info("Hello world!") | ||
INFO:torchtune.utils._logging:Hello world! |
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.
INFO:torchtune.utils._logging:Hello world! | |
INFO:forge.util.logging:Hello world! |
freq (Mapping[str, int]): | ||
calls to `log` and `log_dict` will be ignored if `step % freq[metric_name] != 0` | ||
log_dir (Optional[str]): WandB log directory. | ||
project (str): WandB project name. Default is `torchtune`. |
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.
project (str): WandB project name. Default is `torchtune`. | |
project (str): WandB project name. |
""" | ||
rank = dist.get_rank() if dist.is_available() and dist.is_initialized() else 0 | ||
if rank != 0: | ||
return |
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.
Shouldn't log rank be configurable like how titan did? But I guess we can always improve later.
Build metric logger:
Log a metric:
If you want to check if this is a log step before calculating the metric:
Open questions:
Follow up PRs: