Skip to main content

MLflow is an open source platform for the complete machine learning lifecycle

Project description

PyPI - Version

Go backend for MLflow

In order to increase the performance of the tracking server and the various stores, we propose to rewrite the server and store implementation in Go.

Getting started

Installation

pip install mlflow-go-backend

CLI Usage

mlflow-go-backend is meant to be a drop-in-replacement for mlflow.

You can update your existing mlflow command with mlflow-go:

- mlflow server --backend-store-uri postgresql://postgres:postgres@localhost:5432/postgres
+ mlflow-go server --backend-store-uri postgresql://postgres:postgres@localhost:5432/postgres

Every existing setting of mlflow server can be passed to mlflow-go.

[!CAUTION] The Go implementation currently does not support file storage as a backend store. You must provide the --backend-store-uri argument pointing to a database.

Python Usage

import mlflow
import mlflow_go_backend

# Enable the Go client implementation (disabled by default)
mlflow_go_backend.enable_go()

# Set the tracking URI (you can also set it via the environment variable MLFLOW_TRACKING_URI)
# Currently only database URIs are supported
mlflow.set_tracking_uri("sqlite:///mlflow.db")

# Use MLflow as usual
mlflow.set_experiment("my-experiment")

with mlflow.start_run():
    mlflow.log_param("param", 1)
    mlflow.log_metric("metric", 2)

Python Store Usage

import logging
import mlflow
import mlflow_go_backend

# Enable debug logging
logging.basicConfig()
logging.getLogger('mlflow_go_backend').setLevel(logging.DEBUG)

# Enable the Go client implementation (disabled by default)
mlflow_go_backend.enable_go()

# Instantiate the tracking store with a database URI
tracking_store = mlflow.tracking._tracking_service.utils._get_store('sqlite:///mlflow.db')

# Call any tracking store method
tracking_store.get_experiment(0)

# Instantiate the model registry store with a database URI
model_registry_store = mlflow.tracking._model_registry.utils._get_store('sqlite:///mlflow.db')

# Call any model registry store method
model_registry_store.get_latest_versions("model")

Why bother?

For that sweet performance my friend!

Initial benchmarks show us that critical API calls are faster and Go can handle more concurrent requests.

Duration Results Iteration Results

[!NOTE] These were initial results and can perhaps still be more optimized.

See benchmarks for more information.

Contribution

Try it out!

We advocate this project as a drop-in replacement for mlflow. Please give it a try, and let us know if anything isn't working for you! We look forward to your feedback!

Missing Endpoints

Hey there! We need your help! This project is not yet a full port of the current tracking server. Not every endpoint in the REST API is implemented in Go. Those missing are redirected to the existing Python implementation. Please consider helping us out and implement a missing endpoint.

Not yet a Go wizard? We've collected some resources to learn Go. Trust us, it will be an enriching and fun experience!

Community

There is a dedicated Slack channel called #mlflow-go on the official mlflow Slack. Shoot us a message if you have any questions!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

mlflow_go_backend-0.2.2-py3-none-win_arm64.whl (7.1 MB view details)

Uploaded Python 3Windows ARM64

mlflow_go_backend-0.2.2-py3-none-win_amd64.whl (7.8 MB view details)

Uploaded Python 3Windows x86-64

mlflow_go_backend-0.2.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (9.9 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

mlflow_go_backend-0.2.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (9.6 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

mlflow_go_backend-0.2.2-py3-none-macosx_11_0_arm64.whl (7.1 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

mlflow_go_backend-0.2.2-py3-none-macosx_10_13_x86_64.whl (7.6 MB view details)

Uploaded Python 3macOS 10.13+ x86-64

File details

Details for the file mlflow_go_backend-0.2.2-py3-none-win_arm64.whl.

File metadata

File hashes

Hashes for mlflow_go_backend-0.2.2-py3-none-win_arm64.whl
Algorithm Hash digest
SHA256 c7c4c469229864bf041dc446fcf1c878ebcf73712392762ef74181fd7bfa2078
MD5 c1ef5e4b40b22e999cfe7f66560fd6c0
BLAKE2b-256 a0cf7214f1989916479c728176cf69f382d58c9a519b7ccc95ee6183ad1a203e

See more details on using hashes here.

File details

Details for the file mlflow_go_backend-0.2.2-py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for mlflow_go_backend-0.2.2-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 cda07bf723554f13508e2042ffb3965d4fcbf8202f74b216245d1c43e61b9f58
MD5 d15e97bcd51dedee7effca87bccb2042
BLAKE2b-256 96b75ae0ab1606bde891037e3a780f0462d527c6378eacca74b2837a226cb67d

See more details on using hashes here.

File details

Details for the file mlflow_go_backend-0.2.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mlflow_go_backend-0.2.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 49b014275d6310b926212e5c00f2e4a8f52d1b6e174ead7ffa2b57bf929f15bf
MD5 eebc4e1771f654fd04dc894feafe165a
BLAKE2b-256 08b05022e418b733a11992dc86b2338c0d495c5f9a4d04f9ef8cb0d9d47ba134

See more details on using hashes here.

File details

Details for the file mlflow_go_backend-0.2.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for mlflow_go_backend-0.2.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 d0131a8b2efcd41174042be1ef2b7149598352a1de7ea3c303810c064ad87b24
MD5 f4c560699696017c3e634ece58d995ff
BLAKE2b-256 f59d842040a9efe4c4afe5dd3a76a71866eb3e2d8b32f06d56b079d10390ce02

See more details on using hashes here.

File details

Details for the file mlflow_go_backend-0.2.2-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for mlflow_go_backend-0.2.2-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b4a0dbc780e70532c1966865e5359f1e782e3a459fb2e14330bb3dc4aeb635e7
MD5 35b23f29b84da3f05ea2acb522c9aec1
BLAKE2b-256 29edf152c400c27be8d71599859612eb1f96ef41e1727adeea2391bf41c0e9fc

See more details on using hashes here.

File details

Details for the file mlflow_go_backend-0.2.2-py3-none-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for mlflow_go_backend-0.2.2-py3-none-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 7536a686a43b3c6e87ffd85de53d71e5d5512bff890965afccaea94aeccfdc2e
MD5 f613cb2e12615540dd56b8628c9668af
BLAKE2b-256 fc5b6b507b4d63d8bd3aa3038367eb286bd0874d3f9f970a6fb2df693d71e6c1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page