Skip to content

Commit 20658e7

Browse files
authored
Merge pull request #199523 from ssalgadodev/runsToJobsPart10
Runs to Jobs
2 parents f107d95 + 263d629 commit 20658e7

File tree

5 files changed

+25
-11
lines changed

5 files changed

+25
-11
lines changed

articles/machine-learning/how-to-use-batch-endpoint.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ Follow the below steps to view the scoring results in Azure Storage Explorer whe
257257
258258
:::code language="azurecli" source="~/azureml-examples-main/cli/batch-score.sh" ID="show_job_in_studio" :::
259259
260-
1. In the graph of the run, select the `batchscoring` step.
260+
1. In the graph of the job, select the `batchscoring` step.
261261
1. Select the __Outputs + logs__ tab and then select **Show data outputs**.
262262
1. From __Data outputs__, select the icon to open __Storage Explorer__.
263263

articles/machine-learning/how-to-use-batch-endpoints-studio.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ To change where the results are stored, providing a blob store and output path w
118118

119119
### Summary of all submitted jobs
120120

121-
To see a summary of all the submitted jobs for an endpoint, select the endpoint and then select the **Runs** tab.
121+
To see a summary of all the submitted jobs for an endpoint, select the endpoint and then select the **Jobs** tab.
122122

123123
:::image type="content" source="media/how-to-use-batch-endpoints-studio/summary-jobs.png" alt-text="Screenshot of summary of jobs submitted to a batch endpoint":::
124124
## Check batch scoring results

articles/machine-learning/how-to-use-managed-identities.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ az ml workspace create -w <workspace name> \
7373

7474
### Let Azure Machine Learning service create workspace ACR
7575

76-
If you don't bring your own ACR, Azure Machine Learning service will create one for you when you perform an operation that needs one. For example, submit a training run to Machine Learning Compute, build an environment, or deploy a web service endpoint. The ACR created by the workspace will have admin user enabled, and you need to disable the admin user manually.
76+
If you don't bring your own ACR, Azure Machine Learning service will create one for you when you perform an operation that needs one. For example, submit a training job to Machine Learning Compute, build an environment, or deploy a web service endpoint. The ACR created by the workspace will have admin user enabled, and you need to disable the admin user manually.
7777

7878
[!INCLUDE [cli v2](../../includes/machine-learning-cli-v2.md)]
7979

@@ -171,7 +171,7 @@ az role assignment create --assignee <principal ID> \
171171
--scope "/subscriptions/<subscription ID>/resourceGroups/<private ACR resource group>/providers/Microsoft.ContainerRegistry/registries/<private ACR name>"
172172
```
173173

174-
Finally, when submitting a training run, specify the base image location in the [environment definition](how-to-use-environments.md#use-existing-environments).
174+
Finally, when submitting a training job, specify the base image location in the [environment definition](how-to-use-environments.md#use-existing-environments).
175175

176176
[!INCLUDE [sdk v1](../../includes/machine-learning-sdk-v1.md)]
177177

articles/machine-learning/how-to-use-mlflow-azure-databricks.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ ms.custom: devx-track-python, sdkv1, event-tier1-build-2022
1717

1818
In this article, learn how to enable MLflow to connect to Azure Machine Learning while working in an Azure Databricks workspace. You can leverage this configuration for tracking, model management and model deployment.
1919

20-
[MLflow](https://www.mlflow.org) is an open-source library for managing the life cycle of your machine learning experiments. MLFlow Tracking is a component of MLflow that logs and tracks your training run metrics and model artifacts. Learn more about [Azure Databricks and MLflow](/azure/databricks/applications/mlflow/).
20+
[MLflow](https://www.mlflow.org) is an open-source library for managing the life cycle of your machine learning experiments. MLFlow Tracking is a component of MLflow that logs and tracks your training job metrics and model artifacts. Learn more about [Azure Databricks and MLflow](/azure/databricks/applications/mlflow/).
2121

2222
See [MLflow and Azure Machine Learning](concept-mlflow.md) for additional MLflow and Azure Machine Learning functionality integrations.
2323

@@ -30,6 +30,7 @@ If you have an MLflow Project to train with Azure Machine Learning, see [Train M
3030
* [Create an Azure Machine Learning Workspace](quickstart-create-resources.md).
3131
* See which [access permissions you need to perform your MLflow operations with your workspace](how-to-assign-roles.md#mlflow-operations).
3232

33+
3334
## Install libraries
3435

3536
To install libraries on your cluster, navigate to the **Libraries** tab and select **Install New**
@@ -167,10 +168,13 @@ When MLflow is configured to exclusively track experiments in Azure Machine Lear
167168
mlflow.set_experiment(experiment_name="experiment-name")
168169
```
169170

