Skip to content

Commit 97f8660

Browse files
authored
Merge pull request #107628 from Blackmist/hdinsight-vnet-updates
updating with info about attaching hdinsight and vms
2 parents 6ad3dd3 + b2edd59 commit 97f8660

File tree

1 file changed

+40
-11
lines changed

1 file changed

+40
-11
lines changed

articles/machine-learning/how-to-set-up-training-targets.md

Lines changed: 40 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ms.reviewer: sgilley
99
ms.service: machine-learning
1010
ms.subservice: core
1111
ms.topic: conceptual
12-
ms.date: 01/16/2020
12+
ms.date: 03/13/2020
1313
ms.custom: seodec18
1414
---
1515
# Set up and use compute targets for model training
@@ -20,7 +20,7 @@ With Azure Machine Learning, you can train your model on a variety of resources
2020
You can create and manage a compute target using the Azure Machine Learning SDK, Azure Machine Learning studio, Azure CLI or Azure Machine Learning VS Code extension. If you have compute targets that were created through another service (for example, an HDInsight cluster), you can use them by attaching them to your Azure Machine Learning workspace.
2121

2222
In this article, you learn how to use various compute targets for model training. The steps for all compute targets follow the same workflow:
23-
1. __Create__ a compute target if you dont already have one.
23+
1. __Create__ a compute target if you don't already have one.
2424
2. __Attach__ the compute target to your workspace.
2525
3. __Configure__ the compute target so that it contains the Python environment and package dependencies needed by your script.
2626

@@ -83,7 +83,7 @@ Use the sections below to configure these compute targets:
8383

8484
[!code-python[](~/aml-sdk-samples/ignore/doc-qa/how-to-set-up-training-targets/local.py?name=run_local)]
8585

