Skip to content

Commit

Permalink
MLFlow now uses env variable as default tracking uri (#7457)
Browse files Browse the repository at this point in the history
* Clarify logger flag

Clarify behavior of boolean values on the logger flag for Trainer.

* Update docs/source/common/trainer.rst

* doc

* MLFlow now uses env variable as default tracking uri

Solves #6894

* Update pytorch_lightning/loggers/mlflow.py

Co-authored-by: thomas chaton <[email protected]>

* changelog

Co-authored-by: SpontaneousDuck <[email protected]>
Co-authored-by: Ethan Harris <[email protected]>
Co-authored-by: Rohit Gupta <[email protected]>
Co-authored-by: Adrian Wälchli <[email protected]>
Co-authored-by: thomas chaton <[email protected]>
Co-authored-by: jirka <[email protected]>
  • Loading branch information
7 people authored May 12, 2021
1 parent b9a52fa commit 8cdbd03
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Changed `model.state_dict()` in `CheckpointConnector` to allow `training_type_plugin` to customize the model's `state_dict()` ([7474](https://github.com/PyTorchLightning/pytorch-lightning/pull/7474))


- MLflowLogger now uses the env variable `MLFLOW_TRACKING_URI` as default tracking uri ([7457](https://github.com/PyTorchLightning/pytorch-lightning/pull/7457))


### Deprecated


Expand Down
6 changes: 4 additions & 2 deletions pytorch_lightning/loggers/mlflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
-------------
"""
import logging
import os
import re
from argparse import Namespace
from time import time
Expand Down Expand Up @@ -85,7 +86,8 @@ def any_lightning_module_function_or_hook(self):
Args:
experiment_name: The name of the experiment
tracking_uri: Address of local or remote tracking server.
If not provided, defaults to `file:<save_dir>`.
If not provided, defaults to `MLFLOW_TRACKING_URI` environment variable if set, otherwise it falls
back to `file:<save_dir>`.
tags: A dictionary tags for the experiment.
save_dir: A path to a local directory where the MLflow runs get saved.
Defaults to `./mlflow` if `tracking_uri` is not provided.
Expand All @@ -104,7 +106,7 @@ def any_lightning_module_function_or_hook(self):
def __init__(
self,
experiment_name: str = 'default',
tracking_uri: Optional[str] = None,
tracking_uri: Optional[str] = os.getenv('MLFLOW_TRACKING_URI'),
tags: Optional[Dict[str, Any]] = None,
save_dir: Optional[str] = './mlruns',
prefix: str = '',
Expand Down

0 comments on commit 8cdbd03

Please sign in to comment.