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

Added MLflow callback #770

Merged
merged 9 commits into from
Jun 17, 2021
Merged

Added MLflow callback #770

merged 9 commits into from
Jun 17, 2021

Conversation

cacharle
Copy link
Contributor

@cacharle cacharle commented May 5, 2021

Here is a small draft for #769, I feel like the different loggers have a lot in common and could be refactored in a common class.

@BenjaminBossan
Copy link
Collaborator

Thank you for working on this. I have a few change suggestions how to possibly change this. Please tell me what you think.

As you probably saw, this implementation is a bit different than those for tensorboard, neptune, sacred, etc. They all use an object that encompasses something like an "experiment" or "session", which is passed to the logger and is used to run all the methods on. Here, instead we have instead the local import of mlflow. If possible, I would like to see the same design pattern used here as for the other loggers.

Without any knowledge of mlflow, I took a dive through the code and it seems like under the hood, mlflow.log_metric is indeed just a shortcut to retrieve an MlflowClient, on which the log_metric method is called. So I wonder if we can make use of that, similar to how it's shown in the mlflow docs here. Since you know mlflow much better, do you believe this is feasible?

And before doing any in depth review and testing out mlflow, could you please rename the callback to MlflowLogger or something similar, and also add tests? Again, take inspiration from (and copy) code from the other loggers.

@BenjaminBossan
Copy link
Collaborator

@cacharle Any updates, do you need support?

@cacharle
Copy link
Contributor Author

cacharle commented Jun 7, 2021

Hi, found a way to use a Run and MlflowClient instance instead of calling the the basic mlflow API.
I'll try to add the tests by this weekend.

@BenjaminBossan
Copy link
Collaborator

Please tell me once the PR is ready for review.

@cacharle cacharle changed the title Added MLflow callback draft Added MLflow callback Jun 9, 2021
Copy link
Collaborator

@BenjaminBossan BenjaminBossan left a comment

Choose a reason for hiding this comment

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

Thanks a lot for addressing my initial comments. I tested the MLFlow logger out and it worked well. So this is a very welcome addition.

There are a few things that I would like you to address before merging, please take a look at the comments. On top of that, could you please add an entry to the CHANGES.md? Thanks.

@cacharle
Copy link
Contributor Author

Should I squash all the commit I made before merging the PR to avoid cluttering the logs?

cacharle added 2 commits June 13, 2021 15:25
- doc string describing the logger usage and his parameters
- Tidying up the unit tests
- suffixing the attributes out of __init__
@cacharle cacharle requested a review from BenjaminBossan June 13, 2021 13:44
@BenjaminBossan
Copy link
Collaborator

Should I squash all the commit I made before merging the PR to avoid cluttering the logs?

Please don't, it makes reviewing harder. I will squash before merging :)

Copy link
Collaborator

@BenjaminBossan BenjaminBossan left a comment

Choose a reason for hiding this comment

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

Thanks for addressing the comments. The MLFlow logger is almost good to go, there are only a few minor comments left and a minor merge conflict to solve.

- Added missing commas
- Added run and client parameters documentation for default behaviors
- Updated mlflow reference to use intersphinx instead of URLs.
@cacharle cacharle requested a review from BenjaminBossan June 15, 2021 16:09
@BenjaminBossan
Copy link
Collaborator

Thanks for implementing these changes and going through the extra effort of linking to the MLFlow docs. Now there is only the merge conflict left to solve :)

Copy link
Collaborator

@BenjaminBossan BenjaminBossan left a comment

Choose a reason for hiding this comment

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

Thanks, great work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants