Machine Learning Orchestration
Project description
Overview
The dbnd-mlflow plugin allows storing mlflow metrics to DBND tracker together with duplicating them to the mlflow store.
Install
pip install dbnd-mlflow
# or
pip install databand[mlflow]
Config
[core]
# Databand store url should be defined
databand_url=http://localhost:8080
[mlflow_tracking]
# Enable tracking to Databand store
databand_tracking=True
# Optionally, define a URI for mlflow store,
# mlflow.get_tracking_uri() is used by default
; duplicate_tracking_to=http://mlflow-store/
Run example
You might need to install examples at first pip install dbnd-examples.
dbnd run dbnd_examples.tracking.tracking_mlflow.task_with_mflow
# or set configs manually
dbnd run dbnd_examples.tracking.tracking_mlflow.task_with_mflow --set-config mlflow_tracking.databand_tracking=True
Explanation
mlflow_example code
from dbnd import task
from mlflow import start_run, end_run
from mlflow import log_metric, log_param
@task
def mlflow_example():
start_run()
# params
log_param("param1", randint(0, 100))
log_param("param2", randint(0, 100))
# metrics
log_metric("foo1", random())
log_metric("foo2", random())
end_run()
Execution flow:
- Run
dbnd run mlflow_example --set-config mlflow_tracking.databand_tracking=True - dbnd creates a new dbnd context
dbnd_on_pre_init_contexthook fromdbnd_mlflowis triggered- a new uri is computed to be used by mlflow, e.g.:
dbnd://localhost:8080?duplicate_tracking_to=http%253A%252F%252Fmlflow-store%253A80%252F
- the new uri is set to be used with
mlflow.set_tracking_uri()
- a new uri is computed to be used by mlflow, e.g.:
mlflow_exampletask starts:mlflow.start_run()mlflowreadsentry_pointsfor each installed package and finds:- "dbnd = dbnd_mlflow.tracking_store:get_dbnd_store",
- "dbnd+s = dbnd_mlflow.tracking_store:get_dbnd_store",
- "databand = dbnd_mlflow.tracking_store:get_dbnd_store",
- "databand+s = dbnd_mlflow.tracking_store:get_dbnd_store",
mlflowcreatesTrackingStoreClientusing the new uri- uri schema instructs to use
dbnd_mlflow.tracking_store:get_dbnd_storeget_dbnd_storecreates dbndTrackingAPIClientget_dbnd_storecreates mlflow tracking store to duplicate tracking toget_dbnd_storereturnsDatabandStoreinstance
log_param()/log_metric()- calls to
DatabandStore- calls to
TrackingAPIClient - calls to mlflow tracking store to duplicate tracking to
- calls to
- calls to
mlflow.end_run()
mlflow_exampleendsdbnd_on_exit_contexthook fromdbnd_mlflowis triggered- restore original mlflow tracking uri
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
dbnd-mlflow-0.56.6.tar.gz
(10.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dbnd-mlflow-0.56.6.tar.gz.
File metadata
- Download URL: dbnd-mlflow-0.56.6.tar.gz
- Upload date:
- Size: 10.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
89038bd36deea0d736ba61a6ecff36a0a6a0d5ae861d3d0701383e32ceaeeeda
|
|
| MD5 |
2d8598011cf419b601991ecfd57f84de
|
|
| BLAKE2b-256 |
0d4afebcd026db22b623012d611b22fbd7cab46f1d74ed6ee6eec2b62ff4ab6f
|
File details
Details for the file dbnd_mlflow-0.56.6-py2.py3-none-any.whl.
File metadata
- Download URL: dbnd_mlflow-0.56.6-py2.py3-none-any.whl
- Upload date:
- Size: 10.9 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
01a00319314d7be56fbd1c7e53709db5d834315debf8d5d7d7501fbe71f7bef1
|
|
| MD5 |
ef72e9924c548677e384f4f20683df1a
|
|
| BLAKE2b-256 |
fc30a39d10147bdb4aa224e17342851fec4535dbd70f294192b0c767c1dbe011
|