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

Lighting logger integration #241

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

Conversation

annaelisalappe
Copy link
Collaborator

This PR adds an Adapter (Logger) to enable logging from within a Lightning Trainer. This is necessary because Lightning provides its own logger component, which any custom loggers have to comply with. However, should a user want to log using an itwinai logger e.g. the Prov4MLLogger, they need an adapter to convert the lightning logger calls to calls to the itwinai logger.

@annaelisalappe annaelisalappe self-assigned this Nov 8, 2024
@annaelisalappe annaelisalappe added the enhancement New feature or request label Nov 8, 2024
Copy link
Collaborator

@matbun matbun left a comment

Choose a reason for hiding this comment

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

The lightning's logger for itwinai seems very well done. I would improve a couple of things I left as comments and add more tests. Also, the CI pipeline is currently failing since there are two test modules with the same name (see comments)

Could you add the loggers module here?

torch_modules = [

src/itwinai/torch/loggers.py Outdated Show resolved Hide resolved
src/itwinai/torch/loggers.py Outdated Show resolved Hide resolved
src/itwinai/torch/loggers.py Outdated Show resolved Hide resolved
src/itwinai/torch/loggers.py Outdated Show resolved Hide resolved
src/itwinai/torch/loggers.py Outdated Show resolved Hide resolved
tests/torch/test_loggers.py Outdated Show resolved Hide resolved
tests/torch/test_loggers.py Outdated Show resolved Hide resolved
src/itwinai/torch/loggers.py Show resolved Hide resolved
tests/torch/test_loggers.py Outdated Show resolved Hide resolved
tests/torch/test_loggers.py Outdated Show resolved Hide resolved
@matbun
Copy link
Collaborator

matbun commented Nov 11, 2024

@annaelisalappe it seems that you have a doppelganger in the commits history

Also, could you update this page with an example on the lightning logger please? https://itwinai.readthedocs.io/latest/how-it-works/loggers/explain_loggers.html

Copy link
Collaborator

@matbun matbun left a comment

Choose a reason for hiding this comment

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

micro fixes before merging

# --------------------------------------------------------------------------------------
# Part of the interTwin Project: https://www.intertwin.eu/
#
# Created by: Anna Elisa Lappe
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think I created it :)

Comment on lines 200 to 201
print(f"Path: {path}")
print(f"Identifier: {artifact_path}")
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would remove these prints. Or is there a reason to have them?

Choose a reason for hiding this comment

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

Nope, I will remove them :)

tests/loggers/test_loggers.py Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants