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
Copy file name to clipboardExpand all lines: articles/machine-learning/how-to-use-mlflow-cli-runs.md
+39-28Lines changed: 39 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -57,23 +57,6 @@ To track a run that is not running on Azure Machine Learning compute, you need t
57
57
> 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.
58
58
59
59
1. Getting the Azure Machine Learning Tracking URI:
You can use the Azure MLCLI v2 to get the MLflow tracking URI.
112
+
113
+
1. Login and configure your workspace:
114
+
115
+
```bash
116
+
az account set--subscription <subscription>
117
+
az configure --defaults workspace=<workspace> group=<resource-group> location=<location>
118
+
```
119
+
120
+
1. You can get the tracking URI using the `az ml workspace` command:
121
+
122
+
```bash
123
+
az ml workspace show --query mlflow_tracking_uri
124
+
```
125
+
124
126
# [Studio](#tab/studio)
125
127
126
128
Use the Azure Machine Learning portal to get the tracking URI:
@@ -129,6 +131,7 @@ To track a run that is not running on Azure Machine Learning compute, you need t
129
131
1. In the upper right corner, click on the name of your workspace to show the __Directory + Subscription + Workspace__ blade.
130
132
1. Click on __View all properties in Azure Portal__.
131
133
1. On the __Essentials__ section, you will find the property __MLflow tracking URI__.
134
+
132
135
133
136
# [Manually](#tab/manual)
134
137
@@ -148,14 +151,6 @@ To track a run that is not running on Azure Machine Learning compute, you need t
148
151
149
152
1. Configuring the tracking URI:
150
153
151
-
# [Using an environment variable](#tab/environ)
152
-
153
-
You can set the MLflow environment variables [MLFLOW_TRACKING_URI](https://mlflow.org/docs/latest/tracking.html#logging-to-a-tracking-server) in your compute to make any interaction with MLflow in that compute to point by default to Azure Machine Learning.
154
-
155
-
```bash
156
-
MLFLOW_TRACKING_URI=$(az ml workspace show --query mlflow_tracking_uri | sed 's/"//g')
157
-
```
158
-
159
154
# [Using MLflow SDK](#tab/mlflow)
160
155
161
156
Then the method [`set_tracking_uri()`](https://mlflow.org/docs/latest/python_api/mlflow.html#mlflow.set_tracking_uri) points the MLflow tracking URI to that URI.
@@ -166,24 +161,40 @@ To track a run that is not running on Azure Machine Learning compute, you need t
166
161
mlflow.set_tracking_uri(mlflow_tracking_uri)
167
162
```
168
163
164
+
# [Using an environment variable](#tab/environ)
165
+
166
+
You can set the MLflow environment variables [MLFLOW_TRACKING_URI](https://mlflow.org/docs/latest/tracking.html#logging-to-a-tracking-server) in your compute to make any interaction with MLflow in that compute to point by default to Azure Machine Learning.
167
+
168
+
```bash
169
+
MLFLOW_TRACKING_URI=$(az ml workspace show --query mlflow_tracking_uri | sed 's/"//g')
170
+
```
171
+
169
172
### Set experiment name
170
173
171
-
All MLflow runs are logged to the active experiment. By default, runs are logged to an experiment named `Default` that is automatically created for you. To configure the experiment you want to work on use MLflow command [`mlflow.set_experiment()`](https://mlflow.org/docs/latest/python_api/mlflow.html#mlflow.set_experiment).
174
+
All MLflow runs are logged to the active experiment. By default, runs are logged to an experiment named `Default` that is automatically created for you. You can configure the experiment where tracking is happening.
175
+
176
+
> [!TIP]
177
+
> When submitting jobs using Azure MLCLI v2, you can set the experiment name using the property`experiment_name`in the YAML definition of the job. You don't have to configure it on your training script. See [YAML: display name, experiment name, description, and tags](reference-yaml-job-command.md#yaml-display-name-experiment-name-description-and-tags) for details.
178
+
179
+
# [MLflow SDK](#tab/mlflow)
180
+
181
+
To configure the experiment you want to work on use MLflow command [`mlflow.set_experiment()`](https://mlflow.org/docs/latest/python_api/mlflow.html#mlflow.set_experiment).
172
182
173
183
```Python
174
184
experiment_name='experiment_with_mlflow'
175
185
mlflow.set_experiment(experiment_name)
176
186
```
177
187
178
-
> [!TIP]
179
-
> When submitting jobs using Azure ML CLI v2, you can set the experiment name using the property `experiment_name`in the YAML definition of the job. You don't have to configure it on your training script. See [YAML: display name, experiment name, description, and tags](reference-yaml-job-command.md#yaml-display-name-experiment-name-description-and-tags) for details.
188
+
# [Using an environment variable](#tab/environ)
180
189
181
190
You can also set one of the MLflow environment variables [MLFLOW_EXPERIMENT_NAMEorMLFLOW_EXPERIMENT_ID](https://mlflow.org/docs/latest/cli.html#cmdoption-mlflow-run-arg-uri) with the experiment name.
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 APIand begin logging your training job metrics.
0 commit comments