MLflow plugin in Microsoft Fabric platform.
Project description
Introduction
Microsoft Fabric MLflow Plugin
This is a preview version of the MLflow plugin that connects the Python MLflow library to Fabric MLflow endpoints via its entry-points registry.
When the MLflow tracking URI is set to start with sds://, this plugin is activated and uses Fabric MLflow backend services as the MLflow tracking store.
Dependencies
Fabric officially supports MLflow 2.x. While support for MLflow 3 is in progress, please install MLflow or mlflow-skinny 2.x in your development or Fabric Notebook environment for now.
Setup
Fabric Notebook
%pip install synapseml-mlflow[online-notebook]
Don't forget the % prefix, which ensures the package is updated on all Spark driver and worker nodes at the same time.
In a Fabric Notebook, the MLflow tracking URI is set by default to the home Fabric workspace of your notebook. For example:
sds://api.fabric.microsoft.com/v1/workspaces/3aa8fea3-42f6-4326-924c-8ea8f9bd715f/mlflow
There is no need to set the tracking URI manually if you only want to log models to the same workspace. It is configured automatically, and private-link conditions are handled as well.
To log to a different workspace, simply change the workspace ID in the tracking URI.
import os
os.environ["MLFLOW_TRACKING_URI"] = "sds://api.fabric.microsoft.com/v1/workspaces/deeb59d0-8608-447c-98f3-09408a20cfe0/mlflow"
Other Environments
The optional online-notebook dependencies are not required:
pip install synapseml-mlflow
You must set the tracking URI first so the plugin knows your workspace ID. The URI format is the same as in a Fabric Notebook.
You must also configure credentials beforehand. Here is a complete example:
from azure.identity import (
ClientSecretCredential,
DefaultAzureCredential,
DeviceCodeCredential,
InteractiveBrowserCredential,
)
from fabric.analytics.environment.credentials import SetFabricAnalyticsDefaultTokenCredentialsGlobally
# Choose any credential type and register it with the Fabric Analytics SDK
SetFabricAnalyticsDefaultTokenCredentialsGlobally(InteractiveBrowserCredential())
import os
os.environ["MLFLOW_TRACKING_URI"] = "sds://api.fabric.microsoft.com/v1/workspaces/3aa8fea3-42f6-4326-924c-8ea8f9bd715f/mlflow"
import mlflow
mlflow.set_experiment("mlflow-experiment-1")
Workspace Private Link (WSPL)
If the target Fabric workspace has an inbound restriction, or your current workspace has an outbound restriction, you need to set the tracking URI host to the WSPL-specific FQDN. The format is shown below, where 3aa8fea3-42f6-4326-924c-8ea8f9bd715f is the workspace ID:
sds://3aa8fea342f64326924c8ea8f9bd715f.z3a.w.api.fabric.microsoft.com/v1/workspaces/3aa8fea3-42f6-4326-924c-8ea8f9bd715f/mlflow
Alternatively, you can let the Fabric Analytics SDK print the FQDN for you:
from fabric.analytics.environment.context import FabricContext, InternalContext
context = FabricContext(workspace_id="3aa8fea3-42f6-4326-924c-8ea8f9bd715f", internal_context=InternalContext(is_wspl_enabled=True))
print(context.pbi_shared_host)
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 Distributions
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 synapseml_mlflow-2.0.3-py3-none-any.whl.
File metadata
- Download URL: synapseml_mlflow-2.0.3-py3-none-any.whl
- Upload date:
- Size: 30.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: RestSharp/106.13.0.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bc8030fd8bd12ad9e3fc0a3f2201eff957474e1394662c440037989ef516b8bd
|
|
| MD5 |
f110755b300cf0690a7ece89cab8f59b
|
|
| BLAKE2b-256 |
4a3e8d390a4b285f673ef44bc2abf7aa3b22f3e9ef4776e857cc73ab1b14f20b
|