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

Add singleton logger #873

Merged
merged 4 commits into from
Oct 9, 2024
Merged

Add singleton logger #873

merged 4 commits into from
Oct 9, 2024

Conversation

rayg1234
Copy link
Collaborator

@rayg1234 rayg1234 commented Oct 9, 2024

The singleton logger will let us log from anywhere in the code. This will also replace the old loggers that can be deprecated. User just need to specify logger.name = wandb_singleton

Example Usage (can be placed anywhere):
WandBSingletonLogger.get_instance().log({"energy": energy.max()}, commit=False)

Note the commit = False will let wandb know the logging of the current isn't complete and will log the output when the step is updated (ie: in the trainer)

@rayg1234 rayg1234 added enhancement New feature or request minor Minor version release labels Oct 9, 2024
@rayg1234 rayg1234 marked this pull request as ready for review October 9, 2024 01:06
@rayg1234 rayg1234 requested review from misko and kyonofx October 9, 2024 01:06
Copy link

codecov bot commented Oct 9, 2024

Codecov Report

Attention: Patch coverage is 40.00000% with 24 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/fairchem/core/common/logger.py 37.14% 22 Missing ⚠️
src/fairchem/core/trainers/base_trainer.py 60.00% 2 Missing ⚠️
Files with missing lines Coverage Δ
src/fairchem/core/trainers/base_trainer.py 87.58% <60.00%> (-0.34%) ⬇️
src/fairchem/core/common/logger.py 58.97% <37.14%> (-9.32%) ⬇️

misko
misko previously approved these changes Oct 9, 2024
Copy link
Collaborator

@misko misko left a comment

Choose a reason for hiding this comment

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

LGTM! 🚀

@rayg1234 rayg1234 enabled auto-merge October 9, 2024 18:09
@rayg1234 rayg1234 added this pull request to the merge queue Oct 9, 2024
Merged via the queue into main with commit f38767c Oct 9, 2024
8 checks passed
@rayg1234 rayg1234 deleted the rgao_singleton_logger branch October 9, 2024 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request minor Minor version release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants