Mlflow integration callback#8016
Merged
LysandreJik merged 15 commits intohuggingface:masterfrom Oct 26, 2020
noise-field:mlflow-integration-callback
Merged
Mlflow integration callback#8016LysandreJik merged 15 commits intohuggingface:masterfrom noise-field:mlflow-integration-callback
LysandreJik merged 15 commits intohuggingface:masterfrom
noise-field:mlflow-integration-callback
Conversation
Add integration code for MLflow in integrations.py along with the code that checks that MLflow is installed.
Add import of MLflowCallback in trainer.py
Allow the callback to handle model argument and store model config items as hyperparameters.
MLflow cannot log more than a hundred parameters at once. Code added to split the parameters into batches of 100 items and log the batches one by one.
The "fluent" api used in MLflow integration allows only one run to be active at any given moment. If the Trainer is disposed off and a new one is created, but the training is not finished, it will refuse to log the results when the next trainer is created.
Add integration code for MLflow in integrations.py along with the code that checks that MLflow is installed.
Add import of MLflowCallback in trainer.py
Allow the callback to handle model argument and store model config items as hyperparameters.
MLflow cannot log more than a hundred parameters at once. Code added to split the parameters into batches of 100 items and log the batches one by one.
The "fluent" api used in MLflow integration allows only one run to be active at any given moment. If the Trainer is disposed off and a new one is created, but the training is not finished, it will refuse to log the results when the next trainer is created.
…e-field/transformers into mlflow-integration-callback
sgugger
approved these changes
Oct 26, 2020
Collaborator
sgugger
left a comment
There was a problem hiding this comment.
This is very clean, thanks a lot for this PR!
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
This PR adds Trainer integration with MLflow.
It is implemented in roughly the same way as other integration callbacks (CometML, wandb) and gets added to the list of Trainer callbacks automatically when mlflow is installed. All the mlflow parameters are configured with env variables, as described in the library documentation. This PR adds an additional environment variable,
HF_MLFLOW_LOG_ARTIFACTS, which controls whether to use mlflow artifact logging facility to save artifacts generated after training (it doesn't make much sense if mlflow is used locally).Fixes #7698
Before submitting
Pull Request section?
to the it if that's the case.
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
@sgugger