171+
In your training script, import `mlflow` to use the MLflow logging APIs, and start logging your job metrics. The following example, logs the epoch loss metric.
172+
170173
## Logging models with MLflow
171174

172175
After your model is trained, you can log it to the tracking server with the `mlflow.<model_flavor>.log_model()` method. `<model_flavor>`, refers to the framework associated with the model. [Learn what model flavors are supported](https://mlflow.org/docs/latest/models.html#model-api). In the following example, a model created with the Spark library MLLib is being registered:
173176

177+
174178
```python
175179
mlflow.spark.log_model(model, artifact_path = "model")
176180
```
@@ -272,5 +276,5 @@ The [Training models in Azure Databricks and deploying them on Azure ML](https:/
272276
## Next steps
273277
* [Deploy MLflow models as an Azure web service](how-to-deploy-mlflow-models.md).
274278
* [Manage your models](concept-model-management-and-deployment.md).
275-
* [Track experiment runs with MLflow and Azure Machine Learning](how-to-use-mlflow.md).
279+
* [Track experiment jobs with MLflow and Azure Machine Learning](how-to-use-mlflow.md).
276280
* Learn more about [Azure Databricks and MLflow](/azure/databricks/applications/mlflow/).

articles/machine-learning/how-to-use-mlflow-cli-runs.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ ms.devlang: azurecli
2222
2323
In this article, learn how to enable [MLflow Tracking](https://mlflow.org/docs/latest/quickstart.html#using-the-tracking-api) to connect Azure Machine Learning as the backend of your MLflow experiments.
2424

25-
[MLflow](https://www.mlflow.org) is an open-source library for managing the lifecycle of your machine learning experiments. MLflow Tracking is a component of MLflow that logs and tracks your training run metrics and model artifacts, no matter your experiment's environment--locally on your computer, on a remote compute target, a virtual machine, or an [Azure Databricks cluster](how-to-use-mlflow-azure-databricks.md).
25+
[MLflow](https://www.mlflow.org) is an open-source library for managing the lifecycle of your machine learning experiments. MLflow Tracking is a component of MLflow that logs and tracks your training job metrics and model artifacts, no matter your experiment's environment--locally on your computer, on a remote compute target, a virtual machine, or an [Azure Databricks cluster](how-to-use-mlflow-azure-databricks.md).
2626

2727
See [MLflow and Azure Machine Learning](concept-mlflow.md) for all supported MLflow and Azure Machine Learning functionality including MLflow Project support (preview) and model deployment.
2828

2929
> [!IMPORTANT]
3030
> When using the Azure Machine Learning SDK v2, no native logging is provided. Instead, use MLflow's tracking capabilities. For more information, see [How to log and view metrics (v2)](how-to-log-view-metrics.md).
3131
3232
> [!TIP]
33-
> The information in this document is primarily for data scientists and developers who want to monitor the model training process. If you are an administrator interested in monitoring resource usage and events from Azure Machine Learning, such as quotas, completed training runs, or completed model deployments, see [Monitoring Azure Machine Learning](monitor-azure-machine-learning.md).
33+
> The information in this document is primarily for data scientists and developers who want to monitor the model training process. If you are an administrator interested in monitoring resource usage and events from Azure Machine Learning, such as quotas, completed training jobs, or completed model deployments, see [Monitoring Azure Machine Learning](monitor-azure-machine-learning.md).
3434
3535
> [!NOTE]
3636
> You can use the [MLflow Skinny client](https://github.com/mlflow/mlflow/blob/master/README_SKINNY.rst) which is a lightweight MLflow package without SQL storage, server, UI, or data science dependencies. This is recommended for users who primarily need the tracking and logging capabilities without importing the full suite of MLflow features including deployments.
@@ -44,6 +44,7 @@ See [MLflow and Azure Machine Learning](concept-mlflow.md) for all supported MLf
4444
* Install and [set up CLI (v2)](how-to-configure-cli.md#prerequisites) and make sure you install the ml extension.
4545
* Install and set up SDK(v2) for Python
4646

47+
4748
## Track runs from your local machine or remote compute
4849

4950
Tracking using MLflow with Azure Machine Learning lets you store the logged metrics and artifacts runs that were executed on your local machine into your Azure Machine Learning workspace.
@@ -52,6 +53,7 @@ Tracking using MLflow with Azure Machine Learning lets you store the logged metr
5253

5354
To track a run that is not running on Azure Machine Learning compute (from now on referred to as *"local compute"*), you need to point your local compute to the Azure Machine Learning MLflow Tracking URI.
5455

56+
5557
> [!NOTE]
5658
> When running on Azure Compute (Azure Notebooks, Jupyter Notebooks hosted on Azure Compute Instances or Compute Clusters) you don't have to configure the tracking URI. It's automatically configured for you.
5759
@@ -119,6 +121,7 @@ export MLFLOW_TRACKING_URI=$(az ml workspace show --query mlflow_tracking_uri |
119121

120122
The Azure Machine Learning Tracking URI can be constructed using the subscription ID, region of where the resource is deployed, resource group name and workspace name. The following code sample shows how:
121123

124+
122125
```python
123126
import mlflow
124127

@@ -157,9 +160,9 @@ You can also set one of the MLflow environment variables [MLFLOW_EXPERIMENT_NAME
157160
export MLFLOW_EXPERIMENT_NAME="experiment_with_mlflow"
158161
```
159162

160-
### Start training run
163+
### Start training job
161164

162-
After you set the MLflow experiment name, you can start your training run with `start_run()`. Then use `log_metric()` to activate the MLflow logging API and begin logging your training run metrics.
165+
After you set the MLflow experiment name, you can start your training job with `start_run()`. Then use `log_metric()` to activate the MLflow logging API and begin logging your training job metrics.
163166

164167
```Python
165168
import os
@@ -172,21 +175,25 @@ with mlflow.start_run() as mlflow_run:
172175
mlflow.log_artifact("helloworld.txt")
173176
```
174177

178+
175179
For details about how to log metrics, parameters and artifacts in a run using MLflow view [How to log and view metrics](how-to-log-view-metrics.md).
176180

177181
## Track jobs running on Azure Machine Learning
178182

183+
179184
[!INCLUDE [cli v2](../../includes/machine-learning-cli-v2.md)]
180185

181186
Remote runs (jobs) let you train your models in a more robust and repetitive way. They can also leverage more powerful computes, such as Machine Learning Compute clusters. See [Use compute targets for model training](how-to-set-up-training-targets.md) to learn about different compute options.
182187

188+
183189
When submitting runs using jobs, Azure Machine Learning automatically configures MLflow to work with the workspace the job is running in. This means that there is no need to configure the MLflow tracking URI. On top of that, experiments are automatically named based on the details of the job.
184190

185191
> [!IMPORTANT]
186192
> When submitting training jobs to Azure Machine Learning, you don't have to configure the MLflow tracking URI on your training logic as it is already configured for you.
187193

188194
### Creating a training routine
189195

196+
190197
First, you should create a `src` subdirectory and create a file with your training code in a `hello_world.py` file in the `src` subdirectory. All your training code will go into the `src` subdirectory, including `train.py`.
191198

192199
The training code is taken from this [MLfLow example](https://github.com/Azure/azureml-examples/blob/main/cli/jobs/basics/src/hello-mlflow.py) in the Azure Machine Learning example repo.
@@ -195,13 +202,15 @@ Copy this code into the file:
195202

196203
:::code language="python" source="~/azureml-examples-main/cli/jobs/basics/src/hello-mlflow.py":::
197204

205+
198206
> [!NOTE]
199207
> Note how this sample don't contains the instructions `mlflow.start_run` nor `mlflow.set_experiment`. This is automatically done by Azure Machine Learning.
200208

201209
### Submitting the job
202210

203211
Use the [Azure Machine Learning CLI (v2)](how-to-train-cli.md) to submit a remote run. When using the Azure Machine Learning CLI (v2), the MLflow tracking URI and experiment name are set automatically and directs the logging from MLflow to your workspace. Learn more about [logging Azure Machine Learning CLI (v2) experiments with MLflow](how-to-train-cli.md#model-tracking-with-mlflow)
204212

213+
205214
Create a YAML file with your job definition in a `job.yml` file. This file should be created outside the `src` directory. Copy this code into the file:
206215

207216
:::code language="azurecli" source="~/azureml-examples-main/cli/jobs/basics/hello-mlflow.yml":::
@@ -222,7 +231,7 @@ Retrieve run metric using MLflow [get_run()](https://mlflow.org/docs/latest/pyth
222231
```Python
223232
from mlflow.tracking import MlflowClient
224233

225-
# Use MlFlow to retrieve the run that was just completed
234+
# Use MlFlow to retrieve the job that was just completed
226235
client = MlflowClient()
227236
run_id = mlflow_run.info.run_id
228237
finished_mlflow_run = MlflowClient().get_run(run_id)
@@ -234,6 +243,7 @@ params = finished_mlflow_run.data.params
234243
print(metrics,tags,params)
235244
```
236245

246+
237247
To view the artifacts of a run, you can use [MlFlowClient.list_artifacts()](https://mlflow.org/docs/latest/python_api/mlflow.tracking.html#mlflow.tracking.MlflowClient.list_artifacts)
238248

239249
```Python

0 commit comments

Comments
 (0)