You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Manage models registries in Azure Machine Learning with MLflow
17
17
18
-
Azure Machine Learning supports MLflow for model management. This represents a convenient way to support the entire model lifecycle for users familiar with the MLFlow client. The following article describes the different capabilities and how it compares with other options.
18
+
Azure Machine Learning supports MLflow for model management. Such approach represents a convenient way to support the entire model lifecycle for users familiar with the MLFlow client. The following article describes the different capabilities and how it compares with other options.
* Some operations may be executed directly using the MLflow fluent API (`mlflow.<method>`). However, others may require to create an MLflow client, which allows to communicate with Azure Machine Learning in the MLflow protocol. You can create an `MlflowClient` object as follows. This tutorial will use the object `client` to refer to such MLflow client.
24
+
* Some operations may be executed directly using the MLflow fluent API (`mlflow.<method>`). However, others may require to create an MLflow client, which allows to communicate with Azure Machine Learning in the MLflow protocol. You can create an `MlflowClient` object as follows. This tutorial uses the object `client` to refer to such MLflow client.
25
25
26
26
```python
27
27
using mlflow
@@ -31,9 +31,11 @@ Azure Machine Learning supports MLflow for model management. This represents a c
31
31
32
32
## Registering new models in the registry
33
33
34
+
The models registry offer a convenient and centralized way to manage models in a workspace. Each workspace has its own independent models registry. The following section explains multiple ways to register models in the registry using MLflow SDK.
35
+
34
36
### Creating models from an existing run
35
37
36
-
If you have an MLflow model logged inside of a run and you want to register it in a registry, you can do that by using the run IDand the path where the model was logged. See [Manage experiments and runs with MLflow](how-to-track-experiments-mlflow.md) to know how to query this information if you don't have it.
38
+
If you have an MLflow model logged inside of a run and you want to register it in a registry, use the run IDand the path where the model was logged. See [Manage experiments and runs with MLflow](how-to-track-experiments-mlflow.md) to know how to query this information if you don't have it.
> __MLflow 2.0 advisory:__ In older versions of Mlflow (<2.0), use method `MlflowClient.list_registered_models()` instead.
86
96
87
97
### Getting specific versions of the model
88
98
89
-
The command above will retrieve the model object which contains all the model versions. However, if you want to get the last registered model version of a given model, you can use `get_registered_model`:
99
+
The `search_registered_models()`command retrieves the model object, which contains all the model versions. However, if you want to get the last registered model version of a given model, you can use `get_registered_model`:
90
100
91
101
```python
92
102
client.get_registered_model(model_name)
@@ -114,7 +124,7 @@ You can load models directly from the registry to restore the models objects tha
114
124
MLflow supports model's stages to manage model's lifecycle. Model's version can transition from one stage to another. Stages are assigned to a model's version (instead of models) which means that a given model can have multiple versions on different stages.
115
125
116
126
> [!IMPORTANT]
117
-
> Stages can only be accessed using the MLflow SDK. They don't show up in the [Azure Machine Learning Studio portal](https://ml.azure.com) and can't be retrieved using neither Azure Machine Learning SDK, Azure Machine Learning CLI, or Azure Machine Learning REST API. Creating deployment from a given model's stage is not supported by the moment.
127
+
> Stages can only be accessed using the MLflow SDK. They don't show up in the [Azure ML Studio portal](https://ml.azure.com) and can't be retrieved using neither Azure ML SDK, Azure ML CLI, or Azure ML REST API. Creating deployment from a given model's stage is not supported by the moment.
118
128
119
129
### Querying model stages
120
130
@@ -144,7 +154,7 @@ Transitioning a model's version to a particular stage can be done using the MLfl
By default, if there were an existing model version in that particular stage, it will remain there. Hence, it won't be replaced as multiple model's versions can be in the same stage at the same time. Alternatively, you can indicate `archive_existing_versions=True` to tell MLflow to move the existing model's version to the stage `Archived`.
157
+
By default, if there were an existing model version in that particular stage, it remains there. Hence, it isn't replaced as multiple model's versions can be in the same stage at the same time. Alternatively, you can indicate `archive_existing_versions=True` to tell MLflow to move the existing model's version to the stage `Archived`.
148
158
149
159
```python
150
160
client.transition_model_version_stage(
@@ -162,7 +172,7 @@ model = mlflow.pyfunc.load_model(f"models:/{model_name}/Staging")
162
172
163
173
## Editing and deleting models
164
174
165
-
Editing registered models is supported in both Mlflow and Azure Machine Learning. However, there are some differences important to be noticed:
175
+
Editing registered models is supported in both Mlflow and Azure ML. However, there are some differences important to be noticed:
166
176
167
177
> [!WARNING]
168
178
> Renaming models is not supported in Azure Machine Learning as model objects are immmutable.
The MLflow client exposes several methods to retrieve and manage models. The following table shows which of those methods are currently supported in MLflow when connected to Azure Machine Learning. It also compares it with other models management capabilities in Azure Machine Learning.
213
+
The MLflow client exposes several methods to retrieve and manage models. The following table shows which of those methods are currently supported in MLflow when connected to Azure ML. It also compares it with other models management capabilities in Azure ML.
| Feature | MLflow | Azure ML with MLflow | Azure ML CLIv2 | Azure ML Studio |
206
216
| :- | :-: | :-: | :-: | :-: |
207
217
| Registering models in MLflow format |**✓**|**✓**|**✓**|**✓**|
208
218
| Registering models not in MLflow format |||**✓**|**✓**|
209
219
| Registering models from runs outputs/artifacts |**✓**|**✓**<sup>1</sup> |**✓**<sup>2</sup> |**✓**|
210
220
| Registering models from runs outputs/artifacts in a different tracking server/workspace |**✓**||**✓**<sup>5</sup> |**✓**<sup>5</sup> |
0 commit comments