86-
Now that youve attached the compute and configured your run, the next step is to [submit the training run](#submit).
86+
Now that you've attached the compute and configured your run, the next step is to [submit the training run](#submit).
8787

8888
### <a id="amlcompute"></a>Azure Machine Learning Compute
8989

@@ -108,7 +108,7 @@ You can create Azure Machine Learning Compute as a compute target at run time. T
108108
[!code-python[](~/aml-sdk-samples/ignore/doc-qa/how-to-set-up-training-targets/amlcompute.py?name=run_temp_compute)]
109109

110110

111-
Now that youve attached the compute and configured your run, the next step is to [submit the training run](#submit).
111+
Now that you've attached the compute and configured your run, the next step is to [submit the training run](#submit).
112112

113113
#### <a id="persistent"></a>Persistent compute
114114

@@ -130,7 +130,7 @@ A persistent Azure Machine Learning Compute can be reused across jobs. The compu
130130

131131
[!code-python[](~/aml-sdk-samples/ignore/doc-qa/how-to-set-up-training-targets/amlcompute2.py?name=run_amlcompute)]
132132

133-
Now that youve attached the compute and configured your run, the next step is to [submit the training run](#submit).
133+
Now that you've attached the compute and configured your run, the next step is to [submit the training run](#submit).
134134

135135

136136
### <a id="vm"></a>Remote virtual machines
@@ -148,15 +148,30 @@ Use the Azure Data Science Virtual Machine (DSVM) as the Azure VM of choice for
148148
149149
1. **Attach**: To attach an existing virtual machine as a compute target, you must provide the fully qualified domain name (FQDN), user name, and password for the virtual machine. In the example, replace \<fqdn> with the public FQDN of the VM, or the public IP address. Replace \<username> and \<password> with the SSH user name and password for the VM.
150150

151+
> [!IMPORTANT]
152+
> The following Azure regions do not support attaching a virtual machine using the public IP address of the VM. Instead, use the Azure Resource Manager ID of the VM with the `resource_id` parameter:
153+
>
154+
> * US East
155+
> * US West 2
156+
> * US South Central
157+
>
158+
> The resource ID of the VM can be constructed using the subscription ID, resource group name, and VM name using the following string format: `/subscriptions/<subscription_id>/resourceGroups/<resource_group>/providers/Microsoft.Compute/virtualMachines/<vm_name>`.
159+
160+
151161
```python
152162
from azureml.core.compute import RemoteCompute, ComputeTarget
153163

154164
# Create the compute config
155165
compute_target_name = "attach-dsvm"
156-
attach_config = RemoteCompute.attach_configuration(address = "<fqdn>",
166+
attach_config = RemoteCompute.attach_configuration(address='<fqdn>',
157167
ssh_port=22,
158168
username='<username>',
159169
password="<password>")
170+
# If in US East, US West 2, or US South Central, use the following instead:
171+
# attach_config = RemoteCompute.attach_configuration(resource_id='<resource_id>',
172+
# ssh_port=22,
173+
# username='<username>',
174+
# password="<password>")
160175

161176
# If you authenticate with SSH keys instead, use this code:
162177
# ssh_port=22,
@@ -178,7 +193,7 @@ Use the Azure Data Science Virtual Machine (DSVM) as the Azure VM of choice for
178193
[!code-python[](~/aml-sdk-samples/ignore/doc-qa/how-to-set-up-training-targets/dsvm.py?name=run_dsvm)]
179194

180195

181-
Now that youve attached the compute and configured your run, the next step is to [submit the training run](#submit).
196+
Now that you've attached the compute and configured your run, the next step is to [submit the training run](#submit).
182197

183198
### <a id="hdinsight"></a>Azure HDInsight
184199

@@ -192,6 +207,15 @@ Azure HDInsight is a popular platform for big-data analytics. The platform provi
192207

193208
1. **Attach**: To attach an HDInsight cluster as a compute target, you must provide the hostname, user name, and password for the HDInsight cluster. The following example uses the SDK to attach a cluster to your workspace. In the example, replace \<clustername> with the name of your cluster. Replace \<username> and \<password> with the SSH user name and password for the cluster.
194209

210+
> [!IMPORTANT]
211+
> The following Azure regions do not support attaching an HDInsight cluster using the public IP address of the cluster. Instead, use the Azure Resource Manager ID of the cluster with the `resource_id` parameter:
212+
>
213+
> * US East
214+
> * US West 2
215+
> * US South Central
216+
>
217+
> The resource ID of the cluster can be constructed using the subscription ID, resource group name, and cluster name using the following string format: `/subscriptions/<subscription_id>/resourceGroups/<resource_group>/providers/Microsoft.HDInsight/clusters/<cluster_name>`.
218+
195219
```python
196220
from azureml.core.compute import ComputeTarget, HDInsightCompute
197221
from azureml.exceptions import ComputeTargetException
@@ -202,6 +226,11 @@ Azure HDInsight is a popular platform for big-data analytics. The platform provi
202226
ssh_port=22,
203227
username='<ssh-username>',
204228
password='<ssh-pwd>')
229+
# If you are in US East, US West 2, or US South Central, use the following instead:
230+
# attach_config = HDInsightCompute.attach_configuration(resource_id='<resource_id>',
231+
# ssh_port=22,
232+
# username='<ssh-username>',
233+
# password='<ssh-pwd>')
205234
hdi_compute = ComputeTarget.attach(workspace=ws,
206235
name='myhdi',
207236
attach_configuration=attach_config)
@@ -219,7 +248,7 @@ Azure HDInsight is a popular platform for big-data analytics. The platform provi
219248
[!code-python[](~/aml-sdk-samples/ignore/doc-qa/how-to-set-up-training-targets/hdi.py?name=run_hdi)]
220249

221250

222-
Now that youve attached the compute and configured your run, the next step is to [submit the training run](#submit).
251+
Now that you've attached the compute and configured your run, the next step is to [submit the training run](#submit).
223252

224253

225254
### <a id="azbatch"></a>Azure Batch
@@ -228,9 +257,9 @@ Azure Batch is used to run large-scale parallel and high-performance computing (
228257

229258
To attach Azure Batch as a compute target, you must use the Azure Machine Learning SDK and provide the following information:
230259

231-
- **Azure Batch compute name**: A friendly name to be used for the compute within the workspace
232-
- **Azure Batch account name**: The name of the Azure Batch account
233-
- **Resource Group**: The resource group that contains the Azure Batch account.
260+
- **Azure Batch compute name**: A friendly name to be used for the compute within the workspace
261+
- **Azure Batch account name**: The name of the Azure Batch account
262+
- **Resource Group**: The resource group that contains the Azure Batch account.
234263

235264
The following code demonstrates how to attach Azure Batch as a compute target:
236265

0 commit comments

Comments
 (0)