Skip to content

Commit 0901c6f

Browse files
authored
Merge pull request #273240 from fbsolo-ms1/update-data-science-virtual-machine-files
Freshness update for how-to-track-experiments.md . . .
2 parents 68d3b01 + e4e6b43 commit 0901c6f

File tree

3 files changed

+51
-47
lines changed

3 files changed

+51
-47
lines changed

articles/machine-learning/data-science-virtual-machine/dsvm-ubuntu-intro.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ The Linux VM is already provisioned with X2Go Server and is ready to accept clie
8888
1. Download and install the X2Go client for your client platform from [X2Go](https://wiki.x2go.org/doku.php/doc:installation:x2goclient).
8989
1. Note the public IP address of the virtual machine. In the Azure portal, open the virtual machine you created to find this information.
9090

91-
![Ubuntu machine IP address](./media/dsvm-ubuntu-intro/ubuntu-ip-address.png)
91+
:::image type="content" source="./media/dsvm-ubuntu-intro/ubuntu-ip-address.png" alt-text="Screenshot showing the public IP address of the virtual machine." lightbox= "./media/dsvm-ubuntu-intro/ubuntu-ip-address.png":::
9292

9393
1. Run the X2Go client. If the "New Session" window doesn't automatically pop up, go to Session -> New Session.
9494

@@ -101,7 +101,7 @@ The Linux VM is already provisioned with X2Go Server and is ready to accept clie
101101
* **Media tab**: You can turn off sound support and client printing if you don't need to use them.
102102
* **Shared folders**: Use this tab to add client machine directory that you would like to mount on the VM.
103103

104-
![X2go configuration](./media/dsvm-ubuntu-intro/x2go-ubuntu.png)
104+
:::image type="content" source="./media/dsvm-ubuntu-intro/x2go-ubuntu.png" alt-text="Screenshot showing preferences for a new X2Go session." lightbox= "./media/dsvm-ubuntu-intro/x2go-ubuntu.png":::
105105
1. Select **OK**.
106106
1. Select on the box in the right pane of the X2Go window to bring up the sign-in screen for your VM.
107107
1. Enter the password for your VM.
@@ -113,18 +113,19 @@ The Linux VM is already provisioned with X2Go Server and is ready to accept clie
113113

114114
The Ubuntu DSVM runs [JupyterHub](https://github.com/jupyterhub/jupyterhub), a multiuser Jupyter server. To connect, take the following steps:
115115

116-
1. Note the public IP address for your VM. To find this value, search for and select your VM in the Azure portal.
117-
![Ubuntu machine IP address](./media/dsvm-ubuntu-intro/ubuntu-ip-address.png)
116+
1. Note the public IP address of your VM. To find this value, search for and select your VM in the Azure portal, as shown in this screenshot:
117+
118+
:::image type="content" source="./media/dsvm-ubuntu-intro/ubuntu-ip-address.png" alt-text="Screenshot highlighting the public IP address of your VM." lightbox= "./media/dsvm-ubuntu-intro/ubuntu-ip-address.png":::
118119

119120
1. From your local machine, open a web browser, and navigate to https:\//**your-vm-ip**:8000, replacing "**your-vm-ip**" with the IP address you noted earlier.
120121
1. Your browser will probably prevent you from opening the page directly. It might tell you that there's a certificate error. The DSVM provides security with a self-signed certificate. Most browsers will allow you to select through after this warning. Many browsers will continue to provide some kind of visual warning about the certificate throughout your Web session.
121122

122123
>[!NOTE]
123124
> If you see the `ERR_EMPTY_RESPONSE` error message in your browser, make sure you access the machine by explicit use of the *HTTPS* protocol. *HTTP* or just the web address don't work for this step. If you type the web address without `https://` in the address line, most browsers will default to `http`, and the error will appear.
124125
125-
1. Enter the username and password that you used to create the VM, and sign in.
126+
1. Enter the username and password that you used to create the VM, and sign in, as shown in this screenshot
126127

127-
![Enter Jupyter login](./media/dsvm-ubuntu-intro/jupyter-login.png)
128+
:::image type="content" source="./media/dsvm-ubuntu-intro/jupyter-login.png" alt-text="Screenshot the JupyterHub sign-in screen." lightbox= "./media/dsvm-ubuntu-intro/jupyter-login.png":::
128129

129130
>[!NOTE]
130131
> If you receive a 500 Error at this stage, you probably used capitalized letters in your username. This is a known interaction between Jupyter Hub and the PAMAuthenticator it uses.

articles/machine-learning/data-science-virtual-machine/how-to-track-experiments.md

Lines changed: 44 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -8,38 +8,39 @@ ms.custom: sdkv1
88
author: samkemp
99
ms.author: samkemp
1010
ms.topic: conceptual
11-
ms.date: 07/17/2020
11+
ms.reviewer: franksolomon
12+
ms.date: 04/23/2024
1213
---
1314

1415
# Track experiments and deploy models in Azure Machine Learning
1516

16-
Enhance the model creation process by tracking your experiments and monitoring run metrics. In this article, learn how to add logging code to your training script using the [MLflow](https://mlflow.org/) API and track the experiment in Azure Machine Learning.
17+
In this article, learn how to add logging code to your training script with the [MLflow](https://mlflow.org/) API and track the experiment in Azure Machine Learning. You can monitor run metrics, to enhance the model creation process.
1718

18-
The following diagram illustrates that with MLflow Tracking, you track an experiment's run metrics and store model artifacts in your Azure Machine Learning workspace.
19+
This diagram shows that with MLflow Tracking, you track the run metrics of an experiment, and store model artifacts in your Azure Machine Learning workspace:
1920

20-
![track experiments](./media/how-to-track-experiments/mlflow-diagram-track.png)
21+
:::image type="content" source="./media/how-to-track-experiments/mlflow-diagram-track.png" alt-text="Diagram showing the MLflow operational concept." lightbox= "./media/how-to-track-experiments/mlflow-diagram-track.png":::
2122

2223
## Prerequisites
2324

24-
* You'll need to [provision an Azure Machine Learning Workspace](../how-to-manage-workspace.md#create-a-workspace)
25+
* [Provision an Azure Machine Learning Workspace](../how-to-manage-workspace.md#create-a-workspace)
2526

2627
## Create a new notebook
2728

28-
The Azure Machine Learning and MLFlow SDK are preinstalled on the Data Science VM and can be accessed in the **azureml_py36_\*** conda environment. In JupyterLab, click on the launcher and select the following kernel:
29+
The Azure Machine Learning and MLFlow SDK are preinstalled on the Data Science Virtual Machine (DSVM). You can access these resources in the **azureml_py36_\*** conda environment. In JupyterLab, select on the launcher and select this kernel:
2930

30-
![kernel selection](./media/how-to-track-experiments/experiment-tracking-1.png)
31+
:::image type="content" source="./media/how-to-track-experiments/experiment-tracking-1.png" alt-text="Screenshot showing selection of the azureml_py36_pytorch kernel." lightbox= "./media/how-to-track-experiments/experiment-tracking-1.png":::
3132

3233
## Set up the workspace
3334

34-
Go to the [Azure portal](https://portal.azure.com) and select the workspace you provisioned as part of the prerequisites. You'll see __Download config.json__ (see below) - download the config and ensure It's stored in your working directory on the DSVM.
35+
Go to the [Azure portal](https://portal.azure.com) and select the workspace you provisioned as part of the prerequisites. Note the __Download config.json__ configuration file, as shown in the next image. Download this file, and store it in your working directory on the DSVM.
3536

36-
![Get config file](./media/how-to-track-experiments/experiment-tracking-2.png)
37+
:::image type="content" source="./media/how-to-track-experiments/experiment-tracking-2.png" alt-text="Screenshot showing download of the config.json file." lightbox= "./media/how-to-track-experiments/experiment-tracking-2.png":::
3738

38-
The config contains information such as the workspace name, subscription, etc. and it means that you don't need to hard code these parameters.
39+
The config file contains workspace name, subscription, etc. information. You don't need to hard code these parameters with this file.
3940

4041
## Track DSVM runs
4142

42-
Add the following code to your notebook (or script) to set the Azure Machine Learning workspace object.
43+
To set the Azure Machine Learning workspace object, add this code to your notebook or script:
4344

4445
```Python
4546
import mlflow
@@ -50,12 +51,12 @@ ws = Workspace.from_config()
5051
mlflow.set_tracking_uri(ws.get_mlflow_tracking_uri())
5152
```
5253

53-
>[!NOTE]
54-
The tracking URI is valid up to an hour or less. If you restart your script after some idle time, use the get_mlflow_tracking_uri API to get a new URI.
54+
> [!NOTE]
55+
> The tracking URI is valid for up to one hour. If you restart your script after some idle time, use the get_mlflow_tracking_uri API to get a new URI.
5556
5657
### Load the data
5758

58-
This example uses the diabetes dataset, a well-known small dataset that comes with scikit-learn. This cell loads the dataset and splits it into random training and testing sets.
59+
This example uses the diabetes dataset, a well-known small dataset included with scikit-learn. This cell loads the dataset and splits it into random training and testing sets.
5960

6061
```python
6162
from sklearn.datasets import load_diabetes
@@ -77,7 +78,7 @@ print ("Data contains", len(data['train']['X']), "training samples and",len(data
7778

7879
### Add tracking
7980

80-
Add experiment tracking using the Azure Machine Learning SDK, and upload a persisted model into the experiment run record. The following code adds logs, and uploads a model file to the experiment run. The model is also registered in the Azure Machine Learning model registry.
81+
Add experiment tracking using the Azure Machine Learning SDK, and upload a persisted model into the experiment run record. This code sample adds logs, and uploads a model file to the experiment run. The model is also registered in the Azure Machine Learning model registry:
8182

8283
```python
8384
# Get an experiment object from Azure Machine Learning
@@ -110,73 +111,75 @@ with mlflow.start_run():
110111

111112
### View runs in Azure Machine Learning
112113

113-
You can view the experiment run in [Azure Machine Learning Studio](https://ml.azure.com). Click on __Experiments__ in the left-hand menu and select the 'experiment_with_mlflow' (or if you decided to name your experiment differently in the above snippet, click on the name used):
114+
You can view the experiment run in [Azure Machine Learning studio](https://ml.azure.com). Select __Experiments__ in the left-hand menu, and select the 'experiment_with_mlflow'. If you decided to name your experiment differently in the above snippet, select the name that you chose:
114115

115-
![select experiment](./media/how-to-track-experiments/mlflow-experiments.png)
116+
:::image type="content" source="./media/how-to-track-experiments/mlflow-experiments.png" alt-text="Screenshot showing selection of the experiment run." lightbox= "./media/how-to-track-experiments/mlflow-experiments.png":::
116117

117-
You should see the logged Mean Squared Error (MSE):
118+
The logged Mean Squared Error (MSE) should become visible:
118119

119-
![MSE](./media/how-to-track-experiments/mlflow-experiments-2.png)
120+
:::image type="content" source="./media/how-to-track-experiments/mlflow-experiments-2.png" alt-text="Screenshot showing the logged Mean Square Error of the experiment run." lightbox= "./media/how-to-track-experiments/mlflow-experiments-2.png":::
120121

121-
If you click on the run, You'll see other details and also the pickled model in the __Outputs+logs__
122+
If you select the run, you can view other details, and the selected model, in the __Outputs+logs__.
122123

123124
## Deploy model in Azure Machine Learning
124125

125-
In this section, we outline how to deploy models trained on a DSVM to Azure Machine Learning.
126+
This section describes how to deploy models, trained on a DSVM, to Azure Machine Learning.
126127

127128
### Step 1: Create Inference Compute
128129

129-
On the left-hand menu in [Azure Machine Learning Studio](https://ml.azure.com) click on __Compute__ and then the __Inference clusters__ tab. Next, click on __+ New__ as discussed below:
130+
On the left-hand menu in [Azure Machine Learning studio](https://ml.azure.com) select __Compute__, as shown in this screenshot:
130131

131-
![Create Inference Compute](./media/how-to-track-experiments/mlflow-experiments-6.png)
132+
:::image type="content" source="./media/how-to-track-experiments/mlflow-experiments-6.png" alt-text="Screenshot showing selection of 'Compute' in Azure Machine Learning studio." lightbox= "./media/how-to-track-experiments/mlflow-experiments-6.png":::
132133

133-
In the __New Inference cluster__ pane fill details for:
134+
In the __New Inference cluster__ pane, fill in the details for
134135

135136
* Compute Name
136137
* Kubernetes Service - select create new
137138
* Select the region
138-
* Select the VM size (for the purposes of this tutorial, the default of Standard_D3_v2 is sufficient)
139+
* Select the virtual machine size (for the purposes of this tutorial, the default of Standard_D3_v2 is sufficient)
139140
* Cluster Purpose - select __Dev-test__
140141
* Number of nodes should equal __1__
141142
* Network Configuration - Basic
142143

143-
Next, click on __Create__.
144+
as shown in this screenshot:
144145

145-
![compute details](./media/how-to-track-experiments/mlflow-experiments-7.png)
146+
:::image type="content" source="./media/how-to-track-experiments/mlflow-experiments-7.png" alt-text="Screenshot showing selection of the Inference Clusters pane." lightbox= "./media/how-to-track-experiments/mlflow-experiments-7.png":::
147+
148+
Select __Create__.
146149

147150
### Step 2: Deploy no-code inference service
148151

149-
When we registered the model in our code using `register_model`, we specified the framework as sklearn. Azure Machine Learning supports no code deployments for the following frameworks:
152+
When we registered the model in our code using `register_model`, we specified the framework as **sklearn**. Azure Machine Learning supports no code deployments for these frameworks:
150153

151154
* scikit-learn
152155
* Tensorflow SaveModel format
153156
* ONNX model format
154157

155-
No-code deployment means that you can deploy straight from the model artifact without needing to specify any specific scoring script.
158+
No-code deployment means that you can deploy straight from the model artifact. You don't need to specify any specific scoring script.
156159

157-
To deploy the diabetes model, go to the left-hand menu in the [Azure Machine Learning Studio](https://ml.azure.com) and select __Models__. Next, click on the registered diabetes_model:
160+
To deploy the diabetes model, go to the left-hand menu in the [Azure Machine Learning studio](https://ml.azure.com) and select __Models__. Next, select the registered diabetes_model:
158161

159-
![Select model](./media/how-to-track-experiments/mlflow-experiments-3.png)
162+
:::image type="content" source="./media/how-to-track-experiments/mlflow-experiments-3.png" alt-text="Screenshot showing selection of the Diabetes Model." lightbox= "./media/how-to-track-experiments/mlflow-experiments-3.png":::
160163

161-
Next, click on the __Deploy__ button in the model details pane:
164+
Next, select the __Deploy__ button in the model details pane:
162165

163-
![Deploy](./media/how-to-track-experiments/mlflow-experiments-4.png)
166+
:::image type="content" source="./media/how-to-track-experiments/mlflow-experiments-4.png" alt-text="Screenshot showing selection of the Deploy button." lightbox= "./media/how-to-track-experiments/mlflow-experiments-4.png":::
164167

165-
We will deploy the model to the Inference Cluster (Azure Kubernetes Service) we created in step 1. Fill the details below by providing a name for the service, and the name of the AKS compute cluster (created in step 1). We also recommend that you increase the __CPU reserve capacity__ to 1 (from 0.1) and the __Memory reserve capacity__ to 1 (from 0.5) - you can make this increase by clicking on __Advanced__ and filling in the details. Then click __Deploy__.
168+
The model will deploy to the Inference Cluster (Azure Kubernetes Service) we created in step 1. Provide a name for the service, and the name of the AKS compute cluster (created in step 1), to fill in the details. We also recommend that you increase the __CPU reserve capacity__ from 0.1 to 1, and the __Memory reserve capacity__ from 0.5 to 1. Select __Advanced__ and fill in the details to set this increase. Then select __Deploy__, as shown in this screenshot:
166169

167-
![deploy details](./media/how-to-track-experiments/mlflow-experiments-5.png)
170+
:::image type="content" source="./media/how-to-track-experiments/mlflow-experiments-5.png" alt-text="Screenshot showing details of the model deployment." lightbox= "./media/how-to-track-experiments/mlflow-experiments-5.png":::
168171

169172
### Step 3: Consume
170173

171-
When the model has deployed successfully, you should see the following (to get to this page click on Endpoints from the left-hand menu > then click on the name of deployed service):
174+
When the model successfully deploys, select Endpoints from the left-hand menu, then select the name of the deployed service. The model details pane should become visible, as shown in this screenshot:
172175

173-
![Consume model](./media/how-to-track-experiments/mlflow-experiments-8.png)
176+
:::image type="content" source="./media/how-to-track-experiments/mlflow-experiments-8.png" alt-text="Screenshot showing the model details pane." lightbox= "./media/how-to-track-experiments/mlflow-experiments-8.png":::
174177

175-
You should see that the deployment state goes from __transitioning__ to __healthy__. In addition, this details section provides the REST endpoint and Swagger URLs that an application developer can use to integrate your ML model into their apps.
178+
The deployment state should change from __transitioning__ to __healthy__. Additionally, the details section provides the REST endpoint and Swagger URLs that application developers can use to integrate your ML model into their apps.
176179

177-
You can test the endpoint using [Postman](https://www.postman.com/), or you can use the Azure Machine Learning SDK:
180+
You can test the endpoint with [Postman](https://www.postman.com/), or you can use the Azure Machine Learning SDK:
178181

179-
[!INCLUDE [sdk v1](../includes/machine-learning-sdk-v1.md)]
182+
[!INCLUDE [SDK v1](../includes/machine-learning-sdk-v1.md)]
180183

181184
```python
182185
from azureml.core import Webservice
@@ -197,7 +200,7 @@ print(output)
197200

198201
### Step 4: Clean up
199202

200-
Delete the Inference Compute you created in Step 1 so that you don't incur ongoing compute charges. On the left-hand menu in the Azure Machine Learning Studio, click on Compute > Inference Clusters > Select the compute > Delete.
203+
Delete the Inference Compute you created in Step 1, to avoid ongoing compute charges. To do this, on the left-hand menu in the Azure Machine Learning studio, select Compute > Inference Clusters > Select the specific Inference Compute Resource > Delete.
201204

202205
## Next Steps
203206

-4.78 KB
Loading

0 commit comments

Comments
 (0)