Skip to content

Commit 7f08a77

Browse files
authored
Merge pull request #211075 from sdgilley/sdg-v2-update2
move migrate to scriptrunconfig to v1
2 parents 5802091 + 4d6a51c commit 7f08a77

9 files changed

+1498
-15
lines changed

articles/machine-learning/.openpublishing.redirection.machine-learning.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
"redirect_url": "/azure/machine-learning/v1/how-to-convert-ml-experiment-to-production",
77
"redirect_document_id": true
88
},
9+
{
10+
"source_path_from_root": "/articles/machine-learning/how-to-migrate-from-estimators-to-scriptrunconfig.md",
11+
"redirect_url": "/azure/machine-learning/v1/how-to-migrate-from-estimators-to-scriptrunconfig",
12+
"redirect_document_id": true
13+
},
914
{
1015
"source_path_from_root": "/articles/machine-learning/how-to-troubleshoot-prebuilt-docker-image-inference.md",
1116
"redirect_url": "/azure/machine-learning/v1/how-to-troubleshoot-prebuilt-docker-image-inference",

articles/machine-learning/toc.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,8 +407,6 @@
407407
href: how-to-train-pytorch.md
408408
- name: Train with custom Docker image
409409
href: how-to-train-with-custom-image.md
410-
- name: Migrate from Estimators to ScriptRunConfig
411-
href: how-to-migrate-from-estimators-to-scriptrunconfig.md
412410
- name: Use Key Vault when training
413411
displayName: secrets keyvault
414412
href: how-to-use-secrets-in-runs.md

articles/machine-learning/how-to-migrate-from-estimators-to-scriptrunconfig.md renamed to articles/machine-learning/v1/how-to-migrate-from-estimators-to-scriptrunconfig.md

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@ ms.author: larryfr
88
ms.reviewer: sgilley
99
ms.service: machine-learning
1010
ms.subservice: core
11-
ms.date: 12/14/2020
11+
ms.date: 09/14/2022
1212
ms.topic: how-to
1313
ms.custom: devx-track-python, contperf-fy21q1, sdkv1, event-tier1-build-2022
1414
---
1515

1616
# Migrating from Estimators to ScriptRunConfig
1717

18-
[!INCLUDE [sdk v1](../../includes/machine-learning-sdk-v1.md)]
18+
[!INCLUDE [sdk v1](../../../includes/machine-learning-sdk-v1.md)]
1919

2020
Up until now, there have been multiple methods for configuring a training job in Azure Machine Learning via the SDK, including Estimators, ScriptRunConfig, and the lower-level RunConfiguration. To address this ambiguity and inconsistency, we are simplifying the job configuration process in Azure ML. You should now use ScriptRunConfig as the recommended option for configuring training jobs.
2121

22-
Estimators are deprecated with the 1.19.0 release of the Python SDK. You should also generally avoid explicitly instantiating a RunConfiguration object yourself, and instead configure your job using the ScriptRunConfig class.
22+
Estimators are deprecated with the 1.19. release of the Python SDK. You should also generally avoid explicitly instantiating a RunConfiguration object yourself, and instead configure your job using the ScriptRunConfig class.
2323

2424
This article covers common considerations when migrating from Estimators to ScriptRunConfig.
2525

@@ -30,7 +30,7 @@ This article covers common considerations when migrating from Estimators to Scri
3030
Azure Machine Learning documentation and samples have been updated to use [ScriptRunConfig](/python/api/azureml-core/azureml.core.script_run_config.scriptrunconfig) for job configuration and submission.
3131

3232
For information on using ScriptRunConfig, refer to the following documentation:
33-
* [Configure and submit training jobs](v1/how-to-set-up-training-targets.md)
33+
* [Configure and submit training jobs](how-to-set-up-training-targets.md)
3434
* [Configuring PyTorch training jobs](how-to-train-pytorch.md)
3535
* [Configuring TensorFlow training jobs](how-to-train-tensorflow.md)
3636
* [Configuring scikit-learn training jobs](how-to-train-scikit-learn.md)
@@ -44,15 +44,15 @@ While the various framework estimators have preconfigured environments that are
4444

4545
When using ScriptRunConfig, all environment-related configurations are encapsulated in the `Environment` object that gets passed into the `environment` parameter of the ScriptRunConfig constructor. To configure a training job, provide an environment that has all the dependencies required for your training script. If no environment is provided, Azure ML will use one of the Azure ML base images, specifically the one defined by `azureml.core.environment.DEFAULT_CPU_IMAGE`, as the default environment. There are a couple of ways to provide an environment:
4646

47-
* [Use a curated environment](how-to-use-environments.md#use-a-curated-environment) - curated environments are predefined environments available in your workspace by default. There is a corresponding curated environment for each of the preconfigured framework/version Docker images that backed each framework estimator.
47+
* [Use a curated environment](../how-to-use-environments.md#use-a-curated-environment) - curated environments are predefined environments available in your workspace by default. There is a corresponding curated environment for each of the preconfigured framework/version Docker images that backed each framework estimator.
4848
* [Define your own custom environment](how-to-use-environments.md)
4949

50-
Here is an example of using the curated PyTorch 1.6 environment for training:
50+
Here is an example of using the curated environment for training:
5151

5252
```python
5353
from azureml.core import Workspace, ScriptRunConfig, Environment
5454

55-
curated_env_name = 'AzureML-PyTorch-1.6-GPU'
55+
curated_env_name = '<add Pytorch curated environment name here>'
5656
pytorch_env = Environment.get(workspace=ws, name=curated_env_name)
5757

5858
compute_target = ws.compute_targets['my-cluster']
@@ -62,15 +62,18 @@ src = ScriptRunConfig(source_directory='.',
6262
environment=pytorch_env)
6363
```
6464

65+
> [!TIP]
66+
> For a list of curated environments, see [curated environments](../resource-curated-environments.md).
67+
6568
If you want to specify **environment variables** that will get set on the process where the training script is executed, use the Environment object:
6669
```
6770
myenv.environment_variables = {"MESSAGE":"Hello from Azure Machine Learning"}
6871
```
6972

7073
For information on configuring and managing Azure ML environments, see:
7174
* [How to use environments](how-to-use-environments.md)
72-
* [Curated environments](resource-curated-environments.md)
73-
* [Train with a custom Docker image](how-to-train-with-custom-image.md)
75+
* [Curated environments](../resource-curated-environments.md)
76+
* [Train with a custom Docker image](../how-to-train-with-custom-image.md)
7477

7578
## Using data for training
7679
### Datasets
@@ -101,7 +104,7 @@ src.run_config.data_references = {data_ref.data_reference_name: data_ref.to_conf
101104
```
102105

103106
For more information on using data for training, see:
104-
* [Train with datasets in Azure ML](v1/how-to-train-with-datasets.md)
107+
* [Train with datasets in Azure ML](how-to-train-with-datasets.md)
105108

106109
## Distributed training
107110
If you need to configure a distributed job for training, do so by specifying the `distributed_job_config` parameter in the ScriptRunConfig constructor. Pass in an [MpiConfiguration](/python/api/azureml-core/azureml.core.runconfig.mpiconfiguration), [PyTorchConfiguration](/python/api/azureml-core/azureml.core.runconfig.pytorchconfiguration), or [TensorflowConfiguration](/python/api/azureml-core/azureml.core.runconfig.tensorflowconfiguration) for distributed jobs of the respective types.
@@ -129,4 +132,4 @@ src.run_config
129132

130133
## Next steps
131134

132-
* [Configure and submit training jobs](v1/how-to-set-up-training-targets.md)
135+
* [Configure and submit training jobs](how-to-set-up-training-targets.md)

0 commit comments

Comments
 (0)