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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Add singleton logger #873

wants to merge 2 commits into from

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%) ⬇️

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.

1 participant